Shahzam Posted June 11, 2009 Posted June 11, 2009 So I'm just starting out AutoIT and I'm trying to create a bot with this game:http://www.addictinggames.com/curveball.htmlThing is I've coded this soo far:WinActivate("Curve Ball") $x=1 ; Find Location at Position 1 $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10) If Not @error Then MsgBox(0, "lol", "Sucess " & $coord[0] & " x " & $coord[1]) MouseClick("left", $coord[0], $coord[1]) Do $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10) ;MouseClick("left", $coord[0], $coord[1]) MouseMove($coord[0], $coord[1]) Until $x = 50 EndIfThe first part succeeds and it continues to follow it for 1 second, then it exit's and gives me this in the console:C:\Users\Shahzam\Desktop\testtt.au3 (11) : ==> Subscript used with non-Array variable.: MouseMove($coord[0], $coord[1]) MouseMove($coord^ ERROR >Exit code: 1 Time: 2.750Not really sure where the error is, anyone know?
Valuater Posted June 11, 2009 Posted June 11, 2009 WinActivate("Curve Ball") $x=1 ; Find Location at Position 1 $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10) If Not @error Then MsgBox(0, "lol", "Sucess " & $coord[0] & " x " & $coord[1]) MouseClick("left", $coord[0], $coord[1]) Do $coord = PixelSearch( 257, 271, 750, 613, 0x86FF69, 10) If Not @error Then ;MouseClick("left", $coord[0], $coord[1]) MouseMove($coord[0], $coord[1]) EndIf Sleep(5) ; save CPU Until $x = 50 EndIf 8)
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