Jump to content

How can I modify my Multi Pixelsearch script


jaxclain
 Share

Recommended Posts

Hey there,

How could I modify my code to add simple Enter after 30 minutes of looping through the actual script? 

 

$left = 703
$top = 264
$right = 1170
$bottom = 709

Local $colors[4] = [ 0xE83636, 0x98A508, 0x282828, 0xFEFEFE ]

Sleep(2000)
HotKeySet("{ESC}","qt")
While 1
    For $i = 0 To 3
        $c=PixelSearch($left, $top, $right, $bottom, $colors[$i])
        If IsArray($c) Then
            MouseMove($c[0],$c[1],0)
            Sleep(1000)
            MouseClick("left")
            Sleep (4000)

        EndIf
    Next
WEnd

Func qt()
    Exit
EndFunc

 

Also, Iv been using an easy Hotkey to start or cancel the script such as 1 to start then 2 to terminate but i cannot figure out how to implement the same in my previous script :(  here is what I normally use with other scripts:

Global $UnPaused
HotKeySet("{1}", "TogglePause")
HotKeySet("{2}", "Terminate")

While 1
    Sleep(100)
    ToolTip("Script is Paused",0,0)
WEnd

Func TogglePause()
    $UnPaused = NOT $UnPaused
    While $UnPaused
    
Sleep(1000)
MouseClick("left")
Sleep(1000)

    WEnd
EndFunc

Func Terminate()
    Exit 0
EndFunc

 

Thanks for your support

Edited by jaxclain
Link to comment
Share on other sites

  • Developers

It appears you still haven't read the rules. Please do so now as this will be your last warning.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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