Tripoz Posted July 5, 2015 Share Posted July 5, 2015 (edited) hi, how to make sleep in some function but not interrupted other func???my code is something like thisWhile 1; phase1() ; go to some function to do stuff sleep(10) phase2() sleep(10) phase3() sleep(10) phase4() sleep(10) Else Sleep(10);pause for 10 miliseconds Wend Func phase1() ;do whatever you need the program to do EndFunc Func phase2() ;;;doiing some stuff sleep(60000) EndFunc Func phase3() ;do whatever you need the program to do EndFunc Func phase4() ;doin some stuff endfunc i want to loop phase1 to phase 4 but its stuck because sleep in Phase 2..thx in adv Edited July 5, 2015 by Tripoz correction code Link to comment Share on other sites More sharing options...
wisem2540 Posted July 5, 2015 Share Posted July 5, 2015 Maybe someone has some magic for you that I am not aware of. Here are a few observations....1. This code is pretty useless for us to be able to actually help, in my opinion.2. You are calling Phase 4 with the Phase 2 function?3. You are asking the script to sleep for what looks like 1min. What do you want it to do instead? Your interactions here are very unclear. 4. My guess is you could probably accomplish what you want with an Adlib Function, but again...not clear. Link to comment Share on other sites More sharing options...
Tripoz Posted July 5, 2015 Author Share Posted July 5, 2015 Maybe someone has some magic for you that I am not aware of. Here are a few observations....1. This code is pretty useless for us to be able to actually help, in my opinion.2. You are calling Phase 4 with the Phase 2 function?3. You are asking the script to sleep for what looks like 1min. What do you want it to do instead? Your interactions here are very unclear. 4. My guess is you could probably accomplish what you want with an Adlib Function, but again...not clear.sorry bro..my mistake... i was corrected my code Link to comment Share on other sites More sharing options...
wisem2540 Posted July 5, 2015 Share Posted July 5, 2015 what is the purpose of the Sleep?, Simply to get it past the 30min mark on the clock or something else? Link to comment Share on other sites More sharing options...
Tripoz Posted July 5, 2015 Author Share Posted July 5, 2015 what is the purpose of the Sleep?, Simply to get it past the 30min mark on the clock or something else?that phase4 is just for "refresh" some web every couples minutethe other code doin some other stuff..but the whole code cant wait the web refreshed..what i must to do then? Link to comment Share on other sites More sharing options...
Shane0000 Posted July 5, 2015 Share Posted July 5, 2015 You can tell ie to not wait with _IENavigate:_IENavigate ( ByRef $oObject, $sUrl [, $fWait = 1] ) Link to comment Share on other sites More sharing options...
wisem2540 Posted July 5, 2015 Share Posted July 5, 2015 my guess is you are trying to do some bot / game automation that is against the forum rules. I have asked you very specific questions and you have given me very UNspecific answers. Now.....1. What is the purpose of the SLEEP? I didn't ask about Phase 4.2. Post the code so that we can help you more accurately. I highly doubt the more elite members of this forum will be interested in guessing games when they do attempt to help you. Link to comment Share on other sites More sharing options...
Tripoz Posted July 5, 2015 Author Share Posted July 5, 2015 (edited) my guess is you are trying to do some bot / game automation that is against the forum rules. I have asked you very specific questions and you have given me very UNspecific answers. Now.....1. What is the purpose of the SLEEP? I didn't ask about Phase 4.2. Post the code so that we can help you more accurately. I highly doubt the more elite members of this forum will be interested in guessing games when they do attempt to help you.relax bro..dont judge before u know it exactly...im answered ur question already . the sleep in phase 4 is to wait 60sec after that it will refresh the browser. (only once in couple minute)if u asked me sleep(10) its just for delay so it will not consume my cpu i want to learn in here n not begging u a whole code... even its purpose to bot or what ever that against the forum (im not playing game too bro). i just asked the logic for doing that (not a whole code).. if u dont want to help me its okey bro (no offense).. but dont judge the people u dont know for sure.CMIIWRegards, note:my english is so bad..so pardon me if im wrong with spell or words. Edited July 5, 2015 by Tripoz Link to comment Share on other sites More sharing options...
LarsJ Posted July 5, 2015 Share Posted July 5, 2015 (edited) If your code in first post is similar to the actual code you can do it like this:While 1; phase1() ; go to some function to do stuff sleep(10) phase2() phase3() sleep(10) phase4() sleep(10) WEnd Func phase1() ;do whatever you need the program to do EndFunc Func phase2() Local Static $iCounter = 0 $iCounter += 1 If $iCounter < 6000 Then Return sleep(10) $iCounter = 0 ;;;doiing some stuff sleep(10) EndFunc Func phase3() ;do whatever you need the program to do EndFunc Func phase4() ;doin some stuff EndFuncYou can also use AdlibRegister to execute phase2(). That's probably better. Edited July 5, 2015 by LarsJ AdlibRegister Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Tripoz Posted July 5, 2015 Author Share Posted July 5, 2015 If your code in first post is similar to the actual code you can do it like this:While 1; phase1() ; go to some function to do stuff sleep(10) phase2() phase3() sleep(10) phase4() sleep(10) WEnd Func phase1() ;do whatever you need the program to do EndFunc Func phase2() Local Static $iCounter = 0 $iCounter += 1 If $iCounter < 6000 Then Return sleep(10) $iCounter = 0 ;;;doiing some stuff sleep(10) EndFunc Func phase3() ;do whatever you need the program to do EndFunc Func phase4() ;doin some stuff EndFuncYou can also use AdlibRegister to execute phase2(). That's probably better.thats what i searching for bro..thx alot..case closed. 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