Code:
#SingleInstance force
#IfWinActive,Trove
#NoEnv
#Persistent
SendMode Input
SetBatchLines -1
SplashTextOn,500,25,mpPassiveFishingBot,Initializing and updating pointer,please wait...
if NOT A_IsAdmin{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
Process,Exist,TeamViewer.exe
If (ErrorLevel)
Msgbox,% "Teamviewer is currenly running. This is a known program to cause issues with the fishbot. Please close it or disable quick connect feature. If issues still happen try to uninstall it."
SetWorkingDir %A_ScriptDir%
Active:=Object()
global ver:=3.3
global dataVer:=1
global ptr:="0x0"
global wOfts:="0x0"
global lOfts:="0x0"
global cOfts:="0x0"
global wSOfts:="0x0"
global lSOfts:="0x0"
global cSOfts:="0x0"
global iniFile:=A_ScriptDir "/config" ver ".ini"
if (FileExist(iniFile)){
IniRead,dataVer,%iniFile%,Global,dataVer
IniRead,ptr,%iniFile%,Global,ptr
IniRead,wOfts,%iniFile%,Global,wOfts
IniRead,lOfts,%iniFile%,Global,lOfts
IniRead,cOfts,%iniFile%,Global,cOfts
IniRead,wSOfts,%iniFile%,Global,wSOfts
IniRead,lSOfts,%iniFile%,Global,lSOfts
IniRead,cSOfts,%iniFile%,Global,cSOfts
}
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]>dataVer){
global dataVer:=Contents[1]
global ptr:=Contents[2]
global wOfts:=Contents[3]
global lOfts:=Contents[4]
global cOfts:=Contents[5]
global wSOfts:=Contents[6]
global lSOfts:=Contents[7]
global cSOfts:=Contents[8]
IniWrite,%wOfts%,%iniFile%,Global,wOfts
IniWrite,%lOfts%,%iniFile%,Global,lOfts
IniWrite,%cOfts%,%iniFile%,Global,cOfts
IniWrite,%wSOfts%,%iniFile%,Global,wSOfts
IniWrite,%lSOfts%,%iniFile%,Global,lSOfts
IniWrite,%cSOfts%,%iniFile%,Global,cSOfts
IniWrite,%dataVer%,%iniFile%,Global,dataVer
IniWrite,%ptr%,%iniFile%,Global,ptr
TrayTip ,mpPassiveFishingBot,% "Values updated to :`nPointer : " ptr "`nWater offset : " wOfts "`nLava offset : " lOfts "`nChocolate offset : " cOfts "`nWater state offset : " wSOfts "`nLava state offset : " lSOfts "`nChocolate state offset : " cSOfts
}
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 : " ptr "`nWater offsets : " wOfts "`nLava offset : " lOfts "`nChocolate offset : " cOfts "`nWater state offsets : " wSOfts "`nLava state offset : " lSOfts "`nChocolate state offset : " cSOfts
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,Update,999
TrayTip,mpPassiveFishingBot,Bot started ! Press "Ctrl + f" on water/lava/chocolate !
return
^f::
WinGet,p,pid,A
WinGet,n,ProcessName,ahk_pid %p%
if(n="Trove.exe"){
nActive:=Object()
f:=false
for i,C in Active{
if (C[1]=p)
f:=true
else
nActive.Insert(C)
}
if (!f){
NC:=[p,0,9,0,0,"Detecting"]
nActive.Insert(NC)
TrayTip,mpPassiveFishingBot,Bot started on %p%!
}else
TrayTip,mpPassiveFishingBot,Bot stopped on %p%!
Active:=nActive
}
return
Scan:
for i,C in Active{
if (C[4]=0){
pid:=C[1]
WinGet,h,ID,ahk_pid %pid%
Base:=getProcessBaseAddress(h)
wSAdr:=GetAddress(pid,Base,ptr,wSOfts)
lSAdr:=GetAddress(pid,Base,ptr,lSOfts)
cSAdr:=GetAddress(pid,Base,ptr,cSOfts)
if (ReadMemory(wSAdr,pid)=1){
C[4]:=GetAddress(pid,Base,ptr,wOfts)
C[5]:=wSAdr
C[6]:="Water"
}else if (ReadMemory(lSAdr,pid)=1){
C[4]:=GetAddress(pid,Base,ptr,lOfts)
C[5]:=lSAdr
C[6]:="Lava"
}else if (ReadMemory(cSAdr,pid)=1){
C[4]:=GetAddress(pid,Base,ptr,cOfts)
C[5]:=cSAdr
C[6]:="Chocolate"
}else if (C[3]>5){
SendF(pid)
C[3]:=0
}
}else
if (C[3]>10 && ReadMemory(C[4],C[1])=1){
C[2] ++
C[3]:=0
SendF(C[1])
}else if (C[3]>5 && ReadMemory(C[5],C[1])=0){
SendF(C[1])
C[3]:=0
}
}
return
Info:
Gui,2:Show,,Info
return
Debug:
m:="[SP" "OILER=Debug][CO" "DE]version=" ver "`nPointer=" ptr "`nWater Offsets=" wOfts "`nLava Offsets=" lOfts "`nChocolate Offsets=" cOfts "`nWater State Offsets=" wSOfts "`nLava State Offsets=" lSOfts "`nChocolate State Offsets=" cSOfts
WinGet,l,list,ahk_exe Trove.exe
loop %l%{
WinGet,p,pid,% "ahk_id " l%a_index%
Base:=getProcessBaseAddress(h)
wAdr:=GetAddress(p,Base,ptr,wOfts)
lAdr:=GetAddress(p,Base,ptr,lOfts)
cAdr:=GetAddress(p,Base,ptr,cOfts)
wSAdr:=GetAddress(p,Base,ptr,wSOfts)
lSAdr:=GetAddress(p,Base,ptr,lSOfts)
cSAdr:=GetAddress(p,Base,ptr,cSOfts)
m:=m "`nClient" i ":`np=" p "`nHandle=" h "`nBase=" Base "`nWater Address=" wAdr "`nLava Address=" lAdr "`nChocolate Address=" cAdr "`nWater State Address=" wSAdr "`nLava State Address=" lSAdr "`nChocolate State Address=" cSAdr
}
m:=m "[/CO" "DE][/SPO" "ILER]"
clipboard=%m%
MsgBox,Debug data copied to clipboard
return
GuiClose:
ExitApp
Update:
for i,C in Active{
C[3] ++
}
LV_DELETE()
LV_Add("","Window PID","Liquid","Reeled","Timer")
WinGet,l,list,ahk_exe Trove.exe
WinGet,current,pid,A
WinGet,n,ProcessName,ahk_pid %current%
if(n !="Trove.exe")
ToolTip
loop %l%{
h:=l%a_index%
WinGet,pid,PID,ahk_id %h%
found:=false
for i,C in Active
if (C[1]=pid){
found:=true
LV_Add("Check",C[1],C[6],C[2],C[3])
if (current=pid)
ToolTip,% "Fishing`nPid : " C[1] "`nLiquid : " C[6] "`nReeled : " C[2] "`nTimer : " C[3],0,0
}
if (!found){
LV_Add("",PID,"Not fishing",0,0)
if (current=pid)
ToolTip,% "Not fishing`nPid : " pid,0,0
}
}
LV_ModifyCol()
return
SendF(PID){
ControlSend,,{f down},ahk_pid %pid%
Sleep,90
ControlSend,,{f up},ahk_pid %pid%
}
getProcessBaseAddress(h){
return DllCall( A_PtrSize=4 ? "GetWindowLong": "GetWindowLongPtr","Ptr",h,"Int",-6,"Int64")
}
GetAddress(PID,Base,Adr,Ofts){
p:=ReadMemory(base + Adr,PID)
OftsSpl:=StrSplit(Ofts,"+")
OftsCt:=OftsSpl.MaxIndex()
loop,%OftsCt%{
if (a_index=OftsCt)
p:=p + OftsSpl[a_index]
else
p:=ReadMemory(p + OftsSpl[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
}