Advertisement
Cancelor

CAN-DoTimedStuff.txt

Sep 13th, 2020 (edited)
4,830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///////////////////////////////////////////
  2. ////                                   ////
  3. ////    CAN-DoHourly.txt               ////
  4. ////                                   ////
  5. ////    Called by CAN-CoreScript.txt   ////
  6. ////                                   ////
  7. ////    Uses    CanCount               ////
  8. ////    Creates CanHourly              ////
  9. ////                                   ////
  10. ///////////////////////////////////////////
  11.  
  12. ///////////////////////////////////////////
  13. ////                                   ////
  14. ////    Run things once per hour.      ////
  15. ////    First run will be at the       ////
  16. ////    hour after starting.           ////
  17. ////                                   ////
  18. ///////////////////////////////////////////
  19.  
  20. if debug > 0 echo ">>> Starting CAN-DoHourly.txt - Cycle {CanCount}. <<<"
  21.  
  22. //  At startup (if CanHourly does not exist)
  23. //  set CanHourly to equal the server hour.
  24.  
  25.     if !city.script.variables["CanHourly"] CanHourly = m_context.serverHours
  26.  
  27. //  Return if hour has not changed.
  28.     if  CanHourly == m_context.serverHours return
  29.  
  30. ///////////////////////////////////////////////////////////////////
  31.  
  32. //  The server hour has changed so lets do hourly stuff.
  33.     if debug > 1 echo "++++ Doing CAN-DoHourly.txt stuff - ({CanHourly}). ++++"
  34.  
  35. //  Increment CanHourly so that we know it's done.
  36.     CanHourly ++
  37.  
  38. //  Roll over CanHourly when needed.
  39.     if  CanHourly == 24  CanHourly = 0
  40.  
  41. //  Report stats every 4 hours.
  42.     if !(m_context.serverHours MOD 4) call "CAN-Stats.txt"
  43. ##  if m_context.serverHours = 23 execute "config wartown:1"
  44.  
  45. /////////////////////////////////////
  46. ////    Do hourly stuff here.    ////
  47. /////////////////////////////////////
  48.  
  49.  
  50.  
  51. /////////////////////////////////////
  52.  
  53. return
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement