Jump to content

Help with a bot script


Recommended Posts

I'm completely new to using AutoIt and desperately need some help. All I basically want this script to do is pixel seach, then left click the pixel when it finds it. I want it to be able to look for the first pixel, and if it can't find it, skip that and find the next one.

This is all I got so far

CODE

While 1 = 1

Find1()

Sleep(5000)

Find2()

Sleep(5000)

Find3()

WEnd

Func Find1()

PixelSearch(0, 0, 1280, 1024, 0xAA5300 [, 2] [, 2]] )

If isArray($Coords) then

MouseClick("Left",$Coords[0], $Coords[1],1,1)

EndIf

EndFunc

Func Find2()

PixelSearch(0, 0, 1280, 1024, 0xC66B00 [, 2] [, 2]] )

If isArray($Coords) then

MouseClick("Left",$Coords[0], $Coords[1],1,1)

EndIf

EndFunc

Func Find3()

PixelSearch(0, 0, 1280, 1024, 0x2FF731 [, 2] [, 2]] )

If isArray($Coords) then

MouseClick("Left",$Coords[0], $Coords[1],1,1)

EndIf

EndFunc

Func stop()

Global $show = 1

EndFunc

Any help is greatly appreciated, thanks :)

Edited by Voidmaster
Link to comment
Share on other sites

While 1 = 1
Find1()
Sleep(5000)
Find2()
Sleep(5000)
Find3()
WEnd

Func Find1()
$Coords = PixelSearch(0, 0, 1280, 1024, 0xAA5300 [, 2] [, 2]] )
If isArray($Coords) then
MouseClick("Left",$Coords[0], $Coords[1],1,1)
EndIf
EndFunc

Func Find2()
$Coords = PixelSearch(0, 0, 1280, 1024, 0xC66B00 [, 2] [, 2]] )
If isArray($Coords) then
MouseClick("Left",$Coords[0], $Coords[1],1,1)
EndIf
EndFunc


Func Find3()
$Coords = PixelSearch(0, 0, 1280, 1024, 0x2FF731 [, 2] [, 2]] )
If isArray($Coords) then
MouseClick("Left",$Coords[0], $Coords[1],1,1)
EndIf
EndFunc

Func stop()
Global $show = 1
EndFunc

You forgot to set $Coords to something

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