Code:
#SingleInstance force
#IfWinActive,Trove
#NoEnv
#Persistent
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
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."
SplashTextOn,500,25,mpFollowingBots,Initializing and updating pointer and offsets, please wait...
global ver:=1.2
global dataVer:=0
global ptr:="0x0"
global xOfts:="0x0"
global yOfts:="0x0"
global zOfts:="0x0"
global mtOfts:="0x0"
global mainHK:="Numpad0"
global fghtHK:="Numpad1"
global lootHK:="Numpad2"
global fKey:="w"
global bKey:="s"
global lKey:="a"
global rKey:="d"
global spl1Key:=""
global spl2Key:=""
global mtKey:="z"
global btKey:="g"
global lootKey:="e"
global jumpKey:="Space"
global newFKey:=fKey
global newBKey:=bKey
global newRKey:=rKey
global newLKey:=lKey
global newSpl1Key:=spl1Key
global newSpl2Key:=spl2Key
global newMtKey:=mtKey
global newBtKey:=btKey
global newLootKey:=lootKey
global newJumpKey:=jumpKey
global isFght:=false
global isLoot:=false
global trvRng:=1
global fghtRng:=5
global updRate:=199
global mainX:=0
global mainY:=0
global mainZ:=0
global mainMt:=0
global mainPid:=-1
global iniFile:=A_ScriptDir "/config"ver ".ini"
If (FileExist(iniFile)){
IniRead,dataVer,%iniFile%,Global,dataVer
IniRead,ptr,%iniFile%,Global,ptr
IniRead,xOfts,%iniFile%,Global,xOfts
IniRead,yOfts,%iniFile%,Global,yOfts
IniRead,zOfts,%iniFile%,Global,zOfts
IniRead,zOfts,%iniFile%,Global,zOfts
IniRead,mtOfts,%iniFile%,Global,mtOfts
IniRead,trvRng,%iniFile%,Global,trvRng
IniRead,fghtRng,%iniFile%,Global,fghtRng
IniRead,updRate,%iniFile%,Global,updRate
IniRead,mainHK,%iniFile%,Hotkeys,mainHK,%A_Space%
IniRead,fghtHK,%iniFile%,Hotkeys,fghtHK,%A_Space%
IniRead,lootHK,%iniFile%,Hotkeys,lootHK,%A_Space%
IniRead,fKey,%iniFile%,GameKeys,fKey,%A_Space%
IniRead,bKey,%iniFile%,GameKeys,bKey,%A_Space%
IniRead,rKey,%iniFile%,GameKeys,rKey,%A_Space%
IniRead,lKey,%iniFile%,GameKeys,lKey,%A_Space%
IniRead,spl1Key,%iniFile%,GameKeys,spl1Key,%A_Space%
IniRead,spl2Key,%iniFile%,GameKeys,spl2Key,%A_Space%
IniRead,mtKey,%iniFile%,GameKeys,mtKey,%A_Space%
IniRead,btKey,%iniFile%,GameKeys,btKey,%A_Space%
IniRead,lootKey,%iniFile%,GameKeys,lootKey,%A_Space%
IniRead,jumpKey,%iniFile%,GameKeys,jumpKey,%A_Space%
}ELSE
SaveCgf()
WebRequest:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET","https://dl.dropb"+"oxuserconten*****m/u/52517919/MpFollowingPointer.txt")
WebRequest.Send()
global res:=StrSplit(WebRequest.ResponseText,"$")
if (res[1]>dataVer){
global dataVer:=res[1]
global ptr:=res[2]
global xOfts:=res[3]
global yOfts:=res[4]
global zOfts:=res[5]
global mtOfts:=res[6]
IniWrite,%dataVer%,%iniFile%,Global,dataVer
IniWrite,%ptr%,%iniFile%,Global,ptr
IniWrite,%xOfts%,%iniFile%,Global,xOfts
IniWrite,%yOfts%,%iniFile%,Global,yOfts
IniWrite,%zOfts%,%iniFile%,Global,zOfts
IniWrite,%mtOfts%,%iniFile%,Global,mtOfts
TrayTip,mpFollowingBots,% "Values updated to :`nPointer : "ptr "`nX offsets : "xOfts "`nY offsets : "yOfts "`nZ offsets : "zOfts "`nMount offsets"mtOfts
}
Gui 1:-Resize -MinimizeBox
Gui,1:Add,ListView,-Hdr Checked grid -ReadOnly -LV0x10 x0 y0 h100 w400,| | | | | |
Gui,1:Add,Button,x0 y100 h20 w200 gConfig,&Config
Gui,1:Add,Button,x200 y100 h20 w200 gInfo,&Info
Gui 2:-Resize -MinimizeBox
Gui,2:Add,Text,x0 y0,Hotkeys :
Gui,2:Add,Text,x0 y25,Main hotkey :
Gui,2:Add,Hotkey,x100 y25 gAssignMain vnewMainHK,%mainHK%
Gui,2:Add,Text,x0 y50,Fight hotkey :
Gui,2:Add,Hotkey,x100 y50 gAssignFight vnewFghtHK,%fghtHK%
Gui,2:Add,Text,x0 y75,Auto loot hotkey :
Gui,2:Add,Hotkey,x100 y75 gAssignLoot vnewLootHK,%lootHK%
Gui,2:Add,Button,x0 y100 h20 w225 gKeys,&Game keys
Gui,2:Add,Text,x0 y150,Others :
Gui,2:Add,Text,x0 y175,Travelling range :
Gui,2:Add,Text,x90 y175,0
Gui,2:Add,Slider,x100 y175 w100 Range0-10 ToolTip vnewTraRng gTraRange,%trvRng%
Gui,2:Add,Text,x200 y175,10
Gui,2:Add,Text,x0 y200,Fighting range :
Gui,2:Add,Text,x90 y200,0
Gui,2:Add,Slider,x100 y200 w100 Range0-10 ToolTip vnewFghtRng gFghtRange,%fghtRng%
Gui,2:Add,Text,x200 y200,10
Gui,2:Add,Text,x0 y225,Update rate (ms) :
Gui,2:Add,Edit,x100 y225 vctrlUpdRate gctrlUpdRateAssign,%updRate%
Gui 3:-Resize -MinimizeBox +ToolWindow
Gui,3:Add,Text,,% "Current version : "ver "`nPointer : "ptr "`nX offsets : "xOfts "`nY offsets : "yOfts "`nZ offsets : "zOfts "`nMount offsets : "mtOfts
Gui,3:Add,Button,gDebug ,&Copy Debug Data
Gui 4:-Resize -MinimizeBox
Gui,4:Add,Text,x0 y0,Game keys :
Gui,4:Add,Text,x0 y25,Forward :
Gui,4:Add,Hotkey,x100 y25 gSaveKeys vnewFKey,%fKey%
Gui,4:Add,Text,x0 y50,Backward :
Gui,4:Add,Hotkey,x100 y50 gSaveKeys vnewBKey,%bKey%
Gui,4:Add,Text,x0 y75,Left :
Gui,4:Add,Hotkey,x100 y75 gSaveKeys vnewLKey,%lKey%
Gui,4:Add,Text,x0 y100,Right :
Gui,4:Add,Hotkey,x100 y100 gSaveKeys vnewRKey,%rKey%
Gui,4:Add,Text,x0 y125,Spell 1 :
Gui,4:Add,Hotkey,x100 y125 gSaveKeys vnewSpl1Key,%spl1Key%
Gui,4:Add,Text,x0 y150,Spell 2 :
Gui,4:Add,Hotkey,x100 y150 gSaveKeys vnewSpl2Key,%spl2Key%
Gui,4:Add,Text,x0 y175,Mount :
Gui,4:Add,Hotkey,x100 y175 gSaveKeys vnewMtKey,%mtKey%
Gui,4:Add,Text,x0 y200,Boat :
Gui,4:Add,Hotkey,x100 y200 gSaveKeys vnewBtKey,%btKey%
Gui,4:Add,Text,x0 y225,Loot :
Gui,4:Add,Hotkey,x100 y225 gSaveKeys vnewLootKey,%lootKey%
Gui,4:Add,Text,x0 y250,Jump :
Gui,4:Add,Hotkey,x100 y250 gSaveKeys vnewJumpKey,%jumpKey%
Hotkey,%mainHK%,Main,On
Hotkey,%fghtHK%,Fight,On
Hotkey,%lootHK%,Loot,On
SplashTextOff
if (res[7]>ver){
MsgBox,4,,New version available,go to MPGH topic ? (press Yes or No)
IfMsgBox Yes
Run % "https://www.mpgh.net/forum/showthread.php?t="res[8]
}
Gui,1:Show,h120 w400,mpFollowingBots
SetTimer,UpdateGui,999
TrayTip,mpFollowingBots, % "Bot started !`nPress "mainHK " to select your main account !`nEnsure others are facing SOUTH !"
return
Main:
WinGet,pid,pid,A
IF (mainPid<>pid){
global mainPid:=pid
TrayTip,mpFollowingBots,% "New main account set : "mainPid
SetTimer,Move,%updRate%
}ELSE{
global mainPid:=-1
TrayTip,mpFollowingBots,Bot Paused
SetTimer,Move,Off
SetTimer,Looting,Off
SetTimer,Fighting,Off
global isFght:=false
global isLoot:=false
Sleep,999
WinGet,l,list,ahk_exe Trove.exe
Loop %l%
ControlSend,,% "{"fKey " up}{"bKey " up}{"rKey " up}{"lKey " up}{",% "ahk_id "l%a_index%
}
return
Fight:
global isFght:=!isFght
IF (isFght){
SetTimer,Fighting,999
TrayTip,mpFollowingBots,Fight Mode
}
ELSE{
SetTimer,Fighting,Off
TrayTip,mpFollowingBots,Travelling Mode
}
return
Loot:
global isLoot:=!isLoot
IF (isLoot){
SetTimer,Looting,999
TrayTip,mpFollowingBots,Auto loot On
}
ELSE{
SetTimer,Looting,Off
TrayTip,mpFollowingBots,Auto loot Off
WinGet,l,list,ahk_exe Trove.exe
Loop %l%{
WinGet,pid,pid,% "ahk_id "l%a_index%
IF (pid!=mainPid)
ControlSend,,% "{"lootKey " up}",ahk_pid %pid%
}
}
return
Move:
WinGet,l,list,ahk_exe Trove.exe
Loop %l%{
WinGet,pid,pid,% "ahk_id "l%a_index%
base:=getProcessBaseAddress(l%a_index%)
X:=ReadMemory(GetAddress(pid,BaseAddress,ptr,xOfts),pid)
Y:=ReadMemory(GetAddress(pid,BaseAddress,ptr,yOfts),pid)
Z:=ReadMemory(GetAddress(pid,BaseAddress,ptr,zOfts),pid)
Mt:=ReadMemory(GetAddress(pid,BaseAddress,ptr,mtOfts),pid)
IF (4294967295-X<X)
X:=X-4294967295
IF (4294967295-Y<Y)
Y:=Y-4294967295
IF (4294967295-Z<Z)
Z:=Z-4294967295
IF (pid == mainPid){
global mainX:=X
global mainY:=Y
global mainZ:=Z
global mainMt:=Mt
}ELSE{
dX:=mainX-X
dY:=mainY-Y
dZ:=mainZ-Z
IF (Mt!=mainMt&&!isFght){
IF (mainMt = 1&&Mt!=1)
ControlSend,,%mtKey%,ahk_pid %pid%
ELSE IF (mainMt = 3&&Mt!=3)
ControlSend,,%btKey%,ahk_pid %pid%
}
IF ((dX>trvRng&&!isFght)||(dX>fghtRng&&isFght))
ControlSend,,% "{"rKey " up}{"lKey " down}",ahk_pid %pid%
ELSE IF ((dX<-trvRng&&!isFght)||(dX<-fghtRng&&isFght))
ControlSend,,% "{"lKey " up}{"rKey " down}",ahk_pid %pid%
ELSE
ControlSend,,% "{"rKey " up}{"lKey "up}",ahk_pid %pid%
IF ((dZ>trvRng&&!isFght)||(dZ>fghtRng&&isFght))
ControlSend,,% "{"bKey " up}{"fKey " down}",ahk_pid %pid%
ELSE IF ((dZ<-trvRng&&!isFght)||(dZ<-fghtRng&&isFght))
ControlSend,,% "{"fKey " up}{"bKey " down}",ahk_pid %pid%
ELSE
ControlSend,,% "{"fKey " up}{"bKey "up}",ahk_pid %pid%
IF (dY>1)
ControlSend,,{Space},ahk_pid %pid%
IF (((dX>trvRng&&!isFght)||(dX>fghtRng&&isFght)||(dX<-trvRng&&!isFght)||(dX<-fghtRng&&isFght)||(dZ<-trvRng&&!isFght)||(dZ<-fghtRng&&isFght)||(dZ>trvRng&&!isFght)||(dZ>fghtRng&&isFght))){
Random,r,1,10
IF (r = 5)
ControlSend,,% "{"fKey " up}{"bKey " up}{"rKey " up}{"lKey " up}{"Jump "}",ahk_pid %pid%
}
}
}
return
Looting:
WinGet,l,list,ahk_exe Trove.exe
Loop %l%
{
WinGet,pid,pid,% "ahk_id "l%a_index%
IF (pid!=mainPid){
ControlSend,,% "{"lootKey " down}",ahk_pid %pid%
Random,r,999,1999
Sleep,%r%
ControlSend,,% "{"lootKey " up}",ahk_pid %pid%
}
}
return
Fighting:
WinGet,l,list,ahk_exe Trove.exe
Loop %l%{
WinGet,pid,pid,% "ahk_id "l%a_index%
IF (pid!=mainPid)
ControlSend,,% "{"spl1Key "}{"spl2Key "}",ahk_pid %pid%
}
return
UpdateGui:
Gui,1:Default
LV_DELETE()
LV_Add("","PID","X","Y","Z","Mount","Message")
WinGet,l,list,ahk_exe Trove.exe
Loop %l%{
WinGet,pid,pid,% "ahk_id "l%a_index%
BaseAddress:=getProcessBaseAddress(l%a_index%)
xAdr:=GetAddress(pid,BaseAddress,ptr,xOfts)
yAdr:=GetAddress(pid,BaseAddress,ptr,yOfts)
zAdr:=GetAddress(pid,BaseAddress,ptr,zOfts)
mtAdr:=GetAddress(pid,BaseAddress,ptr,mtOfts)
X:=ReadMemory(xAdr,pid)
Y:=ReadMemory(yAdr,pid)
Z:=ReadMemory(zAdr,pid)
Mt:=ReadMemory(mtAdr,pid)
IF (4294967295-X<X)
X:=X-4294967295
IF (4294967295-Y<Y)
Y:=Y-4294967295
IF (4294967295-Z<Z)
Z:=Z-4294967295
IF (mainPid!=-1&&(dX+dY+dZ)>30){
msg:="I'm lost"
TrayTip,%pid% is lost !
}ELSE IF(isFght)
msg:="Fighting"
ELSE
msg:="Travelling"
IF (p = mainPid)
LV_Add("Check",pid,X,Y,Z,Mt,"Main Account")
ELSE
LV_Add("",pid,X,Y,Z,Mt,msg)
}
GuiControlGet,isQWERTY,,Keyboard
LV_ModifyCol()
return
Info:
Gui,3:Show,,Info
return
Keys:
Gui,4:Show,,GameKeys
return
Debug:
msg:="[SP" "OILER=Debug][CO" "DE]Version = "ver "`nPointer = "ptr "`nX Offsets = "xOfts "`nY Offsets = "yOfts "`nZ Offsets = "zOfts "`nKeys :`nForward = "fKey "`nBackward = "bKey "`nLeft = "lKey "`nRight = "rKey "`nSpell 1 = "spl1Key "`nSpell 2 = "spl2Key "`nMount = "mtKey "`nBoat = "btKey "`nLoot = "lootKey "`nJump = "jumpKey
WinGet,l,list,ahk_exe Trove.exe
Loop %l%{
Handle:=l%a_index%
WinGet,pid,PID,ahk_id %Handle%
Base:=getProcessBaseAddress(Handle)
msg:=msg "`nClient"a_index ":`nPID = "pid "`nHandle = "Handle "`nBase = "Base "`nX Address = "GetAddress(pid,BaseAddress,ptr,xOfts) "`nY Address = "GetAddress(pid,BaseAddress,ptr,yOfts) "`nZ Address = "GetAddress(pid,BaseAddress,ptr,zOfts) "`nMount Address = "GetAddress(pid,BaseAddress,ptr,mtOfts)
}
msg:=msg "[/CO" "DE][/SPO" "ILER]"
clipboard = %msg%
MsgBox,Debug data copied to clipboard
return
TraRange:
global trvRng:=newTraRng
SaveCgf()
return
FghtRange:
global fghtRng:=newFghtRng
SaveCgf()
return
AssignMain:
Hotkey,%mainHK%,Main,Off
Hotkey,%newMainHK%,Main,On
global mainHK:=newMainHK
MsgBox,Main hotkey set to %mainHK%
SaveCgf()
return
AssignFight:
Hotkey,%fghtHK%,Fight,Off
Hotkey,%newFghtHK%,Fight,On
global fghtHK:=newFghtHK
MsgBox,Fight hotkey set to %fghtHK%
SaveCgf()
return
AssignLoot:
Hotkey,%lootHK%,Loot,Off
Hotkey,%newLootHK%,Loot,On
global lootHK:=newLootHK
MsgBox,Auto loot hotkey set to %lootHK%
SaveCgf()
return
SaveKeys:
global rKey:=newRKey
global lKey:=newLKey
global fKey:=newFKey
global bKey:=newBKey
global spl1Key:=newSpl1Key
global spl2Key:=newSpl2Key
global mtKey:=newMtKey
global btKey:=newBtKey
global lootKey:=newLootKey
global jumpKey:=newJumpKey
MsgBox,Key updated
SaveCgf()
return
ctrlUpdRateAssign:
global updRate:=ctrlUpdRate
IF (mainPid!=-1)
SetTimer,Move,%updRate%
SaveCgf()
return
Config:
Gui,2:Show,,Config
return
GuiClose:
ExitApp
SaveCgf(){
IniWrite,%trvRng%,%iniFile%,Global,trvRng
IniWrite,%fghtRng%,%iniFile%,Global,fghtRng
IniWrite,%updRate%,%iniFile%,Global,updRate
IniWrite,%mainHK%,%iniFile%,Hotkeys,mainHK
IniWrite,%fghtHK%,%iniFile%,Hotkeys,fghtHK
IniWrite,%lootHK%,%iniFile%,Hotkeys,lootHK
IniWrite,%fKey%,%iniFile%,GameKeys,fKey
IniWrite,%bKey%,%iniFile%,GameKeys,bKey
IniWrite,%rKey%,%iniFile%,GameKeys,rKey
IniWrite,%lKey%,%iniFile%,GameKeys,lKey
IniWrite,%spl1Key%,%iniFile%,GameKeys,spl1Key
IniWrite,%spl2Key%,%iniFile%,GameKeys,spl2Key
IniWrite,%mtKey%,%iniFile%,GameKeys,mtKey
IniWrite,%btKey%,%iniFile%,GameKeys,btKey
IniWrite,%lootKey%,%iniFile%,GameKeys,lootKey
IniWrite,%jumpKey%,%iniFile%,GameKeys,jumpKey
}
getProcessBaseAddress(hnd){
Return DllCall( A_PtrSize = 4 ? "GetWindowLong": "GetWindowLongPtr","Ptr",hnd,"Int",-6,"Int64")
}
GetAddress(PID,Base,Adr,Ofts){
p:=ReadMemory(base + Adr,PID)
OftsSpl:=StrSplit(Ofts,"+")
loop,% (OftsSpl.MaxIndex() - 1)
p:=ReadMemory(p + OftsSpl[a_index],PID)
if (Ofts != "")
p:=p + OftsSpl[OftsSpl.MaxIndex()]
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
}