mob
proc
sleep()
if(!src.value)
src.value=1
sleep(60)//
src.value=0
else
src<<"You must wait [sleep] seconds to click this again."// how would you relate the sleep 60 to the sleep var T_T
ID:158574
Aug 4 2009, 2:23 am
|
|
How would you find out how much sleep or spawn is left and tell the usr or src for that matter.
|
In response to Demon_F0rce
|
|
ah thanks.
|
mob/var/tmp/timer That'd be how I'd do it. You can't do it with a sleep or spawn. You have to do it with a while or a for loop, so you can keep track of the time left with a variable. |
In response to Andre-g1
|
|
You forgot one thing. sleep() is required on your loop.
You should avoid unnecessary loops. You don't need a loop for this. mob/var/tmp/timevar // don't save this var EDIT: Added comments for the Original Poster. |
In response to Jemai1
|
|
Jemai1 wrote:
You forgot one thing. sleep() is required on your loop. > mob/var/tmp/timevar // don't save this var EDIT: Added comments for the Original Poster. Yeah, this is the best option here. It's the most efficient. |
Because everybody else is giving bad suggestions:
Change your variable to indicate WHEN something will no longer be locked out, rather than whether it's locked out or not. It's then easy to compare to world.time: mob/verb/wait() |
What you'd have to do is make a value, then take away from that value every tick. Like so: