Originally Posted by butter123
PHP Code:
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=butter.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <ImageSearch.au3>
#include <array.au3>
#include <NomadMemory.au3>
Opt("MouseClickDownDelay", 50)
Opt("MouseClickDelay", 300)
Opt("SendKeyDownDelay", 100)
Dim $aWindows[3],$aCoords[2],$h,$m,$s,$hProcessHeal,$heal,$kill,$killing,$shoot,$shooting,$healing,$Config,$hProcessDummy
$bIsRunning = False
$totaltime = TimerInit()
$lastshot = TimerInit()
$timerLastNoHeal=TimerInit()
$iCount = 0
$shots = 0
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("PS2 Bot", 216, 156, 192, 124)
$ButtonStart = GUICtrlCreateButton("Go!", 120, 96, 75, 23)
GUICtrlSetState(-1,$GUI_DISABLE)
$ButtonReset = GUICtrlCreateButton("Reset", 120, 66, 75, 23)
$InputMemHealHealth = GUICtrlCreateInput("0xHealHealth",16,63,100,20)
$InputMemDummyHealth = GUICtrlCreateInput("0xDummyHealth",16,88,100,20)
$InputMemDummyShield = GUICtrlCreateInput("0xDummyShield",16,106,100,20)
$InputCount = GUICtrlCreateInput("12",174, 126,20,17)
$InputSleep = GUICtrlCreateInput("4500",121, 126,52,17)
$LabelHealHealth = GUICtrlCreateLabel("HealthHeal", 10, 128, 36, 17)
$LabelDummyHealth = GUICtrlCreateLabel("HealthDummy", 25, 128, 36, 17)
$LabelDummyShield = GUICtrlCreateLabel("ShieldDummy", 40, 128, 36, 17)
$LabelInfo = GUICtrlCreateLabel("Healer: " &_ok($aWindows[0]) &" || Dummy: " &_ok($aWindows[1]) &" || Shooter: " &_ok($aWindows[2]) &" || Lable: " &$aCoords[0] &"," &$aCoords[1], 16, 16, 200, 27)
$LabelTime = GUICtrlCreateLabel("Time", 79, 128, 44, 17)
$Labeli = GUICtrlCreateLabel("i", 56, 128, 15, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{F7}","_config")
HotKeySet("{F8}","_toggle")
HotKeySet("{F9}","_terminate")
If FileExists("Ps2config.txt") Then
GUICtrlSetData($InputMemHealHealth,FileReadLine("Ps2config.txt",1))
GUICtrlSetData($InputMemDummyHealth,FileReadLine("Ps2config.txt",2))
GUICtrlSetData($InputMemDummyShield,FileReadLine("Ps2config.txt",3))
$aCoords[0] = FileReadLine("Ps2config.txt",4)
$aCoords[1] = FileReadLine("Ps2config.txt",5)
FileDelete("Ps2config.txt")
EndIf
While 1
_guiupdate()
If $bIsRunning Then
If $heal = True Then
$heal = False
$healing = True
$timerHealStart=TimerInit()
_WinActivate($aWindows[0])
MouseDown("left")
ElseIf $healing = True And _MemoryRead(GUICtrlRead($InputMemDummyHealth),$hProcessDummy) >= 48 Then
$healing = False
$shoot = True
If $iCount >= GUICtrlRead($InputCount) Then
$kill = True
$shoot = False
EndIf
MouseUp("left")
ElseIf TimerDiff($timerHealStart) > 5000 And TimerDiff($timerLastNoHeal) >5000 Then
$timerLastNoHeal=TimerInit()
MouseUp("left")
Sleep(500)
MouseDown("left")
EndIf
If $kill = True Then
$kill = False
$killing = True
$shoot = False
Send("c")
_WinActivate($aWindows[2])
ElseIf $killing = True and TimerDiff($lastshot) > 400 And _MemoryRead(GUICtrlRead($InputMemHealHealth),$hProcessHeal) > 0 Then
Send("{1}")
$lastshot = TimerInit()
ElseIf $killing = True And _MemoryRead(GUICtrlRead($InputMemHealHealth),$hProcessHeal) = 0 Then
$iCount = 0
_WinActivate($aWindows[1])
_WinActivate($aWindows[1])
MouseDown("left")
Sleep(100)
MouseUp("left")
Sleep(100)
MouseDown("left")
Sleep(100)
MouseUp("left")
Sleep(100)
MouseDown("left")
Sleep(GUICtrlRead($InputSleep))
MouseUp("left")
Sleep(100)
If _MemoryRead(GUICtrlRead($InputMemHealHealth),$hProcessHeal) = 0 Then
_WinActivate($aWindows[0])
Sleep(2000)
MouseMove($aCoords[0],$aCoords[1])
Sleep(100)
MouseClick("left",$aCoords[0],$aCoords[1],3)
Sleep(4000)
If _MemoryRead(GUICtrlRead($InputMemHealHealth),$hProcessHeal) <> 0 Then
$killing = False
Send("c")
$heal = True
EndIf
EndIf
EndIf
If $shoot = True Then
$shoot = False
$shooting = True
$shots = 0
_WinActivate($aWindows[2])
ElseIf $shooting = True and (_MemoryRead(GUICtrlRead($InputMemDummyHealth),$hProcessDummy)+_MemoryRead(GUICtrlRead($InputMemDummyShield),$hProcessDummy))>66 Then
Send("{1}")
$shooting = False
$iCount = $iCount +1
$heal = True
EndIf
Else
Sleep(50)
EndIf
WEnd
Func _guiupdate()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
FileWrite("Ps2config.txt",GUICtrlRead($InputMemHealHealth) &@CRLF &GUICtrlRead($InputMemDummyHealth) &@CRLF &GUICtrlRead($InputMemDummyShield) &@CRLF &$aCoords[0] &@CRLF &$aCoords[1])
Exit
Case $ButtonStart
_toggle()
Case $ButtonReset
Dim $aWindows[3],$aCoords[2],$h,$m,$s,$hProcessHeal,$heal,$kill,$killing,$shoot,$shooting,$healing,$Config,$hProcessDummy
$bIsRunning = False
$totaltime = TimerInit()
$lastshot = TimerInit()
$iCount = 0
$shots = 0
GUICtrlSetData($LabelInfo,"Healer: " &_ok($aWindows[0]) &" || Dummy: " &_ok($aWindows[1]) &" || Shooter: " &_ok($aWindows[2]) &" || Lable: " &$aCoords[0] &"," &$aCoords[1])
GUICtrlSetData($InputMemHealHealth,"0xHealHealth")
GUICtrlSetData($InputMemDummyHealth,"0xDummyHealth")
GUICtrlSetData($InputMemDummyShield,"0xDummyShield")
GUICtrlSetState($ButtonStart,$GUI_DISABLE)
EndSwitch
_TicksToTime(TimerDiff($totaltime),$h,$m,$s)
GUICtrlSetData($LabelTime,$h &":" &$m &":" &$s)
GUICtrlSetData($LabelDummyHealth,_MemoryRead(GUICtrlRead($InputMemDummyHealth),$hProcessDummy))
GUICtrlSetData($LabelHealHealth,_MemoryRead(GUICtrlRead($InputMemHealHealth),$hProcessHeal))
GUICtrlSetData($LabelDummyShield,_MemoryRead(GUICtrlRead($InputMemDummyShield),$hProcessHeal))
GUICtrlSetData($Labeli,$iCount)
EndFunc
Func _terminate()
FileWrite("Ps2config.txt",GUICtrlRead($InputMemHealHealth) &@CRLF &GUICtrlRead($InputMemDummyHealth) &@CRLF &GUICtrlRead($InputMemDummyShield) &@CRLF &$aCoords[0] &@CRLF &$aCoords[1])
Exit
EndFunc
Func _WinActivate($handle)
WinActivate($handle)
WinActivate($handle)
WinWaitActive($handle)
Sleep(50)
EndFunc
Func _toggle()
If _allok() Then
$bIsRunning = Not $bIsRunning
If $bIsRunning Then
GUICtrlSetData($LabelInfo,"Running!")
$heal = True
Else
MouseUp("left")
GUICtrlSetData($LabelInfo,"Paused!")
$heal = False
$kill = False
$shoot = False
$healing = False
$killing = False
$shooting = False
EndIf
EndIf
EndFunc
Func _config()
If Not $Config Then
GUISetState(@SW_HIDE)
$hLastWindow = WinGetHandle("")
Dim $coords[2] = [MouseGetPos(0),MouseGetPos(1)]
$Config = GUICreate("Config", 441, 189, 192, 124,$WS_CAPTION)
$ButtonAdd = GUICtrlCreateButton("Ok", 256, 152, 75, 25)
$ButtonCancle = GUICtrlCreateButton("Cancle", 352, 152, 75, 25)
$RadioHeal = GUICtrlCreateRadio("Healer window", 16, 40, 113, 17)
GUICtrlSetState($RadioHeal, $GUI_CHECKED)
$RadioDummy = GUICtrlCreateRadio("Dummy window", 16, 64, 113, 17)
$RadioShoot = GUICtrlCreateRadio("Shooter window", 16, 88, 113, 17)
$RadioCoord = GUICtrlCreateRadio("Lable position", 296, 40, 113, 17)
$LabelWindow = GUICtrlCreateLabel("Last Window: " &WinGetTitle($hLastWindow), 16, 8, 250, 27)
$LabelCoord = GUICtrlCreateLabel("Mouse Coordinates: " &$coords[0] &"," &$coords[1], 296, 8, 98, 27)
$LabelInfo2 = GUICtrlCreateLabel("Healer: " &_ok($aWindows[0]) &" || Dummy: " &_ok($aWindows[1]) &" || Shooter: " &_ok($aWindows[2]) &" || Lable: " &$aCoords[0] &"," &$aCoords[1], 16, 122, 398, 27)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $ButtonCancle
ExitLoop
Case $ButtonAdd
If GUICtrlRead($RadioHeal) = $GUI_CHECKED Then
$aWindows[0] = $hLastWindow
$hProcessHeal = _MemoryOpen(WinGetProcess($aWindows[0]))
ElseIf GUICtrlRead($RadioDummy) = $GUI_CHECKED Then
$aWindows[1] = $hLastWindow
$hProcessDummy = _MemoryOpen(WinGetProcess($aWindows[1]))
ElseIf GUICtrlRead($RadioShoot) = $GUI_CHECKED Then
$aWindows[2] = $hLastWindow
ElseIf GUICtrlRead($RadioCoord) = $GUI_CHECKED Then
$aCoords = $coords
EndIf
ExitLoop
EndSwitch
WEnd
GUISwitch($Form1)
GUISetState(@SW_SHOW,$Form1)
GUIDelete($Config)
$Config = 0
If _allok() Then
GUICtrlSetState($ButtonStart,$GUI_ENABLE)
EndIf
GUICtrlSetData($LabelInfo,"Healer: " &_ok($aWindows[0]) &" || Dummy: " &_ok($aWindows[1]) &" || Shooter: " &_ok($aWindows[2]) &" || Lable: " &$aCoords[0] &"," &$aCoords[1])
EndIf
EndFunc
Func _ok($stuff)
If $stuff Then
Return "Ok"
Else
Return "Undefined"
EndIf
EndFunc
Func _allok()
If _ok($aWindows[0]) = "Ok" AND _ok($aWindows[1]) = "Ok" AND _ok($aWindows[2]) = "Ok" AND _ok($aCoords[0]) = "Ok" Then
Return True
Else
Return False
EndIf
EndFunc
As i said, just had to add the adress to the gui, delete some things from killing and other minor changes. But:
I DID NOT TEST THIS!! all changes were made from mind, so i dont know if it runs correctly. (my hotkey for using knife is "1", also the config file changed. just delete it^^)
When i tested the knifing yesterday i got ~300 points in 35 seconds so ~35k xp per hour. but this is without reviving and with this faster shield regenerator upgraded to max.
also positioning the character correctly could make problems. you have to stand pretty close, to get the dummy in range and the healer still has to stand between them.
and the hitbox does not seem to get much smaller when you crouch. i think standing in a slight triangle (not all in a line) works.
(stand the same way like before, just much closer, so the dummy is in range of the knife)
|