Updated autopot by YoungFlyme

Posts 1–9 of 9 · Page 1 of 1
Updated autopot by YoungFlyme
Original thread: https://www.mpgh.net/forum/showthread.php?t=1153911



Code:
#NoEnv
#SingleInstance, Force
#WinActivateForce
SendMode Input
SetWorkingDir %A_ScriptDir%
global Pointer:="0x00FE53C0"
global MaxOffset:="0x4+0x18C+0x388"
global RealOffset:="0x4+0x18C+0x384"
global iniFile := A_ScriptDir . "/hppot_ptr.ini"
FirstRun := 1
if (FileExist(iniFile)){
IniRead, Pointer, %iniFile%, Global, Pointer
IniRead, MaxOffset, %iniFile%, Global, MaxOffset
IniRead, RealOffset, %iniFile%, Global, RealOffset
}
else{
IniWrite, %Pointer%, %iniFile%, Global, Pointer
IniWrite, %MaxOffset%, %iniFile%, Global, MaxOffset
IniWrite, %RealOffset%, %iniFile%, Global, RealOffset
}
if FirstRun = 1
{
Gui, font, s10, Verdana
Gui, Add, GroupBox, x10 y15 w165 h100, AutoPot Settings
Gui, font
Gui, Add, text, x20 y35, Heal on
Gui, Add, Edit, x60 y32 w27 Number Limit2 vHeal, 50
Gui, Add, text, x90 y35,  percent
Gui, Add, Checkbox, x20 y65 vNotifications, Windows notifications?
Gui, Add, Button, x25 y90 w140 h22 default gSaveSettings, Start
Gui, Show, x386 y200 h120 w185, AutoPot
}
return
SaveSettings:
Gui, Submit
FirstRun = 0
AutoHeal = off
Gui, Destroy
AutoHeal = on
SetTimer, AutoHeal, 100
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
If (Notifications)= 1{
TrayTip ,AutoPot, Bot started! Press "Num 7" again to stop the bot!
}
return
NumPad7::
If AutoHeal = off
{
AutoHeal = on
SetTimer, AutoHeal, 100
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
If (Notifications)= 1{
TrayTip ,AutoPot, Bot started! Press "Num 7" again to stop the bot!
}
return
} else 	If AutoHeal = on
{
AutoHeal = off
SetTimer, AutoHeal, Off
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
sleep 80
SoundPlay, %A_WinDir%\Media\Windows Ding.wav
If (Notifications) = 1{
TrayTip ,AutoPot, Bot stopped! Press "Num 7" again to start the bot!
}
}
return
AutoHeal:
WinGet, l, list, Trove
Loop %l%
{
d := l%a_index%
WinGet, pid, PID, ahk_id %d%
WinGet, Handle, ID, ahk_pid %pid%
Base := getProcessBaseAddress(Handle)
MaxAddress := GetAddress(pid, Base, Pointer, MaxOffset)
RealAddress := GetAddress(pid, Base, Pointer, RealOffset)
MaxValue := ReadMemory(MaxAddress, pid)
RealValue := ReadMemory(RealAddress, pid)
if (RealValue < MaxValue/100*Heal){
ControlSend, , {q down}, ahk_pid %pid%
Sleep, 90
ControlSend, , {q up}, ahk_pid %pid%
heal += 1
Sleep, 1000
}
}
return
getProcessBaseAddress(Handle){
Return DllCall( A_PtrSize = 4
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", Handle
, "Int", -6
, "Int64")
}
GetAddress(PID, Base, Address, Offset){
PointerBase := base + Address
y := ReadMemory(PointerBase,PID)
OffsetSplit := StrSplit(Offset, "+")
OffsetCount := OffsetSplit.MaxIndex()
Loop, %OffsetCount%{
if (a_index = OffsetCount) {
Address := (y + OffsetSplit[a_index])
}Else
if(a_index = 1) {
y := ReadMemory(y + OffsetSplit[a_index],PID)
}Else{
y := ReadMemory(y + OffsetSplit[a_index],PID)
}
}
Return Address
}
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
}
ToolTipDisplay(Message) {
ToolTip, %Message%
SetTimer, RemoveToolTip, 5000
return
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
no work! D;
it is not working D:
Quote Originally Posted by vytasss View Post
1. you need change calculator from MaxValue/100*Heal to MaxValue*(Heal/100) (math)

1. No, i don't need to change it.
If i do so script will compare RealValue with garbage instead of needed percentage from maximum health.
Code:
RealValue < MaxValue/100*Heal


Example - player has 9000 hp.
If i divide it by 100 i will get 9000/100=90, which is 1% from 9000.
If i multiply it by 50 i will get 90*350=4500 which is 50% from 9000.



2. Paste alternative offset inside hppot_ptr.ini or change it inside ahk script and delete .ini:
Code:
[Global]
Pointer=0x00FE04a8
MaxOffset=0x1c+0x44+0x388
RealOffset=0x1c+0x44+0x384
How i can find this offsets? to not waste your time
And thanks work now

- - - Updated - - -

Can i use this script concept in my script?
Quote Originally Posted by vytasss View Post
How i can find this offsets? to not waste your time
And thanks work now
Can i use this script concept in my script? *pic*
Find current health value, pointerscan it/relaunch game/pointerscan until you have couple of stable results.
I am not author of this script, i just updated offsets.

If you want permission - ask author from here:
https://www.mpgh.net/forum/showthread.php?t=1153911
I don't know what I am supposed to do to get the autopot script. Am i supposed to copy the code into a autohotkey file and then I run the auto hotkey?
I'm a newbie when it comes to coding and notepad language and how scripts work in general. Here are the pictures of my progress. I copy and pasted the code into autohotkey and ran it. Changed the pointers. changed the settings so that I would pot at 25 percent health. But when I hop back into game it doesn't pot at all. I don't know what I am supposed to do.
you said something about .ini file. I dont know shit basically. here are some screenshots
http://tinypic.com/view.php?pic=t5m7mw&s=9#.XGZ36biIZhE
http://tinypic.com/view.php?pic=24b6...9#.XGZ3y7iIZhF
Sorry I don't know anything about scripts ahk & things like that, how i'm supposed/where can I use this code, cause the basic version of this autopot not working for me
Sorry to ask this and thanks if you can respond.
Quote Originally Posted by xbonboon View Post
Sorry I don't know anything about scripts ahk & things like that, how i'm supposed/where can I use this code, cause the basic version of this autopot not working for me
Sorry to ask this and thanks if you can respond.
First of all - you need to find correct current health/max health offsets.
Second - check if they are correct and edit script.

Google how to find values and pointers to them using cheat engine.
Quote Originally Posted by 3JIOU_KOTE View Post
First of all - you need to find correct current health/max health offsets.
Second - check if they are correct and edit script.

Google how to find values and pointers to them using cheat engine.
Можешь в друзья добавить и в лс объяснить?
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?