Jump to content

Recommended Posts

Posted (edited)

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
Posted

haha i noticed as i have tried if, while, also tried within a function and none to work i was trying to get some insight on what i need the loop within ie a while ? else ?

 

Posted

Have a look in the help: Do...Until

i have tried the do until i am trying so find juist a simple loop for the pixelsearch where when i have ran the loops i either get erroe mouse click $seach error

 

so how do i

do pixel search

until no pixel then

 

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

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
  • Recently Browsing   0 members

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