Code:
Func AH()
$AH = Not $AH
If $AH = False Then
SetGUIStatus("Pausing AH")
Else
SetGUIStatus("Starting AH")
EndIf
While $AH = True
GetStateAH()
WEnd
EndFunc ;==>AH
Func DetectStateAH(ByRef $C)
Local $SSN = 1
FFSnapShot(1273 + $ResOffset[0], 326 + $ResOffset[2], 1326 + $ResOffset[0], 736 + $ResOffset[1], $SSN)
; buttons region
$FF3 = FFColorCount($C[4], 10, True, $C[0], $C[1], $C[2], $C[3], $SSN)
Return $FF3
EndFunc ;==>DetectStateAH
Func GetStateAH()
Local Const $PurpleBags = "res/marketplace_purplebags.bmp"
Local $x, $y, $IS
Local $auctionbid[5] = [1289, 340, 1315, 354, 0xB8B8B8] ;first button
Local $offsetbuy = 62 ;offset between buy-bid buttons
Local $SSN = 1, $FF
$ResOffset = DetectFullscreenToWindowedOffset()
$IS = _ImageSearchArea($PurpleBags, 1, $ResOffset[0], $ResOffset[1], $ResOffset[2], $ResOffset[3], $x, $y, 0, 0)
If $IS = False Then
SetGUIStatus("No PurpleBags found. Stopping.")
$AH = False
EndIf
While $AH = True
SetGUIStatus("Marketplace is working")
Sleep(Random(400, 600))
MouseClick("left", 793, 775, 1, 1)
FFSnapShot(1275, 330, 1327, 860, $SSN)
$count = 0
For $j = 0 To 6 ; number of checks
$FF = FFColorCount($auctionbid[4], 10, True, $auctionbid[0], $auctionbid[1] + $offsetbuy * $j, $auctionbid[2], $auctionbid[3] + $offsetbuy * $j, $SSN)
If $FF > 5 Then
$count += 1
EndIf
Next
If $count >= 1 Then
Bid($auctionbid, $count)
EndIf
WEnd
EndFunc ;==>GetStateAH
Func Bid($coords, $number)
Cr(@CRLF + $number)
For $i = 0 To $number - 1
MouseMove(Int($coords[0]), Int($coords[1]) + 62 * $i, 0)
Sleep(200)
MouseDown("left")
Sleep(200)
MouseUp("left")
Sleep(200)
CoSe("{ENTER}")
CoSe("{ENTER}")
Next
EndFunc ;==>Bid
a simpler coder for ah to make it easy on ppl who wants to change or modify anything
Sent from my Redmi 4 using Tapatalk