The3vilM0nk3y

Untitled

Sep 2nd, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. -- How many hours till restart happens
  2. restartTime = 4
  3.  
  4.  
  5. -- Calculate hours to seconds minus announcement times
  6. -- then start a timer at that amount
  7. timer = os.startTimer( (restartTime * 3600) - 600 )
  8.  
  9. -- Listen for our timer. When time is hit,
  10. -- move on to messaging loop
  11. while true do
  12. event,p1 = os.pullEvent("timer")
  13. if timer == p1 then
  14. break
  15. end
  16. end
  17.  
  18. -- Announcements at periodic times
  19. -- sleep time equals announce time minus the next announce time
  20. commands.exec("say Server Restarting In 10 minutes")
  21. sleep(300)
  22. commands.exec("say Server Restarting In 5 Minutes")
  23. sleep(240)
  24. commands.exec("say Server Restarting In 1 Minute")
  25. sleep(50)
  26. commands.exec("say Server Restarting In 10 Seconds")
  27. sleep(5)
  28. commands.exec("say Server Restarting In 5...")
  29. sleep(1)
  30. commands.exec("say Server Restarting In 4...")
  31. sleep(1)
  32. commands.exec("say Server Restarting In 3...")
  33. sleep(1)
  34. commands.exec("say Server Restarting In 2...")
  35. sleep(1)
  36. commands.exec("say Server Restarting In 1...")
  37. sleep(1)
  38. commands.exec("stop")
Advertisement
Add Comment
Please, Sign In to add comment