ผมลองดูแล้วแต่เหมือนะไม่ค่อยดีนะคับ
พี่ ๆ ลองมาช่วย ดูให้หน่อยคับว่าต้องแก้ตรงไหนบ้างนะ
Global $GameHD
Func _PSsixLoadH($gtitle)
$GameHD = WinGetHandle($gtitle)
If @error Then
MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
Else
Return 1
EndIf
EndFunc
If _PSsixLoadH("Ran Online") Then WinActivate($GameHD)
While 1
If PixelGetColor(283, 106) = 0xC3C3C3 Then
Send("W")
EndIf
Sleep(3)
If PixelGetColor(283, 120) = 0xC3C3C3 Then
Send("Q")
EndIf
Sleep(3)
If PixelGetColor(272, 134) = 0xC3C3C3 Then
Send("E")
EndIf
Sleep(3)
_FindMonster()
_Skill1()
_FindMonster()
_Skill2()
_FindMonster()
_Skill3()
_FindMonster()
_Skill4()
_FindMonster()
_Skill5()
_FindMonster()
_Skill6()
_keepItem()
WEnd
Func _FindMonster()
$coord = PixelSearch( 161, 183, 884, 517, 0x201F1E )
$coord = PixelSearch( 161, 183, 884, 517, 0x1E1110 )
$coord = PixelSearch( 161, 183, 884, 517, 0x61665F )
$coord = PixelSearch( 161, 183, 884, 517, 0x23190C )
$coord = PixelSearch( 161, 183, 884, 517, 0x070A0C )
$coord = PixelSearch( 161, 183, 884, 517, 0xFF0000 )
$coord = PixelSearch( 161, 183, 884, 517, 0x6F302E )
$coord = PixelSearch( 161, 183, 884, 517, 0x24292F )
$coord = PixelSearch( 161, 183, 884, 517, 0x030306 )
If Not @error Then
MouseClick("Right",$coord[0] ,$coord[1],1,0)
If Not @error Then
MouseClick("Right",$coord[0] ,$coord[1],1,0)
EndIf
Sleep(100)
EndIf
EndFunc
Func _Skill1()
send( "1" )
Sleep(100)
EndFunc
Func _Skill2()
send( "2" )
Sleep(100)
EndFunc
Func _Skill3()
send( "3" )
Sleep(100)
EndFunc
Func _Skill4()
send( "4" )
Sleep(100)
EndFunc
Func _Skill5()
send( "5" )
Sleep(100)
EndFunc
Func _Skill6()
send( "6" )
Sleep(100)
EndFunc
Func _keepItem()
Send( "{SPACE}" )
Sleep(500)
Send( "{SPACE}" )
Sleep(500)
Send( "{SPACE}" )
Sleep(500)
EndFunc
พี่ ๆ ลองมาช่วย ดูให้หน่อยคับว่าต้องแก้ตรงไหนบ้างนะ
Global $GameHD
Func _PSsixLoadH($gtitle)
$GameHD = WinGetHandle($gtitle)
If @error Then
MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
Else
Return 1
EndIf
EndFunc
If _PSsixLoadH("Ran Online") Then WinActivate($GameHD)
While 1
If PixelGetColor(283, 106) = 0xC3C3C3 Then
Send("W")
EndIf
Sleep(3)
If PixelGetColor(283, 120) = 0xC3C3C3 Then
Send("Q")
EndIf
Sleep(3)
If PixelGetColor(272, 134) = 0xC3C3C3 Then
Send("E")
EndIf
Sleep(3)
_FindMonster()
_Skill1()
_FindMonster()
_Skill2()
_FindMonster()
_Skill3()
_FindMonster()
_Skill4()
_FindMonster()
_Skill5()
_FindMonster()
_Skill6()
_keepItem()
WEnd
Func _FindMonster()
$coord = PixelSearch( 161, 183, 884, 517, 0x201F1E )
$coord = PixelSearch( 161, 183, 884, 517, 0x1E1110 )
$coord = PixelSearch( 161, 183, 884, 517, 0x61665F )
$coord = PixelSearch( 161, 183, 884, 517, 0x23190C )
$coord = PixelSearch( 161, 183, 884, 517, 0x070A0C )
$coord = PixelSearch( 161, 183, 884, 517, 0xFF0000 )
$coord = PixelSearch( 161, 183, 884, 517, 0x6F302E )
$coord = PixelSearch( 161, 183, 884, 517, 0x24292F )
$coord = PixelSearch( 161, 183, 884, 517, 0x030306 )
If Not @error Then
MouseClick("Right",$coord[0] ,$coord[1],1,0)
If Not @error Then
MouseClick("Right",$coord[0] ,$coord[1],1,0)
EndIf
Sleep(100)
EndIf
EndFunc
Func _Skill1()
send( "1" )
Sleep(100)
EndFunc
Func _Skill2()
send( "2" )
Sleep(100)
EndFunc
Func _Skill3()
send( "3" )
Sleep(100)
EndFunc
Func _Skill4()
send( "4" )
Sleep(100)
EndFunc
Func _Skill5()
send( "5" )
Sleep(100)
EndFunc
Func _Skill6()
send( "6" )
Sleep(100)
EndFunc
Func _keepItem()
Send( "{SPACE}" )
Sleep(500)
Send( "{SPACE}" )
Sleep(500)
Send( "{SPACE}" )
Sleep(500)
EndFunc