ecstatic Posted April 17, 2009 Share Posted April 17, 2009 Hey guys. Heres my code whats wrong and how do i add to it expandcollapse popupFunc CreateGame() Local $starttime = _Timer_Init() If _Timer_Diff($starttime) >= 60000; 60 seconds $Message = "were creating a game now!" Chat() Stats() MouseClick("left", 640, 485) Sleep($ClickDelay) $GameLength = Random(10, 15) $PassLength = Random(10, 15) For $x2 = 0 To $GameLength $Random = Random(97, 122) Send(Chr($Random)) Next Sleep($KeyDelay) Send("{TAB}") Sleep($KeyDelay) For $x3 = 0 To $PassLength $Random = Random(97, 122) Send(Chr($Random)) Next Sleep($KeyDelay) Send("{ENTER}") Sleep($KeyDelay) $GamesMade = $GamesMade + 1 Stats() FileWriteLine($File, "Made Game: " & @HOUR & ":" & @MIN & "." & @MDAY & "/" & @MON & "/" & @YEAR & @LF) Sleep(3000) CheckIngameact1() EndFunc ;==>CreateGame OK from what i think, i have it to start the timer, then if the timer is 60 seconds, it will start it. Heres what i need to do A) Restart the timer every gamecreate After it completes its circlet then goes back to Func CreateGame() It will sleep until the timer = 60. How and whats wrong :S Link to comment Share on other sites More sharing options...
bo8ster Posted April 17, 2009 Share Posted April 17, 2009 What do you want it to do, what is it not doing and what have you tried so far? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
ecstatic Posted April 17, 2009 Author Share Posted April 17, 2009 What do you want it to do, what is it not doing and what have you tried so far?I want it to time a whole couple functions then when it returns to CreateGame() it will know wether or not the timer hit 60000This this. Link to comment Share on other sites More sharing options...
Spiff59 Posted April 17, 2009 Share Posted April 17, 2009 (edited) Local variables are destroyed when you exit the function. Func CreateGame() Local $starttime = _Timer_Init() Try stripping the "local" off of that statement and parking a Global $starttime at the top of your script. Er... You need to move that "TimerInit" or your "TimerDiff" somewhere else. It's never going to hit 60000 if the preceding statement just set it to 0. Maybe put... Global $starttime = _Timer_Init at the top of your script. And, have your function begin like... If _Timer_Diff($starttime) >= 60000 Then; 60 seconds $Message = "were creating a game now!" $starttime = _Timer_Init Endif Edited April 17, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
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