Originally Posted by
rvbfreak
Concept code time
EDIT: Simplified by changing $lastArrayItem to $totalItems and doing a little math
Arrays (cleaned a little) - Pastebin.com
Adds arrays, executes them one at a time. Tested using random bits of my desktop and working.
Code:
$currentArrayItem = 0
$lastArrayItem = 1 ;you need to change this to the number of items in the array minus 1 (because it starts with 0)
$gX = 0
$gY = 0
;First to declare the array
Global $pick[2] ;change the 3 to the amount of items in your array
$pick[0] = "tome.png" ;this is self explanatory
$pick[1] = "uare.png"
;once thats all set up, lets look at the actual code
Func pickItems()
$currentArrayItem = 0
$gX = 0
$gY = 0
for $i = 0 to $lastArrayItem
$urlString = "C:\Users\Chris\Desktop\AutoIt_Images\" & $pick[$i] ;once again, change the path
MsgBox("","",$urlString)
$Search = _ImageSearchArea($urlString,1,0,0,@DesktopWidth,@DesktopHeight,$gX,$gY,100)
if $search = 1 then
MouseMove($gX, $gY, 3)
sleep(1000)
MouseClick("left",$gX,$gY,1,1)
Else
EndIf
next
EndFunc
damn thing is saying variable undeclared
used the cleaned up code
for $i = 0 to ($totalItems- 1 )
for $i = 0 (^ error
error: variable used without being declared.
bah