Jump to content

Memory error


Recommended Posts

Alright so I'm trying to make an auto-potter for my game through memory. But it is not working at all... My script is small and simple enough, I just don't see why it won't work...

#include <misc.au3>
#include <NomadMemory.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


HotKeySet("{F5}", "On")
HotKeySet("{ESC}", "Terminate")

Global $start = 0, $Mem_Handle, $PID = ProcessExists("Conquer.exe"), $hpmem = "0x01538CF0", $hpbox = "0x01E6B9B4"

;hpmem = The actual HP numbers
;hp box = How many pots you actually have

$Mem_Handle = _MemoryOpen($PID)

#Region ###
$Form1_1 = GUICreate("Form1", 498, 197, 194, 126)
$Input1 = GUICtrlCreateInput("", 24, 16, 209, 21)
$Label1 = GUICtrlCreateLabel("Type in the HP you wish to Heal at.", 256, 16, 171, 17)
$Combo1 = GUICtrlCreateCombo("F1", 24, 48, 89, 25)
GUICtrlSetData(-1, "F2|F3|F4|F5|F6|F7|F8|F9|F10")
$Label2 = GUICtrlCreateLabel("Select the key that will use the HEALTH pots.", 136, 48, 220, 17)
$Input2 = GUICtrlCreateInput("", 24, 120, 209, 21)
$Combo2 = GUICtrlCreateCombo("F1", 24, 160, 89, 25)
GUICtrlSetData(-1, "F2|F3|F4|F5|F6|F7|F8|F9|F10")
$Label3 = GUICtrlCreateLabel("Type in when you want a pot box to be used", 256, 120, 214, 17)
$Label4 = GUICtrlCreateLabel("(how many pots remaining)", 256, 136, 129, 17)
$Label5 = GUICtrlCreateLabel("Select the key that will use the Health BOXES.", 128, 168, 224, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    If $start Then
        Hp()
    EndIf

WEnd

Func Terminate()
    _MemoryClose($PID)
    Sleep(100)
    Exit
EndFunc

Func Hp()
        If GuiCtrlRead($Input1) >= _MemoryRead($hpmem, $Mem_Handle) Then; --If (typed in 100) is >= Health (200)
            MsgBox(0, "", "ewww")
            Send("{" & GUICtrlRead($Combo1) & "}")
        ElseIf _MemoryRead(GuiCtrlRead($Input2), $Mem_Handle) >= _MemoryRead($hpbox, $Mem_Handle) Then
    ;MsgBox(0,"","Hp BOXXXXXX")
    ;Send("{" & GUICtrlRead($Combo2) & "}")
        EndIf
EndFunc
    


Func On()
    $start = NOT $start
    If $PID <> 0 And $Mem_Handle = "" Then
        $Mem_Handle = _MemoryOpen($PID)
    ElseIf $PID = 0 Then
        MsgBox(0,"Error","Please open Conquer 2.0 before starting the program.")
        $start = Not $start
    EndIf
EndFunc

My only theory is in this line:

If GuiCtrlRead($Input1) >= _MemoryRead($hpmem, $Mem_Handle) Then

The value GuiCtrlRead($Input1) gives back is a plain numerical number... The number _MemoryRead returns is a numerical number THROUGH MEMORY in my game... So maybe its an invalid comparison?

(Ignore the ElseIf in the Hp(), I was messing around to try fixing it up, but it would not work)

The only solution I can think of is using a Do loop, but that causes only Health Pots to be used... My ElseIf statement is meant for Hleath Pot Boxes to be used... So if they type in 2 in $Input2 it will send a key once the Health Pots get down to 2 to open up a box to gain 3 more health pots.... I suppose if no one can help me, I'll have to use the Do loop :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...