ID:267754
 
Could anyone direct me on how to make a game automatically save and reboot repeatedly after a certain amount of time?
world/New()
..()
sleep(600) //wait 1 minute
world << "World Rebooting in 10 seconds!"
sleep(100)
world.Reboot()


simple as that.
In response to JackGuy
JackGuy wrote:
world/New()
..()
sleep(600) //wait 1 minute
world << "World Rebooting in 10 seconds!"
sleep(100)
world.Reboot()


simple as that.

I'm not completly sure, but wouldn't you want the spawn statement after ..()?
In response to Yota
It doesnt really matter where the ..() goes in something like this.
It just means do everthing before this :)
In response to Maz
That's sort of a misleading statement. =) I prefer this one:

If you've overridden a proc, then ..() will call the last definition of the proc.

For example:

<code>mob proc/hello() world << "Hello, I'm a /mob!" mob/player hello() //Don't need to use "proc" again, as it's already defined world << "Hello, I'm a /mob/player!" ..() //Call /mob's hello() proc</code>

Calling the hello() proc of a /mob/player in that example will display "Hello, I'm a /mob/player!" and "Hello, I'm a /mob!" in that order.

For pre-existing procs (Click(), Enter(), Move(), Bump(), etc.), it works just the same... except the proc is defined and its default action has already been programmed for you.
In response to Yota
*shrugs* don't need it but here it is anyway (just in case):

world
New()
..()
spawn(600) world << "World Rebooting in 10 seconds!"
spawn(700) world.Reboot()