ช่วยดูหน่อยครับผมอยากให้ สั่งกดปุ่ม Send("A") เป็นจังหวะเท่าๆกันไม่อยากให้ มันมากเกินไปหรือน้อยเกินไป แล้วมีอะไรที่ผมต้องแก้อีกไหม ครับ
- Code:
AutoItSetOption("WinTitleMatchMode", 4)
Global $GameHD
Global $begin = TimerInit(), $B1 = 1, $B2 = 5
AdlibRegister("buff", 1000)
_PSsixLoadH("BlueStacks App Player")
If WinExists($GameHD) Then WinActivate($GameHD)
While 1
Global $monster[3] = [0xFF0000,0x00C3D8,0xFDBE5F]
For $i = 0 To UBound($monster)-1
$coord = PixelSearch(0,0, 500, 600,$monster[$i])
ConsoleWrite('หาสี = ' &Hex($monster[$i],6) & @error & @crlf)
If IsArray($coord) Then
ConsoleWrite($coord[0]&'x' & $coord[1] & @error & @crlf)
MouseClick("left",792, 526,1,20)
Sleep(2000)
$coord = PixelSearch(649, 18,691, 56,0xFF0000)
MouseClick("left",792, 526,1,20)
Sleep(2000)
EndIf
Next
While 1
Global $monster[3] = [0xFF0000,0x00799A,0xFABB5E]
For $i = 0 To UBound($monster)-1
$coord = PixelSearch(0,0, 500, 600,$monster[$i])
ConsoleWrite('หาสี = ' &Hex($monster[$i],6) & @error & @crlf)
If IsArray($coord) Then
ConsoleWrite($coord[0]&'x' & $coord[1] & @error & @crlf)
EndIf
Next
$Diff = Int(TimerDiff($begin)/20)
Send("A")
Sleep(20)
Send("s")
Send("T")
Send("D")
Send("S")
ExitLoop
wend
Global $monster[3] = [ 0x00ABC8,0xF4DFA6,0x2D1B1B ]
For $i = 0 To UBound($monster)-1
$coord = PixelSearch(0,0, 500, 600,$monster[$i])
ConsoleWrite('หาสี = ' &Hex($monster[$i],6) & @error & @crlf)
If IsArray($coord) Then
ConsoleWrite($coord[0]&'x' & $coord[1] & @error & @crlf)
MouseClick("left",398, 522,1,300)
ExitLoop
EndIf
Next
wend
Func _PSsixLoadH($gtitle)
$GameHD = WinGetHandle($gtitle)
If @error Then
MsgBox(4096, "Error", "ไม่พบเกม")
Else
Return 1
EndIf
EndFunc