Jump to content

Array for Coords?


Recommended Posts

Now I realize this script will look terrible, but just bare with me plz ^_^

I'm new to this, and basicall what I want the script to do is search for a pixel color. Check if it found the pixel color, and if it did, move the mouse to it.

Here's what i'm using.

Opt("SendKeyDownDelay", 1)
HotKeySet("{F8}", "Jiz")
Global $v = 2
Global $check = 1
Global $coord = 0
While 1
    Sleep(1)
WEnd
Func Jiz()
    If $v=2 Then
        For $i = 1 to 9999999999999999999999999
            $coord = PixelSearch(0,0,1024,768,5210767)
            $check = PixelGetColor($coord[0],$coord[1],0)
            If $check = 5210767 Then
            MouseMove($coord[0],$coord[1], 0)
        EndIf
        Next
        Else
    EndIf
EndFunc

Here's the error I get.

Line 14 (File"C:\Users\Dell XPS....");
$check = PixelGetColor($coord[0],$coord[1],0)
$check = PixelGetColor($coord^ ERROR

Error: Subscript used with non-array variable
Edited by jpres
Link to comment
Share on other sites

Hi there ^_^

Ok.

Use

do
until 1=2

instead of !!

For $i = 1 to 9999999999999999999999999
next

And next:

Func Jiz()
    If $v=2 Then
       do
            $coord = PixelSearch(0,0,1024,768,5210767)
            if not @error then
 $check = PixelGetColor($coord[0],$coord[1],0)
            If $check = 5210767 Then    MouseMove($coord[0],$coord[1], 0)
        EndIf
     until 1=2
        Else
    EndIf
EndFunc
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...