Auto Pots

08/27/2010 19:04 majidemo#1
i currently have a code for a auto potter,
but i have a problem. in the game QWE will heal HP MP & Poison,
if i use send() it works okay...
but i want to use ControlSend(), because it works even if game window is not focused. but it doesnt work, it doesnt PRESS the QWE, but it will TYPE..

anyway for pressing Q W E on keyboard code that works to an specific window.

PHP Code:
#include <NomadMemory3.au3>
#include <GUIConstantsEx.au3>

;Local $rNew,$rOld
Local $CurHPOffset
[7] = [0, Dec("18570DC"), Dec("4338"), Dec("3C"), Dec("6C"), Dec(0), Dec("C0")]
Local $MaxHPOffset[7] = [0, Dec("18570DC"), Dec("4338"), Dec("3C"), Dec("6C"), Dec(0), Dec("C8")]
Local $CurMPOffset[7] = [0, Dec("18570DC"), Dec("4338"), Dec("3C"), Dec("6C"), Dec(4), Dec("C0")]
Local $MaxMPOffset[7] = [0, Dec("18570DC"), Dec("4338"), Dec("3C"), Dec("6C"), Dec(4), Dec("C8")]
Local $CurEXPOffset[3] = [0, Dec("7198BC"), Dec("128")]
Local $MaxEXPOffset[3] = [0, Dec("7197B4"), Dec("101C")]
Local $KillerOffset[2] = [0, Dec("116")]

$hMemoryOpen = _OpenMemory("KhanClient.exe")
$HPMPfADDR = _GetFinalAddress($hMemoryOpen,"18570DC")
$CurEXPfADDR = _GetFinalAddress($hMemoryOpen,"7198BC")
$MaxEXPfADDR = _GetFinalAddress($hMemoryOpen,"7197B4")
$KillerfADDR = _GetFinalAddress($hMemoryOpen,"3198BC")

$rCurHPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$CurHPOffset)
$rMaxHPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$MaxHPOffset)
$rCurMPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$CurMPOffset)
$rMaxMPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$MaxMPOffset)
$rCurEXPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$CurEXPOffset)
$rMaxEXPold = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$MaxEXPOffset)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Khan Tools", 157, 181, 501, 202)
$hp_prog = GUICtrlCreateProgress(15, 20, 121, 16)
$hp_slider = GUICtrlCreateSlider(15, 40, 121, 16)
GUICtrlSetData($hp_slider, 50)
$mp_prog = GUICtrlCreateProgress(15, 65, 121, 16)
$mp_slider = GUICtrlCreateSlider(15, 85, 121, 16)
GUICtrlSetData($mp_slider, 50)
$exp_prog = GUICtrlCreateProgress(15, 120, 121, 16)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $msg 
= GUIGetMsg()
    If 
$msg = $GUI_EVENT_CLOSE Then ExitLoop    
    
If ProcessExists("KhanClient.exe") = 0 Then
        ExitLoop
    
EndIf
    
    ;
Declaring Variables
    $rCurHPnew 
= _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$CurHPOffset)
    
$rMaxHPnew = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$MaxHPOffset)
    
$rCurMPnew = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$CurMPOffset)
    
$rMaxMPnew = _ReadFromPointer($HPMPfADDR,$hMemoryOpen,$MaxMPOffset)
    
$rCurEXPnew = _ReadFromPointer($CurEXPfADDR,$hMemoryOpen,$CurEXPOffset)
    
$rMaxEXPnew = _ReadFromPointer($MaxEXPfADDR,$hMemoryOpen,$MaxEXPOffset)
    
$hp_perc = Round(($rCurHPnew/$rMaxHPnew)*100, 1)
    
$mp_perc = Round(($rCurMPnew/$rMaxMPnew)*100, 1)
    
$exp_perc = Round(($rCurEXPnew/$rMaxEXPnew)*100, 1)
    
    ;
Setting Default Data
    GUICtrlSetData
($hp_prog, $hp_perc, "")
    
GUICtrlSetData($mp_prog, $mp_perc, "")qw
    GUICtrlSetData
($exp_prog, $exp_perc, "")
    
;----------------------------------------------------
;
Problem here, this works but not as planned.
;----------------------------------------------------
    If 
$hp_perc < GUICtrlRead($hp_slider) Then
        Send
("{q}")
    EndIf
    
    If 
$mp_perc < GUICtrlRead($mp_slider) Then
        Send
("{w}")
    EndIf    
;----------------------------------------------------
; 
I want it to work even if Khan Power window is not active
;----------------------------------------------------

WEnd
_MemoryClose
($hMemoryOpen)

Func _OpenMemory($sProcess)
    
$aOpen = _MemoryOpen(ProcessExists($sProcess))
    If 
$aOpen = 0 Then
    
Switch @error
    
Case 1
    MsgBox
(0, "Error", "Error opening Process: Process ID is invalid.")
    Case 
2
    MsgBox
(0, "Error", "Error opening Process: Failed to open Kernel32.dll.")
    Case 
3
    MsgBox
(0, "Error", "Error opening " & $aOpen & ".")
    EndSwitch
    Exit
    EndIf

    Return 
$aOpen
EndFunc

Func _GetFinalAddress
($hMemory, $xStaticOffset)
    
Local $iStaticOffset, $iBaseAddress

    $iBaseAddress 
= _MemoryGetBaseAddress($hMemory, 1)
    If 
$iBaseAddress = 0 Then
    
Switch @error
    
Case 1
    MsgBox
(0, "Error", "Error getting Base Address: Invalid Handle to open Process.")
    Case 
2
    MsgBox
(0, "Error", "Error getting Base Address: Failed to find correct allocation Address.")
    Case 
3
    MsgBox
(0, "Error", "Error getting Base Address: Failed to read from the specified Process.")
    EndSwitch
    Exit
    EndIf

    Return 
"0x" & Hex($iBaseAddress + Dec($xStaticOffset))
EndFunc

Func _ReadFromPointer
($xFinalAddress,$hMemory,$aOffset,$sType = "dword")
    
Local $aRead

    $aRead 
= _MemoryPointerRead($xFinalAddress, $hMemory, $aOffset, $sType)
    If 
$aRead = 0 Then
    
Switch @error
    
Case 1
    MsgBox
(0, "Error", "Error reading Pointer: The specified Offset isn't an Array")
    Case 
2
    MsgBox
(0, "Error", "Error reading Pointer: Invalid Handle to open Process.")
    Case 
3
    MsgBox
(0, "Error", "Error reading Pointer: Type is not a String")
    Case 
4
    MsgBox
(0, "Error", "Error reading Pointer: Type is unsupported or unknown")
    Case 
5
    MsgBox
(0, "Error", "Error reading Pointer: Failed to allocate the memory needed for the DllStructure")
    Case 
6
    MsgBox
(0, "Error", "Error reading Pointer: Failed to allocate the memory needed for " & $sType)
    Case 
7
    MsgBox
(0, "Error", "Error reading Pointer: Failed to read from the specified Process")
    EndSwitch
    Exit
    Else
    Return 
$aRead[1]
    EndIf
EndFunc 
08/28/2010 17:13 majidemo#2
encase most people here are german :) i have it translated.

Im Moment habe ich einen Code für ein auto Töpfer,
aber ich habe ein Problem. im Spiel QWE heilt HP MP & Poison,
Wenn ich send () funktioniert es okay ...
aber ich möchte ControlSend () verwenden, weil es funktioniert, auch wenn Spiel-Fenster nicht fokussiert wird. aber es tut wirken, tut es der PRESS QWE, aber es wird TYPE ..

sowieso zum Pressen QWE auf Tastatur-Code, der auf ein spezifisches Fenster funktioniert.
08/28/2010 20:59 93hacker#3
Verbesserung:
Im Moment habe ich einen Code für ein auto Potter,
aber ich habe ein Problem. im Spiel QWE heilt HP MP & Poison(gift???),
Wenn ich send () funktioniert es normal ...
aber ich möchte ControlSend () verwenden, weil es besser funktioniert???, auch wenn Spiel-Fenster nicht fokussiert wird. Aber es wirkt nicht, aber es presst nicht: PRESS QWE, aber es wird TYPE ..???

sowieso zum Pressen QWE auf Tastatur-Code, der auf ein spezifisches Fenster funktioniert.

Has this game a hack guard? (sry for my bad english) :D
08/29/2010 05:50 majidemo#4
No, no hack guard.. Just hack game directly, i can even use wpe,rpe & ce.. Game name is Khan Online.. Game is NOT secure.. Very easy to hack.. Your english is good :)
08/31/2010 15:32 majidemo#5
can anybody help? :))
08/31/2010 17:35 omer36#6
how you try to " ControlSend() " ??
09/01/2010 16:36 majidemo#7
yes i tried ControlSend() but NOT work, it TYPES/WRITES the Q or W or E, not PRESS on keyboard...
09/07/2010 16:12 majidemo#8
help?please....