Jump to content

loops for a noob


Recommended Posts

just trying to make a bot where it finds pxels clicks but if no pixel found move to next command tried so many ways i just cant seem to figure out simple loops

;i want this to find pixel then click  until no $search found then move on to next
;i have tried many loops but they all seem to only run though this once


;; i want this to loop until not found
$search = PixelSearch(1920,50,3839,1079,0xEF0FFF)
If Not @error Then
    MouseMove($search[0],$search[1])
    Sleep(750)
    MouseClick ("left")
EndIf

send("{ctrldown}{f}{ctrlup}{altdown}{c}{altup}{altdown}{a}{altup}")
sleep(300)
Send("open")

 

 

 

 

 

 


EndIf

Edited by bikerbrooks
code out of place
Link to comment
Share on other sites

_Example()

Func _Example()
    While 3
        $search = PixelSearch(1920, 50, 3839, 1079, 0xEF0FFF)
        If Not @error Then
            MouseMove($search[0], $search[1])
            Sleep(750)
            MouseClick("left")
        Else
            Return SetError(1) ; Not found
        EndIf
        Send("{ctrldown}{f}{ctrlup}{altdown}{c}{altup}{altdown}{a}{altup}")
        Sleep(300)
        Send("open")
    WEnd
EndFunc   ;==>_Example

 

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...