Jump to content

How to stop the script in the script?


Recommended Posts

If ($Net > 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)

This stops my program from working when the situation becomes greater than 2. I really need the script to hit this $Out and the wait until the $Net becomes <2 and then do the same controlclick. What would be the next line to get it to pause after making this click and then make the click again when the $Net < 2?

I know the comeback line will be the one below but I am having a problem with how to get the script to go into a waiting mode until the number gets below 2 again and then make the click again. I am guessing that there is a line or some code that goes between these two that will make it wait but not sure what that is or how to do it.

If ($Net < 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)

Thanks for your time.

Edited by bbaffert
Link to comment
Share on other sites

If ($Net > 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)

This stops my program from working when the situation becomes greater than 2.  I really need the script to hit this $Out and the wait until the $Net becomes <2 and then do the same controlclick.  What would be the next line to get it to pause after making this click and then make the click again when the $Net < 2?

I know the comeback line will be the one below but I am having a problem with how to get the script to go into a waiting mode until the number gets below 2 again and then make the click again.  I am guessing that there is a line or some code that goes between these two that will make it wait but not sure what that is or how to do it.

If ($Net < 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)

Thanks for your time.

<{POST_SNAPBACK}>

Nested While statements....

While 1
   Sleep(10)
   If ($Net > 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)
   While $net > 2
     Sleep(10)
   WEnd
   If ($Net < 2 and (PixelGetColor(13,572)=16777215)) then ControlClick($name, "", $Out)
WEnd

Although, based on your code.... This button gets clicked no matter what. :D:D

Somehow, I think something else is missing, but that timing loop is probably what you need. :)

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...