ini untuk autopot DOMO, gamenya lom release di indo... akan
jadi kalo hp/mp kritis langsung otomatis minum
tapi konon addressnya suka berubah setiap kali panggil game (dinamis) jadi harus di ganti2
$Caddress = "56F1890"
$Maddress = "56F1894" << dua ini sama alamat HP dan MP
#include <String.au3>
HotKeySet("{F5}", "AutoPot")
HotKeySet("{F6}", "Config")
HotKeySet("{F7}", "Stop")
Dim $SlowHealLife
Dim $InstantHealLife
Dim $SlowPotionKey
Dim $InstantPotionKey
Dim $PotionDelay
Dim $MemOpen
$Caddress = "56F1890"
$Maddress = "56F1894"
$yAutopotStart = MsgBox(1, "yAutopot by julmuri", "F5 - Start Autopotting" & @CRLF & "F6 - yAutopot Configs" & @CRLF & "F7 - Exit yAutopot")
If $yAutopotStart = 2 Then
Stop()
EndIf
Config()
While 1
ToolTip("yAutopot running", 0, 0)
Sleep(200)
WEnd
Func AutoPot()
$Process = "_L.exe"
If ProcessExists($Process) = 0 Then
ToolTip("Waiting for Yogurting Process", 0, 0)
ProcessWait($Process)
ElseIf ProcessExists($Process) Then
$PID = ProcessExists($Process) $MemOpen = _MemOpen($PID)
EndIf
While 1
If ProcessExists($Process) = 0 Then
ToolTip("Waiting for Yogurting Process", 0, 0)
ProcessWait($Process)
ElseIf ProcessExists($Process) Then
$ReadCurrentLife = _MemRead($MemOpen, "0x" & $Caddress, 4)
$ReadMaxLife = _MemRead($MemOpen, "0x" & $Maddress, 4)
$CurrentLife = _HexadecimalToDecimal($ReadCurrentLife)
$MaxLife = _HexadecimalToDecimal($ReadMaxLife)
ToolTip("Current Life is : " & $CurrentLife & " / " & $MaxLife, 0, 0)
Sleep(500)
If $MaxLife / 100 * $InstantHealLife >= $CurrentLife Then
ToolTip("Drinking Instant Potion", 0, 0)
ControlSend("Yogurting", "", "", $InstantPotionKey, 1)
Sleep(100)
ElseIf $MaxLife / 100 * $SlowHealLife >= $CurrentLife Then
ToolTip("Drinking Potion", 0, 0)
ControlSend("Yogurting", "", "", $SlowPotionKey, 1)
Sleep($PotionDelay)
Else
Sleep(200)
EndIf
EndIf
WEnd
EndFunc ;==>AutoPot
Func Config()
ToolTip("yAutopot Configurations", 0, 0)
$SlowHealLife = InputBox("Life Heal %", "Set Life Heal % (0-100) :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
$InstantHealLife = InputBox("Life Heal %", "Set Instant Life Heal % (0-100) :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
$SlowPotionKey = InputBox("Potion Key", "Set Your Potion Key :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
$InstantPotionKey = InputBox("Instant Potion Key", "Set Instant Potion Key :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
$PotionDelay = InputBox("Potion Drink Delay", "Set Potion Drink Delay (in ms.) :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
Select
Case $SlowHealLife < 1 Or $SlowHealLife > 100
Do
MsgBox(0, "Invalid Heal life %", "Press OK to set new Heal Life %")
$SlowHealLife = InputBox("Life Heal %", "Set Life Heal % (0-100) :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
Until $SlowHealLife > 1 And $SlowHealLife < 100
Case $InstantHealLife < 1 Or $InstantHealLife > 100
Do
MsgBox(0, "Invalid Instant Heal life %", "Press OK to set new Instant Heal Life %")
$SlowHealLife = InputBox("Instant Life Heal %", "Set Instant Life Heal % (0-100) :", "", " ", "100", "50", "-1", "-1")
If @error = 1 Then Exit
Until $InstantHealLife > 1 And $InstantHealLife < 100
EndSelect
EndFunc ;==>Config
Func _MemOpen($i_Pid, $i_Access = 0x1F0FFF, $i_Inherit = 0)
Local $av_Return[2]= [DllOpen('kernel32.dll') ]
Local $ai_Handle = DllCall($av_Return[0], 'int', 'OpenProcess', 'int', $i_Access, 'int', $i_Inherit, 'int', $i_Pid)
If @error Then
DllClose($av_Return[0])
SetError(1)
Return 0
EndIf
$av_Return[1] = $ai_Handle[0]
Return $av_Return
EndFunc ;==>_MemOpen
Func _MemRead($ah_Mem, $i_Address, $i_Size = 0)
If $i_Size = 0 Then
Local $v_Return = ''
Local $v_Struct = DllStructCreate('byte[1]')
Local $v_Ret
While 1
$v_Ret = DllCall($ah_Mem[0], 'int', 'ReadProcessMemory', 'int', $ah_Mem[1], 'int', $i_Address, 'ptr', DllStructGetPtr($v_Struct), 'int', 1, 'int', '')
$v_Ret = DllStructGetData($v_Struct, 1)
If $v_Ret = 0 Then ExitLoop
$v_Return &= Chr($v_Ret)
$i_Address += 1
WEnd
Else
Local $v_Struct = DllStructCreate('byte[' & $i_Size & ']')
Local $v_Ret = DllCall($ah_Mem[0], 'int', 'ReadProcessMemory', 'int', $ah_Mem[1], 'int', $i_Address, 'ptr', DllStructGetPtr($v_Struct), 'int', $i_Size, 'int', '')
Local $v_Return[$v_Ret[4]]
For $i = 0 To $v_Ret[4] - 1
$v_Return[$i] = DllStructGetData($v_Struct, 1, $i + 1)
Next
EndIf
Return $v_Return
EndFunc ;==>_MemRead
Func _MemClose($ah_Mem)
Local $av_Ret = DllCall($ah_Mem[0], 'int', 'CloseHandle', 'int', $ah_Mem[1])
DllClose($ah_Mem[0])
Return $av_Ret[0]
EndFunc ;==>_MemClose
Func _MemRev($v_DWORD)
If UBound($v_DWORD) = 4 Then Return '0x' & Hex($v_DWORD[3], 2) & Hex($v_DWORD[2], 2) & Hex($v_DWORD[1], 2) & Hex($v_DWORD[0], 2) Local $v_Ret[4] = ['0x' & StringMid(Hex($v_DWORD, 8), 7, 2), '0x' & StringMid(Hex($v_DWORD, 8), 5, 2), '0x' & StringMid(Hex($v_DWORD, 8), 3, 2), '0x' & StringMid(Hex($v_DWORD, 8), 1, 2) ]
Return $v_Ret
EndFunc ;==>_MemRev
Func _HexadecimalToDecimal($var)
$Result = 0
$Sum = 0
$Power = 0
Do
$CurrentDigit = StringRight(_MemRev($var), $Power + 1)
$CurrentDigit = StringLeft($CurrentDigit, 1)
If $CurrentDigit = "A" Then
$CurrentDigit = 10
ElseIf $CurrentDigit = "B" Then
CurrentDigit = 11
ElseIf $CurrentDigit = "C" Then
$CurrentDigit = 12
ElseIf $CurrentDigit = "D" Then
$CurrentDigit = 13
ElseIf $CurrentDigit = "E" Then
$CurrentDigit = 14
ElseIf $CurrentDigit = "F" Then
$CurrentDigit = 15
EndIf
$Result = $CurrentDigit * 16 ^ $Power
$Power += 1
$Sum += $Result
Until $CurrentDigit = "x"
Return $Sum
EndFunc ;==>_HexadecimalToDecimal
Func Stop()
_MemClose($MemOpen)
Exit
EndFunc ;==>Stop