Jump to content
  • 0

Launch script only one time when the map server start.


Vali

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  128
  • Reputation:   7
  • Joined:  12/29/11
  • Last Seen:  

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!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   13
  • Joined:  12/09/11
  • Last Seen:  

Try this.

OnInterIfInit:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  128
  • Reputation:   7
  • Joined:  12/29/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  128
  • Reputation:   7
  • Joined:  12/29/11
  • Last Seen:  

Is that a bug then? I tested it again and the script launchs when i use @reloadscript.

:(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  128
  • Reputation:   7
  • Joined:  12/29/11
  • Last Seen:  

Thank you Gepard, I will try this way.

:(

Link to comment
Share on other sites

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.

×
×
  • Create New...