8879899714 Posted September 1, 2007 Share Posted September 1, 2007 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 startHotKeySet("!s", "QuitLoop"); when Alt-s is pressed, the loop will stopHotKeySet("{ESC}", "_Quit") ; when ESC is pressed, exit the scriptFunc StartLoop() $start = 1 ; setting the conditionEndFunc ;==>StartLoopWhile 1 If $start Then ; Start looping continuously until button press (Main Body) mapalignmentcheck() EndIf Sleep(20)WEndFunc mapalignmentcheck() ; checking the aligment of the map Send("m") Sleep(1000) $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) EndIf Sleep(5000)EndFuncFunc QuitLoop() $start = 0 ; setting the conditionEndFunc ;==>QuitLoopFunc _Quit() ExitEndFunc ;==>_Quit Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now