ID:173892
 
How long in Sleep() is 7 minutes?

Because I have this thing in my game that locks monsters so they cant move and set it so that it says its in battle when it cant move, and sometimes people leave in combat, i want it to wait 7 min and then kill the monster...Would this work?
mob
monster
proc
WaitToKill()
if(src.islocked == 1)
sleep(7 min)
del src
Sleep works in "ticks", each tick is about 1/10th of a second, so 1 second is 10 tick, and 1 minute is 600 ticks. 7 minutes is therefore 4200 ticks. So you just put sleep(4200).

~Ease~
In response to Ease
Would my method work though?
In response to Metroid
Metroid wrote:
Would my method work though?

Of course not. BYOND doesn't recognize "7 min" (without quotes) as anything. It'll give you a big horkin' compiler error.

Lummox JR
In response to Lummox JR
no i mean using the sleep(4200) or whatever instead of sleep(7 min) would the method work at least?
In response to Metroid
Yes, sleep(4200) would work. When inserting a numerical value into sleep as such, it is always measured in ticks (1/10ths of a second).
In response to Enigmaster2002
no i mean, will the code on the first post work by replacing sleep(7 min) with sleep(4200) cause ive tested it but it doesnt seem to work
In response to Metroid
I think you need "del(src)"
In response to DarkCampainger
THanks.