Jump to content
Sign in to follow this  
Tripoz

how to make sleep in some function but not interrupted other func???

Recommended Posts

Tripoz

hi, 

how to make sleep in some function but not interrupted other func???

my code is something like this

While 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 by Tripoz
correction code

Share this post


Link to post
Share on other sites
wisem2540

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.

Share this post


Link to post
Share on other sites
Tripoz

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

 

Share this post


Link to post
Share on other sites
wisem2540

what is the purpose of the Sleep?, Simply to get it past the 30min mark on the clock or something else?

Share this post


Link to post
Share on other sites
Tripoz

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 minute

the other code doin some other stuff..but the whole code cant wait the web refreshed..

what i must to do then?

Share this post


Link to post
Share on other sites
Shane0000

You can tell ie to not wait with _IENavigate:

_IENavigate ( ByRef $oObject, $sUrl [, $fWait = 1] )

 

Share this post


Link to post
Share on other sites
wisem2540

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.

Share this post


Link to post
Share on other sites
Tripoz

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.

CMIIW

Regards,

 

note:

my english is so bad..so pardon me if im wrong with spell or words.

Edited by Tripoz

Share this post


Link to post
Share on other sites
LarsJ

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
EndFunc

You can also use AdlibRegister to execute phase2(). That's probably better.

Edited by LarsJ
AdlibRegister

Share this post


Link to post
Share on other sites
Tripoz

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
EndFunc

You can also use AdlibRegister to execute phase2(). That's probably better.

thats what i searching for bro..

thx alot..

case closed.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×