3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Timer with sys_seconds
[Re: pesseba]
#123540
04/12/07 19:54
04/12/07 19:54
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
does total_secs have a limit?
Nevermind, just did the math. It would take over 10 hours of gameplay to have an error... lol.
xXxGuitar511 - Programmer
|
|
|
Re: Timer with sys_seconds
[Re: nipx]
#123542
04/12/07 22:14
04/12/07 22:14
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Forget sleep(x); its old syntax, use wait(-x); instead. Easy minute timer using wait(-x): Code:
var minutes = 0; var status_timer = 0;
function set_timer(_mode) { minutes = 0; status_timer = _mode; while(status_timer) { minutes += 1; wait(-60); //waits 60 seconds } }
//call the function the following ways: //start the timer: set_timer(1); //stop the timer: set_timer(0);
|
|
|
Re: Timer with sys_seconds
[Re: testDummy]
#123545
04/13/07 05:42
04/13/07 05:42
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
lol, thank you test dummy. I'll make sure if I ever leave my game on for centuries, I use your calculations...
BTW: Your posts are always a pleasure to read... Very intelligent and humorous in a technical way...
xXxGuitar511 - Programmer
|
|
|
Re: Timer with sys_seconds
[Re: xXxGuitar511]
#123546
04/13/07 06:39
04/13/07 06:39
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Hey, let's try it! anyone got a spare computer? We'll run the game ans see when it gives you the error... after 200 years we'll know test dummy was right 
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|