Owner_Reboot()
set category = "Owner"
set name = "Owner Reboot"
switch(input("Are you sure you want to reboot?","Reboot", text) in list ("No","Yes"))
if("No")
return
if("Yes")
switch(input("When do you want to reboot?","Reboot", text) in list ("Cancel","Now","30 Seconds","5 Seconds","Set"))
if("Cancel")
return
if("Now")
world.Reboot()
if("30 Seconds")
sleep(250)
world << "Rebooting in 5 seconds"
sleep(10)
world << "Rebooting in 4 seconds"
sleep(10)
world << "Rebooting in 3 seconds"
sleep(10)
world << "Rebooting in 2 seconds"
sleep(10)
world << "Rebooting in 1 second"
sleep(10)
world << "Rebooting now"
world.Reboot()
if("5 Seconds")
world << "Rebooting in 5 seconds"
sleep(10)
world << "Rebooting in 4 seconds"
sleep(10)
world << "Rebooting in 3 seconds"
sleep(10)
world << "Rebooting in 2 seconds"
sleep(10)
world << "Rebooting in 1 second"
sleep(10)
world << "Rebooting now"
world.Reboot()
if("Set")
var/X = input("When do you want to reboot?","Reboot") as num
if(X == null)
return
if(X < 0)
return
if(X == 1)
world << "Rebooting in [X] seconds"
sleep(10)
world << "Rebooting now"
world.Reboot()
if(X > 1)
var/C
C = X/(1/10)
world << "Rebooting in [(C)/10] seconds"
sleep(C)
world << "Rebooting in 5 seconds"
sleep(10)
world << "Rebooting in 4 seconds"
sleep(10)
world << "Rebooting in 3 seconds"
sleep(10)
world << "Rebooting in 2 seconds"
sleep(10)
world << "Rebooting in 1 second"
sleep(10)
world << "Rebooting now"
world.Reboot()
Problem description:
So.. I have a reboot verb.. but I don't know how byond timing works, so can someone help me... when I do "Set Reboot" it reboots at the time of "X" seconds.. but then it says 5 4 3 2 1.. how do I make it so it does it at w/e time I do it at then when it reach 5 seconds, it'll count down? Should I add 50 to "C = (X/(1/10))+50"? Can someone explain to me the timing of byond?