I need help i no understan how works pixel search
how i can get correct coordinates ?
; Find a pure red pixel or a red pixel within 10 shades variations of pure red
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )
If Not @error Then
MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf
#include <GUIConstants.au3>
#include <Misc.au3>
Global Const $WS_EX_TOPMOST = 8
Opt("MouseCoordMode", 0)
Opt("GUICoordMode",2)
; X3DKernel
HotKeySet( "{ESC}", "_EXIT")
HotKeySet( "{F11}", "_START")
HotKeySet( "^{F11}", "_PAUSE")
HotKeySet( "{F10}", "_SETUPVE")
Dim $pos, $color
Dim $pause = 0
Dim $meditating = 0
Dim $hack_running = 0
Dim $hwnd, $lblLeft, $lblRight
Dim $checksum
Dim $game_title = "Cuu Long Tranh Ba"
Dim $game_hwnd = WinGetHandle($game_title)
Dim $hack_title = "Game Utility for 9Dragons"
Dim $hack_hwnd = WinGetHandle($hack_title)
Dim $hDll, $vDC, $vRegion
Func _SETUPVE()
WinActivate($game_title)
$pos = MouseGetPos()
$color = Hex(PixelGetColor($pos[0], $pos[1], $game_hwnd), 6)
_WriteStatus("Setting up VE... x=" & $pos[0] & " y=" & $pos[1] & " color=" & $color)
EndFunc
Func _EXIT()
Exit 0
EndFunc
Func _PAUSE()
$pause = 1 - $pause
if $pause Then
GUICtrlSetColor($lblRight, 0xFF0000)
_WriteStatus("Paused.")
Else
GUICtrlSetColor($lblRight, 0xFFFFFF)
_WriteStatus("Unpaused.")
EndIf
EndFunc
Func _START()
GUICtrlSetColor($lblRight, 0xFFFFFF)
While 1
if $pause = 0 Then
PixelSearch($pos[0], $pos[1], $pos[0]+5, $pos[1]+5, 0x00009c, 10, 1, $game_hwnd)
If Not @error Then
If $hack_running = 0 Then
_ToggleHack()
EndIf
Else
_WriteStatus("Out of Vital Energy")
If $meditating = 0 Then
; we need to stop the hack and meditate
If $hack_running = 1 Then
_ToggleHack()
EndIf
_Meditate()
EndIf
EndIf
Sleep(3000)
EndIf
WEnd
EndFunc
Func _Meditate()
ControlSend($game_hwnd, "", "", "p") ; window doesnt need to be active
$meditating = 1 - $meditating
_WriteStatus("Meditating...")
EndFunc
Func _ToggleHack()
ControlFocus($hack_title, "", "")
$hack_running = 1 - $hack_running
If $hack_running Then
_WriteStatus("Enabling hack...")
Else
_WriteStatus("Disabling hack...")
EndIf
EndFunc
Func _WriteStatus($msg)
ConsoleWrite($msg & @CRLF)
EndFunc
Func _MAIN()
$hwnd = GUICreate("9Dragons Skill Trainer", 250, 30, 750, 15, -1, $WS_EX_TOPMOST)
$lblLeft = GUICtrlCreateLabel("test", 10, 10, 200)
$lblRight = GUICtrlCreateLabel("wait", 0, -1, 50)
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc
_MAIN()
I doubt it works anymore but here is how you use it. You'd press F10 to setup VE, where you put your mouse cursor over the VE bar in a spot where you wanted it to meditate once it reaches it. The script will get call MouseGetPos() to get the current mouse coordinates, then call PixelGetColor so it knows what color to look for (blue).
PixelSearch works off of a rectangle, in this case:
$pos[0] = X coordinate
$pos[1] = Y coordinate
$pos[0]+5 = Width
$pos[1]+5 = Height
In this case, 5 is just a magic number I pulled out of my ass.
Edit: It looks like I left $color in there but it is not used. If you want to use it, just replace 0x00009c with $color
#include <GUIConstants.au3>
#include <Misc.au3>
Global Const $WS_EX_TOPMOST = 8
Opt("MouseCoordMode", 0)
Opt("GUICoordMode",2)
; X3DKernel
HotKeySet( "{ESC}", "_EXIT")
HotKeySet( "{F11}", "_START")
HotKeySet( "^{F11}", "_PAUSE")
HotKeySet( "{F10}", "_SETUPVE")
Dim $pos, $color
Dim $pause = 0
Dim $meditating = 0
Dim $hack_running = 0
Dim $hwnd, $lblLeft, $lblRight
Dim $checksum
Dim $game_title = "Cuu Long Tranh Ba"
Dim $game_hwnd = WinGetHandle($game_title)
Dim $hack_title = "Game Utility for 9Dragons"
Dim $hack_hwnd = WinGetHandle($hack_title)
Dim $hDll, $vDC, $vRegion
Func _SETUPVE()
WinActivate($game_title)
$pos = MouseGetPos()
$color = Hex(PixelGetColor($pos[0], $pos[1], $game_hwnd), 6)
_WriteStatus("Setting up VE... x=" & $pos[0] & " y=" & $pos[1] & " color=" & $color)
EndFunc
Func _EXIT()
Exit 0
EndFunc
Func _PAUSE()
$pause = 1 - $pause
if $pause Then
GUICtrlSetColor($lblRight, 0xFF0000)
_WriteStatus("Paused.")
Else
GUICtrlSetColor($lblRight, 0xFFFFFF)
_WriteStatus("Unpaused.")
EndIf
EndFunc
Func _START()
GUICtrlSetColor($lblRight, 0xFFFFFF)
While 1
if $pause = 0 Then
PixelSearch($pos[0], $pos[1], $pos[0]+5, $pos[1]+5, 0x00009c, 10, 1, $game_hwnd)
If Not @error Then
If $hack_running = 0 Then
_ToggleHack()
EndIf
Else
_WriteStatus("Out of Vital Energy")
If $meditating = 0 Then
; we need to stop the hack and meditate
If $hack_running = 1 Then
_ToggleHack()
EndIf
_Meditate()
EndIf
EndIf
Sleep(3000)
EndIf
WEnd
EndFunc
Func _Meditate()
ControlSend($game_hwnd, "", "", "p") ; window doesnt need to be active
$meditating = 1 - $meditating
_WriteStatus("Meditating...")
EndFunc
Func _ToggleHack()
ControlFocus($hack_title, "", "")
$hack_running = 1 - $hack_running
If $hack_running Then
_WriteStatus("Enabling hack...")
Else
_WriteStatus("Disabling hack...")
EndIf
EndFunc
Func _WriteStatus($msg)
ConsoleWrite($msg & @CRLF)
EndFunc
Func _MAIN()
$hwnd = GUICreate("9Dragons Skill Trainer", 250, 30, 750, 15, -1, $WS_EX_TOPMOST)
$lblLeft = GUICtrlCreateLabel("test", 10, 10, 200)
$lblRight = GUICtrlCreateLabel("wait", 0, -1, 50)
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc
_MAIN()
I doubt it works anymore but here is how you use it. You'd press F10 to setup VE, where you put your mouse cursor over the VE bar in a spot where you wanted it to meditate once it reaches it. The script will get call MouseGetPos() to get the current mouse coordinates, then call PixelGetColor so it knows what color to look for (blue).
PixelSearch works off of a rectangle, in this case:
$pos[0] = X coordinate
$pos[1] = Y coordinate
$pos[0]+5 = Width
$pos[1]+5 = Height
In this case, 5 is just a magic number I pulled out of my ass.
Edit: It looks like I left $color in there but it is not used. If you want to use it, just replace 0x00009c with $color
you know some code for put a packet sender with autoit ?(autochecksum)
thanks xD
my idea is make a auto-grinder for 9d for hyb healer or warrior
you have some idea for make hack detect mobs near of my char and kill?