Harusal Posted November 14, 2008 Posted November 14, 2008 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! 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
dbzfanatic Posted November 14, 2008 Posted November 14, 2008 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. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
gauss5546 Posted November 14, 2008 Posted November 14, 2008 _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: CODEAutoPot() 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.
dbzfanatic Posted November 14, 2008 Posted November 14, 2008 _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: CODEAutoPot() 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 EndFuncThis 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. 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. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
gauss5546 Posted November 14, 2008 Posted November 14, 2008 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.
dbzfanatic Posted November 14, 2008 Posted November 14, 2008 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. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now