Code:
#SingleInstance force
#Persistent
SetBatchLines -1
SplashTextOn, 500,25, mpPassiveFishingBot, Initializing and updating pointers, please wait...
SetWorkingDir %A_ScriptDir%
Active := Object()
global Ver:=3.1
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 w250, | | | |
Gui, 1:Add, Button, gInfo w250, &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, 250
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,0,0,"Detecting"]
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{
if (C[4] = 0)
{
pid := C[1]
WinGet, Handle, ID, ahk_pid %pid%
Base := getProcessBaseAddress(Handle)
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 (wStateValue = 1){
C[4] := GetAddress(pid, Base, _Pointer, _wOffset)
C[5] := wStateAddress
C[6] := "Water"
}else if (lStateValue = 1){
C[4] := GetAddress(pid, Base, _Pointer, _lOffset)
C[5] := lStateAddress
C[6] := "Lava"
}else if (cStateValue = 1){
C[4] := GetAddress(pid, Base, _Pointer, _cOffset)
C[5] := cStateAddress
C[6] := "Chocolate"
}else if (C[3]>5){
ControlSend, , f, ahk_pid %pid%
C[3] := 0
}
}else if (C[3]>5)
if (ReadMemory(C[4], C[1])=1){
C[2] ++
C[3] := 3
ControlSend, , f,% "ahk_pid " C[1]
}else
if (ReadMemory(C[5], C[1]) = 0){
C[3] := 0
ControlSend, , f, % "ahk_pid " C[1]
}
}
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%{
WinGet, pid, PID, % "ahk_id " l%a_index%
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:
for i, C in Active{
C[3] ++
}
LV_DELETE()
LV_Add("", "Window PID","Liquid","Reeled","Timer")
WinGet, l, list, ahk_exe Trove.exe
loop %l%{
Handle := l%a_index%
WinGet, pid, PID, ahk_id %Handle%
found := false
for i, C in Active{
p := C[1]
if (p = pid){
found := true
LV_Add("Check",C[1],C[6],C[2],C[3])
}
}
if (!found)
LV_Add("", PID, 0,0,"Not Fishing")
}
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
}