Code:
#SingleInstance force
#Persistent
SplashTextOn, 500,25, mpFollowingBots, Initializing and updating pointers, please wait...
SetWorkingDir %A_ScriptDir%
global Ver:=1.0
global _Version:=0
global _Pointer:="0x0"
global _xOffset:="0x0"
global _yOffset:="0x0"
global _zOffset:="0x0"
global iniFile := A_ScriptDir . "/config.ini"
global fight := False
global KB := true
If (FileExist(iniFile)){
IniRead, _Version, %iniFile%, Global, _Version
IniRead, _Pointer, %iniFile%, Global, _Pointer
IniRead, _xOffset, %iniFile%, Global, _xOffset
IniRead, _yOffset, %iniFile%, Global, _yOffset
IniRead, _zOffset, %iniFile%, Global, _zOffset
IniRead, _zOffset, %iniFile%, Global, _zOffset
IniRead, KB, %iniFile%, Global, QWERTY
}
url := "https://dl.dropb" + "oxuserconten*****m/u/52517919/MpFollowingBotsPointer.txt"
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", url)
WebRequest.Send()
Contents := StrSplit(WebRequest.ResponseText, "$")
if (Contents[1] > _Version){
global _Version:=Contents[1]
global _Pointer:=Contents[2]
global _xOffset:=Contents[3]
global _yOffset:=Contents[4]
global _zOffset:=Contents[5]
IniWrite, %_Version%, %iniFile%, Global, _Version
IniWrite, %_Pointer%, %iniFile%, Global, _Pointer
IniWrite, %_xOffset%, %iniFile%, Global, _xOffset
IniWrite, %_yOffset%, %iniFile%, Global, _yOffset
IniWrite, %_zOffset%, %iniFile%, Global, _zOffset
TrayTip ,mpFollowingBots, % "Values updated to :`nPointer : " _Pointer "`nX offset : " _xOffset "`nY offset : "_yOffset "`nZ offset : " _zOffset
}
global X := 0
global Y := 0
global Z := 0
global Mp := -1
Gui, 1:New
Gui 1:-Resize -MinimizeBox
Gui, 1:Add, Checkbox, Checked%KB% vKeyboard, Checked : QWERTY/ Unchecked : AZERTY
Gui, 1:Add, ListView, Checked -ReadOnly -LV0x10 w700, Window pid|Handle|Base Address|X Adress|X Value|Y Adress|Y Value|Z Adress|Z Value|Message
SplashTextOff
if (Contents[6] > Ver){
num := Contents[7]
url = https://www.mpgh.net/forum/showthread.php?t=%num%
MsgBox, 4,, New version available, go to MPGH topic ? (press Yes or No)
IfMsgBox Yes
Run %url%
}
Gui, 1:Show,,mpFollowingBots
SetTimer, UpdateGui, 999
TrayTip ,mpFollowingBots, Bot started !`nPress numPad0 to select your main account !`nEnsure others are facing SOUTH !
return
Numpad0::
WinGet, p, pid, A
WinGet, process, ProcessName, ahk_pid %p%
IF (process = "Trove.exe"){
IF (Mp <> p){
Mp := p
TrayTip ,mpFollowingBots, % "New main account set : " Mp
SetTimer, Move, 199
SetTimer, Collect, 999
}ELSE{
Mp := -1
TrayTip ,mpFollowingBots, Bot Paused
SetTimer, Move, Off
SetTimer, Collect, Off
SetTimer, Fighting, Off
Sleep, 999
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
ControlSend, , {w up}{a up}{z up}{q up}{s up}{d up}, % "ahk_id " l%a_index%
}
}
return
Numpad1::
fight := !fight
IF (fight){
SetTimer, Fighting, 999
TrayTip ,mpFollowingBots, Fighting Mode
}
ELSE{
SetTimer, Fighting, Off
TrayTip ,mpFollowingBots, Travelling Mode
WinGet, l, list, ahk_exe Trove.exe
Loop %l%{
WinGet, p, pid,% "ahk_id " l%a_index%
IF (p != Mp)
IF (KB)
ControlSend, , z, ahk_pid %p%
ELSE
ControlSend, , w, ahk_pid %p%
}
}
return
Move:
WinGet, l, list, ahk_exe Trove.exe
Loop %l%{
WinGet, p, pid,% "ahk_id " l%a_index%
BaseAddress := getProcessBaseAddress(l%a_index%)
xAddress := GetAddress(p, BaseAddress, _Pointer, _xOffset)
yAddress := GetAddress(p, BaseAddress, _Pointer, _yOffset)
zAddress := GetAddress(p, BaseAddress, _Pointer, _zOffset)
xValue := ReadMemory(xAddress, p)
yValue := ReadMemory(yAddress, p)
zValue := ReadMemory(zAddress, p)
IF (4294967295 - xValue < xValue)
xValue := xValue - 4294967295
IF (4294967295 - yValue < yValue)
yValue := yValue - 4294967295
IF (4294967295 - zValue < zValue)
zValue := zValue - 4294967295
IF (p == Mp){
X := xValue
Y := yValue
Z := zValue
}ELSE{
dX := X - xValue
dY := Y - yValue
dZ := Z - zValue
IF (dX > 1)
IF (KB)
ControlSend, , {d up}{a down}, ahk_pid %p%
ELSE
ControlSend, , {d up}{q down}, ahk_pid %p%
ELSE IF (dX < -1)
IF (KB)
ControlSend, , {a up}{d down}, ahk_pid %p%
ELSE
ControlSend, , {q up}{d down}, ahk_pid %p%
ELSE
ControlSend, , {q up}{d up}{a up}, ahk_pid %p%
IF (dZ > 1)
IF (KB)
ControlSend, , {s up}{w down}, ahk_pid %p%
ELSE
ControlSend, , {s up}{z down}, ahk_pid %p%
ELSE IF (dZ < -1)
IF (KB)
ControlSend, , {w up}{s down}, ahk_pid %p%
ELSE
ControlSend, , {z up}{s down}, ahk_pid %p%
ELSE
ControlSend, , {w up}{s up}{z up}, ahk_pid %p%
IF (dY > 1)
ControlSend, , {Space}, ahk_pid %p%
Random,r ,1,10
IF (r = 5)
ControlSend, , {w up}{a up}{z up}{q up}{s up}{d up}{Space}, ahk_pid %p%
}
}
return
Collect:
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
{
WinGet, p, pid,% "ahk_id " l%a_index%
IF (p != Mp){
ControlSend, , {e down}, ahk_pid %p%
Random, r, 999, 1999
Sleep, %r%
ControlSend, , {e up},ahk_pid %p%
}
}
return
Fighting:
WinGet, l, list, ahk_exe Trove.exe
Loop %l%{
WinGet, p, pid,% "ahk_id " l%a_index%
IF (p != Mp)
ControlSend, , {vk31}{vk32}, ahk_pid %p%
}
return
UpdateGui:
Gui, 1:Default
LV_DELETE()
WinGet, l, list, ahk_exe Trove.exe
Loop %l%{
WinGet, p, pid,% "ahk_id " l%a_index%
BaseAddress := getProcessBaseAddress(l%a_index%)
xAddress := GetAddress(p, BaseAddress, _Pointer, _xOffset)
yAddress := GetAddress(p, BaseAddress, _Pointer, _yOffset)
zAddress := GetAddress(p, BaseAddress, _Pointer, _zOffset)
xValue := ReadMemory(xAddress, p)
yValue := ReadMemory(yAddress, p)
zValue := ReadMemory(zAddress, p)
BaseAddressHex := Hex(BaseAddress)
xAddressHex := Hex(xAddress)
yAddressHex := Hex(yAddress)
zAddressHex := Hex(zAddress)
IF (Mp != -1 && (dX+dY+dZ)>30){
Message := "I'm lost"
TrayTip,
}ELSE IF(fight)
Message := "Fight mode"
ELSE
Message := "Travelling mode"
IF (p = Mp)
LV_Add("Check", l%a_index%, p, BaseAddressHex, xAddressHex, xValue, yAddressHex, yValue, zAddressHex, zValue, "Main Account")
ELSE
LV_Add("", l%a_index%, p, BaseAddressHex, xAddressHex, xValue, yAddressHex, yValue, zAddressHex, zValue, Message)
}
GuiControlGet, KB,, Keyboard
return
GuiClose:
IniWrite, %KB%, %iniFile%, Global, QWERTY
ExitApp
Hex(n){
VarSetCapacity(S,66,0)
DllCall("msvcrt\_i64tow", "Int64",n, "Str",S, "UInt",16, "CDECL")
Return S
}
getProcessBaseAddress(Handle){
Return DllCall( A_PtrSize = 4 ? "GetWindowLong": "GetWindowLongPtr", "Ptr", Handle, "Int", -6, "Int64")
}
GetAddress(PID, Base, Address, Offset){
p := ReadMemory(base + Address,PID)
OffsetSplit := StrSplit(Offset, "+")
OffsetCount := OffsetSplit.MaxIndex()
Loop, %OffsetCount%{
IF (a_index = OffsetCount)
p := p + OffsetSplit[a_index]
ELSE
p := ReadMemory(p + OffsetSplit[a_index],PID)
}
Return p
}
ReadMemory(MADDRESS, pid){
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
Return result
}