|
Post by azural on Jan 16, 2006 18:09:34 GMT -5
What I wish to do is use a spell for example and have a countdown started, and set a variable to FALSE. After the pre set time, that i set in script, runs out (say 60 seconds) the variable is then set to TRUE. All the while I wish the script to still be running. The Sleep function is no good as it cause the script to pause. It's been so long since I have programmed this is seeming difficult for me to so.
Any help?
BTW man I would love to try that fishing assister, most colorful thing I have ever saw, seems I got pointed to this site a few weeks too late. And the other ones out there are so Blah and no nice GUI
EDIT: Nvr mind read some calls i could do in language and was easy as pie~
|
|
|
Post by X-Drop on Jan 17, 2006 14:48:38 GMT -5
Post your results when you finally get it all working. Btw, good job finding your own answer.
|
|
|
Post by deathravin on Jan 17, 2006 15:12:00 GMT -5
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Jan 17, 2006 19:15:25 GMT -5
In your time check, there's a bug in which if the script hung up for a second or more and skipped the one second that would trigger whatever code relied on this, that code would never run. To fix this, change if SneakTime == os.clock() then to if SneakTime <= os.clock() then <Edit: Fixed previous edit (had the code right the first time >.<; )>
|
|
|
Post by azural on Jan 18, 2006 2:55:04 GMT -5
This is what i ended up doing it simple form, for sure there are many ways as soon as i saw the os.difftime( ) , I realized I could compare it , then just reset the SneakTime to new os.time( ) after action was preformed
SneakTime = os.time( ) SneakRecast = 240
--perform what ever
--check if time "X" has gone by if (os.difftime(os.time( ),SneakTime)) > Recast then
|
|
|
Post by TinyTerror on Jan 18, 2006 7:34:11 GMT -5
Yeah, these are all fairly standard time counter methods. Good to see people learning.
|
|