11-10-2014, 09:24 PM
I just found this!
Edy Cespedes10 November 2014 16:05
heres my ahk function to scan for gold/elixir.. just pass it a bitmap of the area you want to scan..
ScanLoot(bmpHaystack)
found :=
Loop, 10
{
num := A_Index-1
bmpNeedle := Gdip_CreateBitmapFromFile( "images/" . num . ".png")
RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,0,0,0,0,5,0x000000,1,0)
Gdip_DisposeImage(bmpNeedle)
Loop, Parse, LIST, `n
{
StringSplit, Coord, A_LoopField, `,
found = %found%%Coord1%,%Coord2%,%num%`n
}
}
sort found, N ; sort list of found numbers by x coordinate
StringLeft, found, found, StrLen(found)-1
amt :=
; bring number together and return amount found
Loop, parse, found, `n
{
StringSplit, v, A_LoopField, `,
amt = %amt%%v3%
}
return amt
}
this is not my script, i found it on http://droidgagu.blogspot.in/2014/05/how...ot-of.html (look at the 2nd comment)
Edy Cespedes10 November 2014 16:05
heres my ahk function to scan for gold/elixir.. just pass it a bitmap of the area you want to scan..
ScanLoot(bmpHaystack)
found :=
Loop, 10
{
num := A_Index-1
bmpNeedle := Gdip_CreateBitmapFromFile( "images/" . num . ".png")
RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,0,0,0,0,5,0x000000,1,0)
Gdip_DisposeImage(bmpNeedle)
Loop, Parse, LIST, `n
{
StringSplit, Coord, A_LoopField, `,
found = %found%%Coord1%,%Coord2%,%num%`n
}
}
sort found, N ; sort list of found numbers by x coordinate
StringLeft, found, found, StrLen(found)-1
amt :=
; bring number together and return amount found
Loop, parse, found, `n
{
StringSplit, v, A_LoopField, `,
amt = %amt%%v3%
}
return amt
}
this is not my script, i found it on http://droidgagu.blogspot.in/2014/05/how...ot-of.html (look at the 2nd comment)