ช่วยแนะนำหน่อยนะครับ ปัญหาของผมคือ มันไม่ยอมออกจาก Func Chips() ครับ บางทีก็ออกบางทีก็ไม่ออกช่วยแนะนำการเขียนที่ถูกต้องด้วยนะครับ
HotKeySet("{ESC}","_Exit")
While -1
Sleep(50)
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFF00FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x0080FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFFFF00)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x00FF00)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x004040)
If Not @error Then
MouseClick("left",$coord[0]+27,$coord[1]+28,1,0)
Sleep(2000)
$coord1 = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x008000)
If Not @error Then
Chips()
Sleep(1000)
MouseClickDrag("left",$coord1[0], $coord1[1], $coord1[0]+335, $coord1[1])
Sleep(1000)
Chips()
Sleep(1000)
MouseClick("right",$coord1[0]+27,$coord1[1]+28,1,0)
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
WEnd
Func Chips()
While -1
Sleep(100)
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFFFF00)
If @error Then
Return
EndIf
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x8080FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFF0000)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x008000)
If @error Then
Return
EndIf
Sleep(500)
MouseClick("left",$coord[0]+20,$coord[1]+28,1,0)
EndIf
EndIf
WEnd
EndFunc
Func _Exit()
Exit
EndFunc
HotKeySet("{ESC}","_Exit")
While -1
Sleep(50)
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFF00FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x0080FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFFFF00)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x00FF00)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x004040)
If Not @error Then
MouseClick("left",$coord[0]+27,$coord[1]+28,1,0)
Sleep(2000)
$coord1 = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x008000)
If Not @error Then
Chips()
Sleep(1000)
MouseClickDrag("left",$coord1[0], $coord1[1], $coord1[0]+335, $coord1[1])
Sleep(1000)
Chips()
Sleep(1000)
MouseClick("right",$coord1[0]+27,$coord1[1]+28,1,0)
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
WEnd
Func Chips()
While -1
Sleep(100)
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFFFF00)
If @error Then
Return
EndIf
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x8080FF)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0xFF0000)
If Not @error Then
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x008000)
If @error Then
Return
EndIf
Sleep(500)
MouseClick("left",$coord[0]+20,$coord[1]+28,1,0)
EndIf
EndIf
WEnd
EndFunc
Func _Exit()
Exit
EndFunc