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!)
Exit Script: Alt+NumPad7
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.
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+NumPad9Exit 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
}

