Jump to content

Recommended Posts

Posted

I'm making a program to automatically use potions in a game. I'm having it switch to notepad when the health goes lower than the health i put in the input box as a test. But i can't seem to get it to work, any help would be greatly appreciated! :mellow:

Func AutoPot()
Global $OffsetArray[1]
$baseADDR = ("0x00B6AECC")
$OffsetArray[1] = ("00000594")
$PID = WinGetProcess("Game")
$Process = _MemoryOpen($PID)
$CurrentHP = _MemoryPointerRead($baseADDR, $Process, $OffsetArray)
_MemoryClose($ID)
While 1
If $HPInput < $CurrentHP Then
  WinActivate("Untitled - Notepad")
EndIf
WEnd
EndFunc
Posted

Try

Func AutoPot()
Global $OffsetArray[2]
$baseADDR = "0x00B6AECC"
$OffsetArray[1] = "00000594"
$PID = WinGetProcess("Game")
$Process = _MemoryOpen($PID)
$CurrentHP = _MemoryPointerRead($baseADDR, $Process, $OffsetArray)
_MemoryClose($PID)
While 1
If $HPInput < $CurrentHP Then
  WinActivate("Untitled - Notepad")
EndIf
WEnd
EndFunc

Just fixed a few errors I saw right off.

Posted

_MemoryOpen and _MemoryPointerRead are not valid commands. If you run the script dbzfanatic revised you will see the error message I get.

Also, you need to tell the script the run the function by putting AutoPot() right at the begining like this:

CODE
AutoPot()

Func AutoPot()

Global $OffsetArray[2]

$baseADDR = "0x00B6AECC"

$OffsetArray[1] = "00000594"

$PID = WinGetProcess("Game")

$Process = _MemoryOpen($PID)

$CurrentHP = _MemoryPointerRead($baseADDR, $Process, $OffsetArray)

_MemoryClose($PID)

While 1

If $HPInput < $CurrentHP Then

WinActivate("Untitled - Notepad")

EndIf

WEnd

EndFunc

This way the script doesn't just shut off, instead it enables the function given.

I am still working on revising this but any replys or suggestions would help. :mellow:

Posted

_MemoryOpen and _MemoryPointerRead are not valid commands. If you run the script dbzfanatic revised you will see the error message I get.

Also, you need to tell the script the run the function by putting AutoPot() right at the begining like this:

CODE
AutoPot()

Func AutoPot()

Global $OffsetArray[2]

$baseADDR = "0x00B6AECC"

$OffsetArray[1] = "00000594"

$PID = WinGetProcess("Game")

$Process = _MemoryOpen($PID)

$CurrentHP = _MemoryPointerRead($baseADDR, $Process, $OffsetArray)

_MemoryClose($PID)

While 1

If $HPInput < $CurrentHP Then

WinActivate("Untitled - Notepad")

EndIf

WEnd

EndFunc

This way the script doesn't just shut off, instead it enables the function given.

I am still working on revising this but any replys or suggestions would help. :mellow:

You need to think before speaking. Those functions are contained in NomadMemory.au3 and this was a snippet of script,not the entire thing. When a function is not working it is best to post only the function and if a solution can not be found with that snippet then post the full script.
Posted

I was not aware those functions were contained in NomadMemory.au3. Often I find it is easier to troubleshoot when you have the entire script rather than just a snippet.

Every good Auto Pot bot I know of runs separately to ensure that the user does not die. If it is implemented into the script then it better be a fast script otherwise it won't effectively keep you alive.

Posted

Next time research or ask before saying they are not valid functions. With certain timer/adlib UDFs you can simulate multithreading (or get close) so this could be implemented within a larger script.

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
  • Recently Browsing   0 members

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