Code:
#SingleInstance force
#Persistent
SetBatchLines -1
SplashTextOn, 500,25, mpPassiveFishingBot, Initializing and updating pointers, please wait...
SetWorkingDir %A_ScriptDir%
Active := Object()
global Ver:=3.0
global _Version:=1
global _Pointer:="0x0"
global _PTSPointer:="0x0"
global _wOffset:="0x0"
global _lOffset:="0x0"
global _cOffset:="0x0"
global _wStateOffset:="0x0"
global _lStateOffset:="0x0"
global _cStateOffset:="0x0"
global iniFile := A_ScriptDir . "/config.ini"
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, _wStateOffset, %iniFile%, Global, _wStateOffset
IniRead, _lStateOffset, %iniFile%, Global, _lStateOffset
IniRead, _cStateOffset, %iniFile%, Global, _cStateOffset
}
url := "https://dl.dropb" + "oxuserconten*****m/u/52517919/MpFishingPointer.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]
global _wStateOffset:=Contents[6]
global _lStateOffset:=Contents[7]
global _cStateOffset:=Contents[8]
IniWrite, %_wOffset%, %iniFile%, Global, _wOffset
IniWrite, %_lOffset%, %iniFile%, Global, _lOffset
IniWrite, %_cOffset%, %iniFile%, Global, _cOffset
IniWrite, %_wStateOffset%, %iniFile%, Global, _wStateOffset
IniWrite, %_lStateOffset%, %iniFile%, Global, _lStateOffset
IniWrite, %_cStateOffset%, %iniFile%, Global, _cStateOffset
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 "`nWater state offset : " _wStateOffset "`nLava state offset : "_lStateOffset "`nChocolate state offset : " _cStateOffset
}
Gui, 1:New
Gui 1:-Resize -MinimizeBox
Gui, 1:Add, ListView, Checked -Hdr grid -ReadOnly -LV0x10 w1100, | | | | | | | | | | | | | | | | |
Gui, 1:Add, Button, gInfo w1100, &Info
Gui, 2:New
Gui 2:-Resize -MinimizeBox
Gui, 2:Add, Text,, Current version : %Ver%`n`nPointer : %_Pointer%`nWater offsets : %_wOffset%`nLava offset : %_lOffset%`nChocolate offset : %_cOffset%`nWater state offsets : %_wStateOffset%`nLava state offset : %_lStateOffset%`nChocolate state offset : %_cStateOffset%
Gui, 2:Add, Button, gDebug , &Copy Debug Data
SplashTextOff
if (Contents[9] > Ver){
num := Contents[10]
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, UpdateGui, 999
TrayTip ,mpPassiveFishingBot, Bot started ! Press "f" on water/lava/chocolate !
return
#IfWinActive, Trove
^f::
WinGet, p, pid, A
WinGet, pName, ProcessName, ahk_pid %p%
if(pName = "Trove.exe"){
New := Object()
found := false
for i, C in Active{
if (C[1] = p)
found := true
else
New.Insert(C)
}
if (!found){
NC := [p,0,9]
New.Insert(NC)
TrayTip ,mpPassiveFishingBot, Bot started on %p%!
}else{
TrayTip ,mpPassiveFishingBot, Bot stopped on %p%!
}
Active := New
}
return
Scan:
for i, C in Active{
C[3] ++
if (C[3]>5){
pid := C[1]
WinGet, Handle, ID, ahk_pid %pid%
Base := getProcessBaseAddress(Handle)
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){
C[2] ++
C[3] := 3
ControlSend, , f, ahk_pid %pid%
}else{
wStateAddress := GetAddress(pid, Base, _Pointer, _wStateOffset)
lStateAddress := GetAddress(pid, Base, _Pointer, _lStateOffset)
cStateAddress := GetAddress(pid, Base, _Pointer, _cStateOffset)
wStateValue := ReadMemory(wStateAddress, pid)
lStateValue := ReadMemory(lStateAddress, pid)
cStateValue := ReadMemory(cStateAddress, pid)
if (cStateValue = 0 && lStateValue = 0 && wStateValue = 0){
C[3] := 0
ControlSend, , f, ahk_pid %pid%
}
}
}
}
return
Info:
Gui, 2:Show, , Info
return
Debug:
message := "[SP" . "OILER=Debug][CO" . "DE]Version = " . Ver . "`nPointer = " . _Pointer . "`nWater Offsets = " . _wOffset . "`nLava Offsets = " . _lOffset . "`nChocolate Offsets = " . _cOffset . "`nWater State Offsets = " . _wStateOffset . "`nLava State Offsets = " . _lStateOffset . "`nChocolate State Offsets = " . _cStateOffset
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
{
Handle := l%a_index%
WinGet, pid, PID, ahk_id %Handle%
Base := getProcessBaseAddress(Handle)
wAddress := GetAddress(pid, Base, _Pointer, _wOffset)
lAddress := GetAddress(pid, Base, _Pointer, _lOffset)
cAddress := GetAddress(pid, Base, _Pointer, _cOffset)
wStateAddress := GetAddress(pid, Base, _Pointer, _wStateOffset)
lStateAddress := GetAddress(pid, Base, _Pointer, _lStateOffset)
cStateAddress := GetAddress(pid, Base, _Pointer, _cStateOffset)
message := message . "`nClient" . i . ":`nPID = " . pid . "`nHandle = " . Handle . "`nBase = " . Base . "`nWater Address = " . wAddress . "`nLava Address = " . lAddress . "`nChocolate Address = " . cAddress . "`nWater State Address = " . wStateAddress . "`nLava State Address = " . lStateAddress . "`nChocolate State Address = " . cStateAddress
}
message := message . "[/CO" . "DE][/SPO" . "ILER]"
clipboard = %message%
MsgBox, Debug data copied to clipboard
return
GuiClose:
ExitApp
UpdateGui:
LV_DELETE()
LV_Add("", "Window PID","Handle","Base Address","Water Adress","V","Lava Adress","V","Chocolate Adress","V","Water State Adress","V","Lava State Adress","V","Chocolate State Adress","V", "Reeled", "Timer")
WinGet, l, list, ahk_exe Trove.exe
Loop %l%
{
Handle := l%a_index%
WinGet, pid, PID, ahk_id %Handle%
Base := getProcessBaseAddress(Handle)
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)
wStateAddress := GetAddress(pid, Base, _Pointer, _wStateOffset)
lStateAddress := GetAddress(pid, Base, _Pointer, _lStateOffset)
cStateAddress := GetAddress(pid, Base, _Pointer, _cStateOffset)
wStateValue := ReadMemory(wStateAddress, pid)
lStateValue := ReadMemory(lStateAddress, pid)
cStateValue := ReadMemory(cStateAddress, pid)
found := false
for i, C in Active{
p := C[1]
if (p = pid){
found := true
LV_Add("Check", PID, Handle, Base, wAddress, wValue, lAddress, lValue, cAddress, cValue, wStateAddress, wStateValue, lStateAddress, lStateValue, cStateAddress, cStateValue, C[2], C[3])
}
}
if (!found)
LV_Add("", PID, Handle, Base, wAddress, wValue, lAddress, lValue, cAddress, cValue, wStateAddress, wStateValue, lStateAddress, lStateValue, cStateAddress, cStateValue,0,0)
}
LV_ModifyCol()
return
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
}