Jump to content
  • 0

Launch script only one time when the map server start.


Question

Posted

Hi,

I have this code that must be launched only one time when the mapserver starts. The problem is that if i use @reloadscript this code is launched again, and the tables truncated.

How can i do to avoid this script be launched when I use @reloadscript?

-    script    web_shop_truncate    -1,{
   OnInterIfInitOnce:
    query_sql "TRUNCATE TABLE `web_vending_shops`";
    end;
}

Thank you!

6 answers to this question

Recommended Posts

Posted

OnInterIfInitOnce should work, it "will only execute once and will not execute if the map server reconnects to the char server later".

You want the `web_vending_shops` table to be truncated when the map-server starts right?

Posted

OnInterIfInitOnce should work, it "will only execute once and will not execute if the map server reconnects to the char server later".

You want the `web_vending_shops` table to be truncated when the map-server starts right?

Yes its what i want, Its are being truncate when I use @reloadscript too.

/heh

Posted

It's not a bug. @reloadscript causes all scripts to be removed from memory and loaded again as if you had just started the server (and that's the purpose of the command, to reload all scripts without having to shutdown).

I suggest you create a *.sql script with the query and add it to your athena start script, something like that

mysql -u username -ppassword database_name < truncate_vending.sql

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...