Quote:
Originally Posted by PeaBwainz™
Nice useful share kungfumonkey!
Crude but useful.
Hell I might get a Autoit GUI, VE pixel based auto med trainer up for you 9DVN guys if I get bored this weekend.
I just lag like buggery from my location to the VN servers! Pitty on me!
|
This might help you get started:
Code:
#include <GUIConstants.au3>
; #include <_PixelGetColor.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 = PixelGetColor($pos[0], $pos[1], $game_hwnd)
;$checksum = PixelChecksum($pos[0], $pos[1], $pos[0] + 16, $pos[1] + 16)
;_WriteStatus("Setting up VE... x=" & $pos[0] & " y=" & $pos[1] & " color=" & $color)
; version 2
;WinActivate($game_title)
;$pos = MouseGetPos()
;$hDll = DllOpen("gdi32.dll")
;$vDC = _PixelGetColor_CreateDC($hDll)
;$sSize = WinGetClientSize($game_title)
;$vRegion = _PixelGetColor_CaptureRegion($vDC, 0, 0, $sSize[0], $sSize[1], $hDll)
;$color = _PixelGetColor_GetPixel($vDC, $pos[0], $pos[1])
$color = Hex(PixelGetColor($pos[0], $pos[1], $game_hwnd), 6)
_WriteStatus("Setting up VE... x=" & $pos[0] & " y=" & $pos[1] & " color=" & $color)
;PixelSearch(90, 60, 883, 754, 646464, 10, 1, $game_hwnd)
EndFunc
Func _EXIT()
;_PixelGetColor_ReleaseRegion($vRegion)
;_PixelGetColor_ReleaseDC($vDC, $hDll)
;DllClose($hDll)
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
;$cur_color = Hex(PixelGetColor($pos[0], $pos[1], $game_hwnd), 6)
;$cur_checksum = PixelChecksum($pos[0], $pos[1], $pos[0] + 16, $pos[1] + 16)
; version 2
;$cur_color = PixelGetColor($pos[0], $pos[1], $game_hwnd)
PixelSearch($pos[0], $pos[1], $pos[0]+5, $pos[1]+5, 0x00009c, 10, 1, $game_hwnd)
;_WriteStatus("Check: cur_color=" & $cur_color & ", color=" & $color)
If Not @error Then
;If $color = $cur_color 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, "", "")
;$ret = ControlClick($hack_title, "", "") ; we dont specify the button text; Auto button has no text, only an image
$hack_running = 1 - $hack_running
If $hack_running Then
_WriteStatus("Enabling hack...")
Else
_WriteStatus("Disabling hack...")
EndIf
EndFunc
Func _WriteStatus($msg)
ConsoleWrite($msg & @CRLF)
;GUICtrlSetData($lblLeft, $msg)
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()
This is incomplete. The _SETUPVE() is the point of interest. I was never able to come up with a reliable solution to detecting VE with PixelGetColor, PixelChecksum, PixelSearch, or _PixelGetColor_GetPixel without it working intermittently.
You run it, F10 to setup VE, then F11 to start and control-F11 to pause. This was designed to run with the Game Utility program, where the hack sends the buffs and this autoit tries to read VE, and meditate when necessary