I'm looking for a way to create a countdown for reboot on my mud so when I prepare to reboot I can give a 5 minute warning to everyone on the mud using Gecho.
How could this be done?
How could this be done?
This forum is a read-only archive of the Gammon Software forum (2000–2026). No new posts can be made. Search the archive.
Posted by Xavaier on Fri 31 May 2002 02:10 AM — 6 posts, 27,935 views.
sub OnShutdown (sName, sLine, wildcards)
world.send "gecho This mud will be rebooted in 5 minutes"
' 3 minutes later ...
world.doafter 180, "gecho This mud will be rebooted in 2 minutes"
' 4 minutes later ...
world.doafter 240, "gecho This mud will be rebooted in 1 minute"
' 4 mins 30 seconds later ...
world.doafter 270, "gecho This mud will be rebooted in 30 seconds"
' 4 mins 50 seconds later ...
world.doafter 290, "gecho This mud will be rebooted in 10 seconds"
' 4 mins 55 seconds later ...
world.doafter 295, "gecho This mud will be rebooted in 5 seconds"
' 4 mins 56 seconds later ...
world.doafter 296, "gecho This mud will be rebooted in 4 seconds"
' 4 mins 57 seconds later ...
world.doafter 297, "gecho This mud will be rebooted in 3 seconds"
' 4 mins 58 seconds later ...
world.doafter 298, "gecho This mud will be rebooted in 2 seconds"
' 4 mins 59 seconds later ...
world.doafter 299, "gecho This mud will be rebooted in 1 second"
' reboot! ...
world.doafter 300, "reboot mud now"
end sub
sub Rebtimer (trigname, output, wildcards)
world.setvariable "Days", wildcards(1)
world.setvariable "Hours", wildcards(2)
world.setvariable "Minutes", wildcards(3)
world.setvariable "Seconds", wildcards(4)
world.status "Reboot is in " & wildcards(1) & "d " & wildcards(1) & "h " & wildcards(1) &"m."
end subsub Distime (Timername)
int a
int b
int c
int count
a = Cint(world.getvariable("Days"))
b = Cint(world.getvariable("Hours"))
c = Cint(world.getvariable("Minutes"))
d = Cint(world.getvariable("Seconds"))
d = d - 1
for count = 1 to 1
if d < 0 then
c = c - 1
if c < 0 then
b = b - 1
if b < 0 then
a = a - 1
if < 0 then
a = 0
b = 0
c = 0
d = 0
exit for 'Cheat since there is no goto and we can't simply exit sub. ;)
end if
b = 23
end if
c = 59
end if
d = 59
end if
next
world.setvariable "Days", a
world.setvariable "Hours", b
world.setvariable "Minutes", c
world.setvariable "Seconds", d
world.status "Reboot is in " & a & "d " & b & "h " & "m."
if a = 0 and b = 0 then
if c < 6 then
if c > 0 then
world.send "gecho This mud will be rebooted in " & c & " minutes!"
else
if d = 30 or d <= 10
world.send "gecho This mud will be rebooted in " & d & " seconds!"
end if
end if
end if
end sub