Jump to content
Sign in to follow this  

Need help here with pixelchecksum and arrays

Recommended Posts


hi guys, i need help here. hope someone can correct me.

i am writing a program whereby it will scan the screen for a particular color using "pixelsearch". after which it will then move the mouse to the location and do a "pixelchecksum" on the location which is a 13 x 13 square. but then when i do so, i get this error "Subscript used with non-Array variable". error occurs at the highlighted sentence.

can anyone point to me what's wrong? thanks, script as below ....

HotKeySet("!a", "StartLoop"); when Alt-a pressed, the loop will start

HotKeySet("!s", "QuitLoop"); when Alt-s is pressed, the loop will stop

HotKeySet("{ESC}", "_Quit") ; when ESC is pressed, exit the script

Func StartLoop()

$start = 1 ; setting the condition

EndFunc ;==>StartLoop

While 1

If $start Then ; Start looping continuously until button press (Main Body)





Func mapalignmentcheck() ; checking the aligment of the map



$col = pixelsearch(0,100,1020,765,0x4A3110,0) ; looking for a unique color on the map tab as landmark

If Not @error Then

$xy = Mousemove($col[0],$col[1]); move mouse to the location

$var = PixelChecksum($xy[0],$xy[1],$xy[1]+13,$xy[0]+13)

Tooltip("Checksum = " &$var)




Func QuitLoop()

$start = 0 ; setting the condition

EndFunc ;==>QuitLoop

Func _Quit()


EndFunc ;==>_Quit

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.