cageman Posted February 21, 2008 Posted February 21, 2008 (edited) i got the code below, but it gives me alot of errors. How can i make a for loop that gives me different $slot variables? and how should i pass the $slot to the item function with the two for loops in the item function im trying to get a area of 10x5 pixels and compare them with some given values to determine what letter it is. Is it right what im doing? im getting confused help pls:) Func Scan() For $i = 2 to $totslots+1 $slot[$i]=$PixelSearch(777,350+18*($i-1),778,850,0x000000) Next For $i = 2 to $totslots+1 $itemstring[$i]=item($slot[$i],0x000000) Next EndFunc Func item($sloti,$itemcolor) For $b = 1 to 10 For $a = 1 to 5 $welkepixel[$b][$a]=PixelGetColor($sloti[0]+$b,$sloti[1]+$a) If $welkepixel[$b][$a]=0x000000 Then $letterstring=$letterstring & 1 Else $letterstring=$letterstring & 0 EndIf Next Next MsgBox(0,"letter",$letterstring) EndFunc Edited February 21, 2008 by cageman
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