ID:146202
 
Code:
mob
GM/verb
Reboot()
var/Time = input("How Many seconds?") as num
if(Time == null)
world<<">World will reboot in 5 seconds!!"
sleep(50)
world.Reboot()
else
world<<"World will reboot in [Time] seconds!!"
"[sleep([Time])]" // The problem is here. plz help me
world.Reboot()


Problem description:GM.dm:14:error: expected expression

sleep(Time) // The problem is here. plz help me
Y2kEric wrote:
Code:
> mob
> GM/verb
> Reboot()
> var/Time = input("How Many seconds?") as num
> if(Time == null)
> world<<">World will reboot in 5 seconds!!"
> sleep(50)
> world.Reboot()
> else
> world<<"World will reboot in [Time] seconds!!"
> "[sleep([Time])]" // The problem is here. plz help me
> world.Reboot()
>

Problem description:GM.dm:14:error: expected expression

                "[sleep([Time])]"

You do not seem to know what the sleep proc does (and i don't even know what you're trying to accomplish there.

To have it sleep by Time just do..
sleep(Time)


If you would like to output Time
world<<"The world is rebooting in [Time] seconds."


Just a helpful note, sleep uses ticks, and I think it's like
600 ticks = a minute
so.. to equal seconds....
600/60? 10 ticks per second?
In response to Flame Sage
Flame Sage wrote:
Just a helpful note, sleep uses ticks, and I think it's like
600 ticks = a minute
so.. to equal seconds....
600/60? 10 ticks per second?

I usually include something like this in all my games - then multiply them in time formulas:
#define SECOND              10 //one second
#define MINUTE 600 //one minute
#define HOUR 36000 //one hour
In response to Flame Sage
How do i make it so when they type in 6 in makes the sleep run for 6 seconds and not 6/10 of a second.
In response to Y2kEric
#define SECOND              10 //one second
#define MINUTE 600 //one minute
#define HOUR 36000 //one hour

//Have your admin coding with reboot here.
Time*SECOND //That's saying Time*10, conveting it.
//define is basicly like a BYOND marco.
In response to Flame Sage
Thank You.
In response to Y2kEric
Welcome.
If you need any coding help, don't hesitate to contact me.
AIM: chris062689
In response to Flame Sage
Flame Sage wrote:
Welcome.
If you need any coding help, don't hesitate to contact me.
AIM: chris062689

Ooo...a new name to add to my automatic mailer. >_>