Jump to content

Recommended Posts

Posted

I started to make a Pixelbot

ToolTip("Point at the mob to be fighted!")
Sleep(5000)
$m=MouseGetPos()
$color=PixelGetColor($m[0],$m[1]);Looks for the colour of the mob.
$coord = PixelSearch( 0, 0, 300, 300,$color );Searches the pixel
While 1
    MouseMove($coord[0],$coord[1]); Ok heres the problem it says $coord is not an array variable.
    Sleep(3000)
    MouseClick()
WEnd
Posted

here try this:

ToolTip("Point at the mob to be fighted!")
Sleep(5000)
$m=MouseGetPos()
$color=PixelGetColor($m[0],$m[1]);Looks for the colour of the mob.
$coord = PixelSearch( 0, 0, 300, 300,$color );Searches the pixel
While 1
    If $coord IsArray Then
    MouseMove($coord[0],$coord[1]); Ok heres the problem it says $coord is not an array variable.
    Sleep(3000)
    MouseClick()
WEnd
Hope that helps, Clipper34
Posted (edited)

ToolTip("Point at the mob to be fighted!")
Sleep(5000)
$m=MouseGetPos()
$color=PixelGetColor($m[0],$m[1]);Looks for the colour of the mob.
$coord = PixelSearch( 0, 0, 300, 300,$color );Searches the pixel
While 1
    If $coord IsArray Then
    MouseMove($coord[0],$coord[1]); Ok heres the problem it says $coord is not an array variable.
    Sleep(3000)
    MouseClick()
ENDIF
WEnd

:)

Edited by Kiti
Posted

Err i said there is an error^^

If $coord IsArray Then; Error parsing function call

Ok i switched the pixelsearch to PixelSearch( 1,1, 1023, 767,$color ) now it works!
Posted (edited)

Incorrect usage of IsArray:

If $coord IsArray Then

Should be:

If IsArray($Coord) Then

Also, one might want to loop the PixelSearch too(note the use of the @error macro instead of IsArray):

ToolTip("Point at the mob to be fighted!")
Sleep(5000)
$m=MouseGetPos()
$color=PixelGetColor($m[0],$m[1]);Looks for the colour of the mob.
While 1
    $coord = PixelSearch( 0, 0, 300, 300,$color );Searches the pixel
    If Not @Error Then
        MouseMove($coord[0],$coord[1])
        Sleep(3000)
        MouseClick()
    EndIf
WEnd
Edited by FreeFry

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