Vali Posted January 8, 2012 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
Brian Posted January 8, 2012 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
Vali Posted January 9, 2012 Author 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
Vali Posted January 9, 2012 Author Posted January 9, 2012 Is that a bug then? I tested it again and the script launchs when i use @reloadscript. Quote
Gepard Posted January 10, 2012 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
Vali Posted January 10, 2012 Author Posted January 10, 2012 Thank you Gepard, I will try this way. Quote
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!
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.