Code:
#SingleInstance force
#Persistent
SplashTextOn, 500,25, mpPassiveFishingBot, Initializing and updating pointers, please wait...
SetWorkingDir %A_ScriptDir%
Reeled := Object()
Queue := Object()
global Ver:=2.2
global _Motd:=""
global _Version:=1
global _PTSVersion:=1
global _Pointer:="0x0"
global _PTSPointer:="0x0"
global _wOffset:="0x0"
global _lOffset:="0x0"
global _cOffset:="0x0"
global _PTSwOffset:="0x0"
global _PTSlOffset:="0x0"
global _PTScOffset:="0x0"
global iniFile := A_ScriptDir . "/config.ini"
global rld := 0
If (FileExist(iniFile)){
IniRead, _Version, %iniFile%, Global, _Version
IniRead, _Pointer, %iniFile%, Global, _Pointer
IniRead, _wOffset, %iniFile%, Global, _wOffset
IniRead, _lOffset, %iniFile%, Global, _lOffset
IniRead, _cOffset, %iniFile%, Global, _cOffset
IniRead, _PTSVersion, %iniFile%, Global, _PTSVersion
IniRead, _PTSPointer, %iniFile%, Global, _PTSPointer
IniRead, _PTSwOffset, %iniFile%, Global, _PTSwOffset
IniRead, _PTSlOffset, %iniFile%, Global, _PTSlOffset
IniRead, _PTScOffset, %iniFile%, Global, _PTScOffset
IniRead, _Motd, %iniFile%, Global, _Motd
}
url := "https://dl.dropb" + "oxuserconten*****m/u/52517919/MpFishingBotPointer.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 _wOffset:=Contents[3]
global _lOffset:=Contents[4]
global _cOffset:=Contents[5]
IniWrite, %_wOffset%, %iniFile%, Global, _wOffset
IniWrite, %_lOffset%, %iniFile%, Global, _lOffset
IniWrite, %_cOffset%, %iniFile%, Global, _cOffset
IniWrite, %_Version%, %iniFile%, Global, _Version
IniWrite, %_Pointer%, %iniFile%, Global, _Pointer
TrayTip ,mpPassiveFishingBot, % "Values updated to :`nPointer : " _Pointer "`nWater offset : " _wOffset "`nLava offset : "_lOffset "`nChocolate offset : " _cOffset
Sleep, 10
}
if (Contents[9] > _PTSVersion){
global _PTSVersion:=Contents[9]
global _PTSPointer:=Contents[10]
global _PTSwOffset:=Contents[11]
global _PTSlOffset:=Contents[12]
global _PTScOffset:=Contents[13]
IniWrite, %_PTSVersion%, %iniFile%, Global, _PTSVersion
IniWrite, %_PTSPointer%, %iniFile%, Global, _PTSPointer
IniWrite, %_PTSwOffset%, %iniFile%, Global, _PTSwOffset
IniWrite, %_PTSlOffset%, %iniFile%, Global, _PTSlOffset
IniWrite, %_PTScOffset%, %iniFile%, Global, _PTScOffset
TrayTip ,mpPassiveFishingBot, % "PTS Values updated to :`nPointer : " _PTSPointer "`nWater offset : " _PTSwOffset "`nLava offset : "_PTSlOffset "`nChocolate offset : " _PTScOffset
Sleep, 10
}
global _newMotd:=Contents[8]
if (_Motd != _newMotd){
TrayTip ,mpPassiveFishingBot, %_newMotd%
Sleep, 10
}
IniWrite, %_newMotd%, %iniFile%, Global, _Motd
Gui, 1:New
Gui 1:-Resize -MinimizeBox
Gui, 1:Add, Text,, Current version : %Ver%`n`nPointer : %_Pointer%`nWater offsets : %_wOffset%`nLava offset : %_lOffset%`nChocolate offset : %_cOffset%`n`nPTS Pointer : %_PTSPointer%`nPTS Water offsets : %_PTSwOffset%`nPTS Lava offset : %_PTSlOffset%`nPTS Chocolate offset : %_PTScOffset%
Gui, 1:Add, Text, vAccounts w200
Gui, 1:Add, Text, vReeled w200
Gui, 1:Add, Checkbox, vTry, PTS
Gui, 1:Add, Button, gDebug , &Debug
Gui, 2:New
Gui 2:-Resize -MinimizeBox
Gui, 2:Add, ListView, w700, Window PID|Handle|Base Address|Water Adress|Water Value|Lava Adress|Lava Value|Chocolate Adress|Chocolate Value
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,,mpPassiveFishingBot
SetTimer, Scan, 999
SetTimer, Relaunch, 1999
SetTimer, UpdateGui, 250
TrayTip ,mpPassiveFishingBot, Bot started ! Press "f" on water/lava/chocolate !
return
Scan:
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
{
Handle := l%a_index%
WinGet, pid, PID, ahk_id %Handle%
Base := getProcessBaseAddress(Handle)
If PTS = 1
{
wAddress := GetAddress(pid, Base, _PTSPointer, _PTSwOffset)
lAddress := GetAddress(pid, Base, _PTSPointer, _PTSlOffset)
cAddress := GetAddress(pid, Base, _PTSPointer, _PTScOffset)
}Else{
wAddress := GetAddress(pid, Base, _Pointer, _wOffset)
lAddress := GetAddress(pid, Base, _Pointer, _lOffset)
cAddress := GetAddress(pid, Base, _Pointer, _cOffset)
}
wValue := ReadMemory(wAddress, pid)
lValue := ReadMemory(lAddress, pid)
cValue := ReadMemory(cAddress, pid)
if (cValue=1||lValue=1||wValue=1){
found := 0
for i, p in Reeled{
if (p=pid)
found := 1
}
for i, p in Queue{
if (p=pid)
found := 1
}
If (found = 0){
ControlSend, , {f down}, ahk_pid %pid%
Sleep, 90
ControlSend, , {f up}, ahk_pid %pid%
rld ++
Reeled.Insert(pid)
}
}
}
return
Relaunch:
Queue := Reeled
Reeled := Object()
Sleep, 2000
for i, p in Queue{
ControlSend, , {f down}, ahk_pid %p%
Sleep, 90
ControlSend, , {f up}, ahk_pid %p%
}
return
UpdateGui:
C := 0
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
C ++
GuiControl, 1:, Accounts, Active accounts : %C%
GuiControl, 1:, Reeled, Fish reeled : %rld%
GuiControlGet, PTS,, Try
return
GuiClose:
ExitApp
Debug:
SetTimer, UpdateDebugGui, 250
Gui, 2:Show, , mpPassiveFishingBotDebug
return
UpdateDebugGui:
Gui, 2:Default
LV_DELETE()
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
{
Handle := l%a_index%
WinGet, pid, PID, ahk_id %Handle%
BaseAddress := getProcessBaseAddress(Handle)
If PTS = 1
{
wAddress := GetAddress(pid, BaseAddress, _PTSPointer, _PTSwOffset)
lAddress := GetAddress(pid, BaseAddress, _PTSPointer, _PTSlOffset)
cAddress := GetAddress(pid, BaseAddress, _PTSPointer, _PTScOffset)
}Else{
wAddress := GetAddress(pid, BaseAddress, _Pointer, _wOffset)
lAddress := GetAddress(pid, BaseAddress, _Pointer, _lOffset)
cAddress := GetAddress(pid, BaseAddress, _Pointer, _cOffset)
}
wValue := ReadMemory(wAddress, pid)
lValue := ReadMemory(lAddress, pid)
cValue := ReadMemory(cAddress, pid)
BaseAddressHex := Hex(BaseAddress)
wAddressHex := Hex(wAddress)
lAddressHex := Hex(lAddress)
cAddressHex := Hex(cAddress)
LV_Add("", Handle, PID, BaseAddressHex, wAddressHex, wValue, lAddressHex, lValue, cAddressHex, cValue)
}
return
2GuiClose:
SetTimer, UpdateDebugGui, Off
Gui, 2:Hide
return
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
}