SmileOutdatedTrove Auto-Pot v1.0.0

Posts 114 of 14 · Page 1 of 1
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)

 
"Change Log"

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"

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
}
Nice job, Jake.
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.
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
I'm sorry, but your sentence did not make sense to me..
It would be great if you can add a video for it.
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.
can someone make this an app?
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
}
the potion script stopped working, could update?
UPDATE: V1.0.1


 
Change Log

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


 
Code

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
}
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 ?
 
A GetMaxHealth Function
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"
}
Well it's not working anymore
Posts 114 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?