Jump to content

Recommended Posts

Posted (edited)

My simple script looks at a pixel and if the color matches the requirement it clicks on it.

My script will build a buffer of 100's of look/decide/click actions preventing me from Hotkey pausing/ending the action until that Hotkey press get's it's turn which by the time the buffer of look/decide/click actions can run out, it's way too late, the longer the script runs, the longer it takes to finish the queue of actions.....

Is there a way to limit or prevent the buffer from storing action ?

Here is the script:

HotKeySet( "q", "End" ) ; Identifies Hotkeys used

HotKeySet( "g", "Go" )

HotKeySet( "s", "Stop" )

$Z = 0

$X = 310 ; Sets up edges of search area

$Y = 265

Do

$Z = 0 ; Loop to enable Hotkeys

Until $Z = 1

Func Go() ; This function Hotkeys from the letter 'G', gets a pixel color, compares it to a range and cliks if within range

Do

$Spot = ( PixelGetColor( $X, $Y )) ; Gets color of pixel being examined

If $Spot > 4680000 And $Spot < 5350000 Then ; Decides if color is within accepted range and if so, clicks on it--

MouseClick( "Left", $X, $Y, 1, 0 )

EndIf

$X = $X + 7 ; Generates location of next pixel to be checked

If $X > 720 Then

$X = 310

$Y = $Y + 8

EndIf

If $Y > 505 Then ; Detects the end of the search and triggers flag to exit

$Z = 1

EndIf

Until $Z = 1

EndFunc

Func Stop() ; This function Hotkeys from the letter 'S', halting the search and resets the search location

Do

$Z = 0

$X = 310

$Y = 265

Until $Z = 1

EndFunc

Func End() ; This function Hotkeys from the letter 'Q' and ends the program Exit

EndFunc

Edited by Big10Inch

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
×
×
  • Create New...