Vali Posted January 8, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Share Posted January 8, 2012 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! Quote Link to comment Share on other sites More sharing options...
Ghost Posted January 8, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 24 Reputation: 13 Joined: 12/09/11 Last Seen: June 3, 2012 Share Posted January 8, 2012 Try this. OnInterIfInit: Quote Link to comment Share on other sites More sharing options...
Brian Posted January 8, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 594 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted January 8, 2012 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? Quote Link to comment Share on other sites More sharing options...
Vali Posted January 9, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Author Share Posted January 9, 2012 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. Quote Link to comment Share on other sites More sharing options...
Vali Posted January 9, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Author Share Posted January 9, 2012 Is that a bug then? I tested it again and the script launchs when i use @reloadscript. Quote Link to comment Share on other sites More sharing options...
Gepard Posted January 10, 2012 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 392 Reputation: 285 Joined: 12/19/11 Last Seen: January 23, 2022 Share Posted January 10, 2012 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 Quote Link to comment Share on other sites More sharing options...
Vali Posted January 10, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Author Share Posted January 10, 2012 Thank you Gepard, I will try this way. Quote Link to comment Share on other sites More sharing options...
Question
Vali
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?
Thank you!
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.