รบกวน พี่ๆ ดู Code ให้หน่อยครับ ตอนนี้ ผมทำ checkbox 1-6 แต่ checkbook ที่ 3 เป็นต้นไป พอติ๊ก แล้ว มันไม่ทำงาน แต่ Checkbox 1-2 ทำงานครับ รบกวนดูให้หน่อยครับ code เป๊ะไว้ด่านล่าง ขอบคุณครับ
#include
#include
Global $GameHD, $nSwitch = 0;
Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode",2)
Opt("PixelCoordMode",2)
Opt("CaretCoordMode",2)
HotKeySet("{ESC}", "quit")
WinMove ("BlueStacks App Player","",0,0)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Button1 = GUICtrlCreateButton("เริ่ม", 88, 152, 161, 65)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("หยุด", 336, 152, 177, 73)
GUICtrlSetOnEvent(-1, "Button2Click")
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 80, 16, 145, 25)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 80, 56, 145, 33)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 80, 104, 145, 33)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 344, 16, 161, 33)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 344, 64, 161, 33)
$Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 344, 112, 169, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
if $nSwitch = 1 Then
$bit01=BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED)
if $bit01 then
if PixelGetColor (724, 509) = 0xDDC897 Then
Sleep(1000)
Call("test1")
EndIf
Sleep(1000)
$bit02=BitAND(GUICtrlRead($Checkbox2),$GUI_CHECKED)
if $bit02 then
if PixelGetColor (831, 506) = 0xDE5A00 Then
Sleep(1000)
Call("test2")
EndIf
Sleep(1000)
$bit03=BitAND(GUICtrlRead($Checkbox3),$GUI_CHECKED)
if $bit03 Then
if PixelGetColor (831, 506) = 0xDE5A00 Then
Sleep(1000)
Call("test3")
EndIf
EndIf
EndIf
EndIf
EndIf
WEnd
Func test1()
Sleep(1000)
ControlClick($GameHD, "", "","left",1,724, 509)
EndFunc
Func test2()
Sleep(1000)
ControlClick($GameHD, "", "","left",1,724, 509)
EndFunc
Func test3()
Sleep(1000)
ControlClick($GameHD, "", "","left",1,724, 509)
EndFunc
Func Button1Click()
$nSwitch = 1
If _PSsixLoadH("BlueStacks App Player") Then WinActivate($GameHD)
EndFunc
Func Button2Click()
$nSwitch = 0
EndFunc
Func _PSsixLoadH($gtitle)
$GameHD = WinGetHandle($gtitle)
If @error Then
MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
$nSwitch = 0
Else
Return 1
EndIf
EndFunc
Func quit()
Exit
EndFunc