ecstatic Posted June 7, 2009 Posted June 7, 2009 Hey guys. Im not too sure what im doing wrong here, but if any could tell me that would be aweesome. So basically, i have a loop which goes like this 1) Starts game 2) Logs in 3) Creates game - TIMER STARTED 4) Does ingame functions 5) Goes back to create-game screen. Now @ number 5 it wait until the timer reaches 90 seconds or whatever the specified time is. Then it loops back to number 3. Whats wrong with my tooltip and code. Func CreateGame() $timer = _Timer_Init() ....creates game... endfunc Func Lobby Do Tooltip("Sleeping for " & _Timer_Diff($timer) &" Seconds.", 0, 0, "D2AI") Sleep(10) Until _Timer_Diff($timer) >= 180000; 3 minutes Endfunc
martin Posted June 7, 2009 Posted June 7, 2009 Hey guys. Im not too sure what im doing wrong here, but if any could tell me that would be aweesome. So basically, i have a loop which goes like this 1) Starts game 2) Logs in 3) Creates game - TIMER STARTED 4) Does ingame functions 5) Goes back to create-game screen. Now @ number 5 it wait until the timer reaches 90 seconds or whatever the specified time is. Then it loops back to number 3. Whats wrong with my tooltip and code. Func CreateGame() $timer = _Timer_Init() ....creates game... endfunc Func Lobby Do Tooltip("Sleeping for " & _Timer_Diff($timer) &" Seconds.", 0, 0, "D2AI") Sleep(10) Until _Timer_Diff($timer) >= 180000; 3 minutes Endfunc You should be using TimerInit and TimerDiff. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
JackDinn Posted June 7, 2009 Posted June 7, 2009 if the tooltip is not going up then it's prob that $timer cant be passed to other funcs unless you make it global or pass it via func() Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D
martin Posted June 7, 2009 Posted June 7, 2009 if the tooltip is not going up then it's prob that $timer cant be passed to other funcs unless you make it global or pass it via func()Oh yes, I'd missed that the $timer was used in a different function. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
ecstatic Posted June 7, 2009 Author Posted June 7, 2009 (edited) You should be using TimerInit and TimerDiff.What is the difference between _Timer_init and timerinit, it didnt change anything on my side.if the tooltip is not going up then it's prob that $timer cant be passed to other funcs unless you make it global or pass it via func()The timer goes up, but i want to make it appear in seconds and counting down for the user.Wait so how do i pass it to another function or global like you guys said. Edited June 7, 2009 by ecstatic
JackDinn Posted June 7, 2009 Posted June 7, 2009 well if the tooltip is going up then you must have already declared the $timer as global. to make it go down it would just be Tooltip("Sleeping for " & 180000 - _Timer_Diff($timer) &" Seconds.", 0, 0, "D2AI") Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D
ecstatic Posted June 7, 2009 Author Posted June 7, 2009 (edited) well if the tooltip is going up then you must have already declared the $timer as global.to make it go down it would just be Tooltip("Sleeping for " & 180000 - _Timer_Diff($timer) &" Seconds.", 0, 0, "D2AI")Testing.. BrbNow it is counting down, but it still is in miliseconds and not seconds >.< Edited June 7, 2009 by ecstatic
JackDinn Posted June 7, 2009 Posted June 7, 2009 (edited) o and seconds is a division by 1000 so Tooltip("Sleeping for " & (180000 - _Timer_Diff($timer))/1000 &" Seconds.", 0, 0, "D2AI") or Tooltip("Sleeping for " & 180 - (_Timer_Diff($timer)/1000) &" Seconds.", 0, 0, "D2AI") EDIT: got confused by "reaches 90 seconds" & "180000; 3 minutes" which you used both of in the question , no matter , im sure you get the idea Edited June 7, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D
Inverted Posted June 7, 2009 Posted June 7, 2009 My suggestion : $timer = TimerInit() Do Tooltip("Sleeping for " & Round(TimerDiff($timer)/1000) &" Seconds.", 0, 0, "D2AI") Sleep(10) Until TimerDiff($timer) >= 10000
ecstatic Posted June 7, 2009 Author Posted June 7, 2009 My suggestion : $timer = TimerInit() Do Tooltip("Sleeping for " & Round(TimerDiff($timer)/1000) &" Seconds.", 0, 0, "D2AI") Sleep(10) Until TimerDiff($timer) >= 10000This displayed the sconds correctly! but the delay is off, it auto-makes regardless of how long the game was
JackDinn Posted June 7, 2009 Posted June 7, 2009 (edited) you need to do the same kinda thing to this part as well Until TimerDiff($timer) >= 10000 ; i mean this is 10 seconds and will always be 10 seconds, you need to set it to the time you want or use a variable Edited June 7, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now