Variables (Pre-Load on Startup)

bitzerjd's Avatar Topic Author
User User
  • Posts: 375
  • Thanks: 3

Variables (Pre-Load on Startup)

2 years 5 months ago
#1928
Is there a way to seed a variable when the server is restarted?  I have a few variables (user created) that I would like to have a set value when the server is started/restarted.  I set these variables when the system is turned on or off so it's not a big deal, but it would be nice to have.

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar
User User
  • Posts: 248
  • Thanks: 33

Re: Variables (Pre-Load on Startup)

2 years 5 months ago
#1931
I don't know if there is a better way or not but you could setup and automation that checks the {{current_uptimesecs}} value and if it's below 60 seconds then set your variables. I think it would only fire once but it's possible it would fire multiple times. But there are ways around that with adding a secondary variable if that's an issue.

Please Log in or Create an account to join the conversation.

bitzerjd's Avatar Topic Author
User User
  • Posts: 375
  • Thanks: 3

Re: Variables (Pre-Load on Startup)

2 years 5 months ago
#1954
Thanks! That sounds like it may work.

Please Log in or Create an account to join the conversation.

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: Variables (Pre-Load on Startup)

2 years 5 months ago
#1972
ALL server variables are automatically saved and restored every time the server is cleanly shutdown (saved) and started (restored). This is automatic and cannot be disabled.

If there are specific things you would like to perform on system startup and/or system shutdown then you can put them in macros called system.startup  and system.shutdown.

If these macros exist then they automatically get executed during the startup or shutdown sequences.


 
The following user(s) said Thank You: bowlingbeeg

Please Log in or Create an account to join the conversation.

bitzerjd's Avatar Topic Author
User User
  • Posts: 375
  • Thanks: 3

Re: Variables (Pre-Load on Startup)

2 years 5 months ago
#1976
Good to know, Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.280 seconds