สคริปด้านล่าง ลองศึกษาดูครับ เกี่ยวกับ การสั่งกดปุ่ม Tab เพื่อเลือกมอน และ โจมตีด้วยการกดปุ่ม Space
โดยใช้เงื่อนไข PixelSearch เช็คค่าสีของหลอดเลือด มอน
Global $Paused
Global $CheckMon = 0
Global $AttackMon = 0
HotKeySet("{PAUSE}", "_TogglePause")
HotKeySet("{END}", "_ExitIt")
Sleep(1000)
;Function Key Control--------------------------------------------------------------------------------------------
Func _TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
EndFunc
Func _ExitIt()
ToolTip("Exit Program ", 2, 0)
MsgBox(64, "Hiew Sudio", " Thanks for used, Made By ScanditionX")
Exit 0
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Function Check ProgramRun-----------------------------------------------------------------------------------
if Not WinExists ("Microsoft Excel - test") then
MsgBox(64, "Hiew Sudio", " You must be running เกม")
Exit
EndIf
Func _Run()
WinActivate('Microsoft Excel - test')
ToolTip('Script is "Run"',0,0)
Return
EndFunc
Func _SystemRun()
$PixSel = PixelSearch(348,231,602,427,0x0000FF)
If Not @error Then
$CheckMon = 1
$AttackMon = 0
Else
$AttackMon = 1
$CheckMon = 0
EndIf
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Func Send Key ---------------------------------------------------------------------------------------------------
Func _SelectTarget()
Send("{TAB}")
Sleep(100)
EndFunc
Func _Attack()
Send("{SPACE}")
Sleep(50)
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Function Main------------------------------------------------------------------------------------------------------
_Run()
_SystemRun()
While True
If Not WinActive("Microsoft Excel - test") Then
Exit 0
EndIf
if $CheckMon = 1 Then
_SelectTarget()
EndIf
If $AttackMon = 1 Then
_Attack()
EndIf
_SystemRun()
WEnd
;------------------------------------------------------------------------------------------------------------------------
โดยใช้เงื่อนไข PixelSearch เช็คค่าสีของหลอดเลือด มอน
Global $Paused
Global $CheckMon = 0
Global $AttackMon = 0
HotKeySet("{PAUSE}", "_TogglePause")
HotKeySet("{END}", "_ExitIt")
Sleep(1000)
;Function Key Control--------------------------------------------------------------------------------------------
Func _TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
EndFunc
Func _ExitIt()
ToolTip("Exit Program ", 2, 0)
MsgBox(64, "Hiew Sudio", " Thanks for used, Made By ScanditionX")
Exit 0
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Function Check ProgramRun-----------------------------------------------------------------------------------
if Not WinExists ("Microsoft Excel - test") then
MsgBox(64, "Hiew Sudio", " You must be running เกม")
Exit
EndIf
Func _Run()
WinActivate('Microsoft Excel - test')
ToolTip('Script is "Run"',0,0)
Return
EndFunc
Func _SystemRun()
$PixSel = PixelSearch(348,231,602,427,0x0000FF)
If Not @error Then
$CheckMon = 1
$AttackMon = 0
Else
$AttackMon = 1
$CheckMon = 0
EndIf
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Func Send Key ---------------------------------------------------------------------------------------------------
Func _SelectTarget()
Send("{TAB}")
Sleep(100)
EndFunc
Func _Attack()
Send("{SPACE}")
Sleep(50)
EndFunc
;------------------------------------------------------------------------------------------------------------------------
;Function Main------------------------------------------------------------------------------------------------------
_Run()
_SystemRun()
While True
If Not WinActive("Microsoft Excel - test") Then
Exit 0
EndIf
if $CheckMon = 1 Then
_SelectTarget()
EndIf
If $AttackMon = 1 Then
_Attack()
EndIf
_SystemRun()
WEnd
;------------------------------------------------------------------------------------------------------------------------