Results 1 to 14 of 14
  1. #1
    HaHaItsJake's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    483

    Smile Trove Auto-Pot v1.0.0

    1. Install newest AHK(AutoHotKey) if you haven't.
    2. Create a new AHK script. (Rightclick in folder/on desktop and New> AHK)
    3. Copy the below code inside the new .ahk file. Save.
    4.[Optional] Compile the script. (Right click in .ahk file > Compile)

     

    4/28/2015: Full Release | Address Change For Update


    Start: NumPad9 (Don't hit it again!)
    1. Make sure Trove is the active window before starting the program!
    2. When Prompted, set the desired percent(%) health you want it to heal at.
    DO NOT ADD "%" sign in prompt! 20 = 20%, 50 = 50%, etc.
    Stop: Alt+NumPad9

    Exit Script: Alt+NumPad7

     

    Code:
    #NoEnv
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    CoordMode, Mouse, Screen
    SetTitleMatchMode, 3
    SetKeyDelay, 0, 2
    
    
    Numpad9::
        WinGet, Handle, ID, A
        WinGet, pidn, PID, A
        Break := 0
        InputBox, HealAt, Enter Percent, Percent To Heal At?
        SetFormat, float, 1
        BaseHealth := GetHealth(Handle, pidn)
        Heal := (Health * HealAt) / 100
        Loop {
            GetHealth(Handle, pidn)
            If (Health < Heal)
            {
                ControlSend, , {q}, ahk_pid %pidn%
                Sleep, 500
            }
            If (Break = 1)
            {
                break
            }
            else
            {
                Sleep, 30
            }
        }
    Return
    
    !NumPad7::
        ExitApp
    
    !NumPad9::
        Break := 1
    return
    
    GetHealth(Handle, pid)
    { 
        Global Health
        Base := getProcessBaseAddress(Handle)
        pointerBase := base + 0x00916028
        z1 := ReadMemory(pointerBase, pid)
        z2 := ReadMemory(z1 + 0x98, pid)
        z3 := ReadMemory(z2 + 0x28, pid)
        z4 := ReadMemory(z3 + 0x10, pid)
        z5 := z4 + 0xcc
        Health := ReadMemory(z5, pid)
    }
    
    getProcessBaseAddress(Handle)
    {
        return DllCall( A_PtrSize = 4
                                ? "GetWindowLong"
                                : "GetWindowLongPtr"
                            , "Ptr", Handle
                            , "Int", -6
                            , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
         ; If DLL call fails, returned value will = 0
    }   
    
    ReadMemory(MADDRESS, pid)
    {
    VarSetCapacity(MVALUE,4,0)
    ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
    ;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
    DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
    Loop 4
    result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
    
    return, result
    }
    Tell me and I forget. Teach me and I remember. Involve me and I learn.
    Benjamin Franklin

  2. The Following 6 Users Say Thank You to HaHaItsJake For This Useful Post:

    emo157 (05-04-2015),en0zz (04-28-2015),Takeon (04-28-2015),Trove (04-28-2015),Vitooooo (04-28-2015),zackza550 (05-16-2015)

  3. #2
    Vitooooo's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    9
    Reputation
    10
    Thanks
    0
    Thank You!

  4. #3
    Cellux's Avatar
    Join Date
    Sep 2008
    Gender
    male
    Posts
    69
    Reputation
    10
    Thanks
    186
    Nice job, Jake.

  5. #4
    MagickWolf's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    It dosen't work....
    I download the Auto Hotkey program. I paste the "Code" into the script. I compile it. I run Trove, then run the script. I have also tried running the script first, then running Trove. Once in-game, I press down NUMPAD 9 and I type in the amount of healing I want from," Proceed To Heal At?" I am not sure if it is asking me for the amount of health I start to heal at, or the percentage of health. Anyways, I tried both. I go to a random world with my Ice Sage, and start battling. I don't heal myself of course. But then... IT WON'T HEAL ITSELF. The script itself seems idle. Does it matter what potion I use? I am using the Unyielding Flask. Does it get interfered if I have a Berseker Raptor equipped? Please help.
    Last edited by MagickWolf; 05-02-2015 at 09:04 AM.

  6. #5
    Trove's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    108
    Reputation
    10
    Thanks
    1,376
    My Mood
    Angelic
    Quote Originally Posted by MagickWolf View Post
    It dosen't work....
    I download the Auto Hotkey program. I paste the "Code" into the script. I compile it. I run Trove, then run the script. I have also tried running the script first, then running Trove. Once in-game, I press down NUMPAD 9 and I type in the amount of healing I want from," Proceed To Heal At?" I am not sure if it is asking me for the amount of health I start to heal at, or the percentage of health. Anyways, I tried both. I go to a random world with my Ice Sage, and start battling. I don't heal myself of course. But then... IT WON'T HEAL ITSELF. The script itself seems idle. Does it matter what potion I use? I am using the Unyielding Flask. Does it get interfered if I have a Berseker Raptor equipped? Please help.
    First Run trove, u character on map execute script.

    Mensagem u put % hp restore, exemple i need auto pot use on my Hp is 20% or less put : 20

  7. #6
    MagickWolf's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    I'm sorry, but your sentence did not make sense to me..
    It would be great if you can add a video for it.

  8. #7
    HaHaItsJake's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    483
    Quote Originally Posted by MagickWolf View Post
    It dosen't work....
    Make sure the Potion Hotkey is "q". If it's not "q" change the hotkey either in game, or in the script. Also, make sure the Trove window is active once you run the script.

    Line 21:
    ControlSend, , {q}, ahk_pid %pidn%

    Change "{q}" to the hotkey. Example - If hotkey is H change "q" to "h"; ControlSend, , {h}, ahk_pid %pidn%

    It doesn't matter what you have on your char. If your HP is less then the percent you tell it, it will heal. Other then that, it wont. Find out the Health amount it will heal at, and just stand there in U4 until it drops below the %. The script works perfect for everyone else, it's something on your end you're doing wrong.
    Tell me and I forget. Teach me and I remember. Involve me and I learn.
    Benjamin Franklin

  9. #8
    cofi00full's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    can someone make this an app?

  10. #9
    Trove's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    108
    Reputation
    10
    Thanks
    1,376
    My Mood
    Angelic
    Update Auto-Pot v1.0.1

    Code:
    #NoEnv
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    CoordMode, Mouse, Screen
    SetTitleMatchMode, 3
    SetKeyDelay, 0, 2
    
    
    Numpad9::
        WinGet, Handle, ID, A
        WinGet, pidn, PID, A
        Break := 0
        InputBox, HealAt, Enter Percent, Percent To Heal At?
        SetFormat, float, 1
        BaseHealth := GetHealth(Handle, pidn)
        Heal := (Health * HealAt) / 100
        Loop {
            GetHealth(Handle, pidn)
            If (Health < Heal)
            {
                ControlSend, , {q}, ahk_pid %pidn%
                Sleep, 500
            }
            If (Break = 1)
            {
                break
            }
            else
            {
                Sleep, 30
            }
        }
    Return
    
    !NumPad7::
        ExitApp
    
    !NumPad9::
        Break := 1
    return
    
    GetHealth(Handle, pid)
    { 
        Global Health
        Base := getProcessBaseAddress(Handle)
        pointerBase := base + 0x0091B0A8
        z1 := ReadMemory(pointerBase, pid)
        z2 := ReadMemory(z1 + 0x98, pid)
        z3 := ReadMemory(z2 + 0x28, pid)
        z4 := ReadMemory(z3 + 0x10, pid)
        z5 := z4 + 0xcc
        Health := ReadMemory(z5, pid)
    }
    
    getProcessBaseAddress(Handle)
    {
        return DllCall( A_PtrSize = 4
                                ? "GetWindowLong"
                                : "GetWindowLongPtr"
                            , "Ptr", Handle
                            , "Int", -6
                            , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
         ; If DLL call fails, returned value will = 0
    }   
    
    ReadMemory(MADDRESS, pid)
    {
    VarSetCapacity(MVALUE,4,0)
    ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
    ;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
    DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
    Loop 4
    result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
    
    return, result
    }
    Last edited by Trove; 05-05-2015 at 03:51 PM.

  11. The Following User Says Thank You to Trove For This Useful Post:

    HaHaItsJake (05-06-2015)

  12. #10
    Adrianokk's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    the potion script stopped working, could update?

  13. #11
    HaHaItsJake's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    164
    Reputation
    10
    Thanks
    483
    UPDATE: V1.0.1


     

    4/28/2015: Full Release | Address Change For Update
    5/15/205: Address Update | Offset Updates


     

    Code:
    #NoEnv
    SendMode Input
    SetWorkingDir %A_ScriptDir%
    CoordMode, Mouse, Screen
    SetTitleMatchMode, 3
    SetKeyDelay, 0, 2
    
    
    Numpad9::
    	WinGet, Handle, ID, A
    	WinGet, pidn, PID, A
    	Break := 0
    	InputBox, HealAt, Enter Percent, Percent To Heal At?
    	SetFormat, float, 1
    	BaseHealth := GetHealth(Handle, pidn)
    	Heal := (Health * HealAt) / 100
    	Loop {
    		GetHealth(Handle, pidn)
    		If (Health < Heal)
    		{
    			ControlSend, , {q}, ahk_pid %pidn%
    			Sleep, 500
    		}
    		If (Break = 1)
    		{
    			break
    		}
    		else
    		{
    			Sleep, 30
    		}
    	}
    Return
    
    !NumPad7::
    	ExitApp
    
    !NumPad9::
    	Break := 1
    return
    
    GetHealth(Handle, pid)
    { 
    	Global Health
    	Base := getProcessBaseAddress(Handle)
    	pointerBase := base + 0x0092C524
    	z1 := ReadMemory(pointerBase, pid)
    	z2 := ReadMemory(z1 + 0x98, pid)
        z3 := ReadMemory(z2 + 0x28, pid)
        z4 := ReadMemory(z3 + 0x10, pid)
    	z5 := z4 + 0xc4
    	Health := ReadMemory(z5, pid)
    }
    
    getProcessBaseAddress(Handle)
    {
    	return DllCall( A_PtrSize = 4
                                ? "GetWindowLong"
                                : "GetWindowLongPtr"
                            , "Ptr", Handle
                            , "Int", -6
                            , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
         ; If DLL call fails, returned value will = 0
    }   
    
    ReadMemory(MADDRESS, pid)
    {
    VarSetCapacity(MVALUE,4,0)
    ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
    ;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
    DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
    Loop 4
    result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
    
    return, result
    }
    Tell me and I forget. Teach me and I remember. Involve me and I learn.
    Benjamin Franklin

  14. The Following User Says Thank You to HaHaItsJake For This Useful Post:

    Trove (05-15-2015)

  15. #12
    zackza550's Avatar
    Join Date
    Apr 2015
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Thank You!

  16. #13
    P3ter97kaf's Avatar
    Join Date
    May 2014
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0

    Question

    I have to ask a question, your script gets the current health on the Health variable and the following operation : Health * HealAt / 100 gets the life required to be healed right ?
    So if the user starts the script when he doesn't have a full hp bar, it'll be x% of his HP when he starts the script. For example if i started the script when i was at 1HP then the potions will never be used (at 100% yes... but it's so useless to do that)
    That's not better to get the Max Health instead of the current HP at launching ?
     
    Code:
    GetMaxHealth(Handle, pid)
    { 
    	Global MaxHealth
    	Base := getProcessBaseAddress(Handle)
    	pointerBase := base + 0x0092C524 ;Same adress for Health and Max Health
    	z1 := ReadMemory(pointerBase, pid)
    	z2 := ReadMemory(z1 + 0x98, pid)
    	z3 := ReadMemory(z2 + 0x28, pid)
    	z4 := ReadMemory(z3 + 0x10, pid)
    	z5 := z4 + 0xc8 ;Just a different offset
    	MaxHealth := ReadMemory(z5, pid) ;And you can use this variable to fix the issue with the "not full hp bar"
    }

  17. #14
    gasag's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    My Mood
    Yeehaw
    Well it's not working anymore

Similar Threads

  1. Trove auto follow AHK
    By malakakos in forum Trove Discussions & Help
    Replies: 7
    Last Post: 07-27-2015, 02:30 PM
  2. Trove Auto Potion
    By Vitooooo in forum Trove Discussions & Help
    Replies: 6
    Last Post: 04-28-2015, 02:37 PM
  3. Nilly's - Auto-pot / Auto-Special if Priest / Auto-Nexus - Code
    By nilly in forum Realm of the Mad God Tutorials & Source Code
    Replies: 55
    Last Post: 05-02-2014, 11:08 PM
  4. auto pot nexus
    By Hurcan in forum Realm of the Mad God Help & Requests
    Replies: 3
    Last Post: 04-01-2014, 10:56 AM
  5. Looking for someone to code me a auto pots sorter for Rotmg
    By gamerlem101 in forum Realm of the Mad God Discussions
    Replies: 2
    Last Post: 06-16-2013, 06:42 AM

Tags for this Thread