Hi leute.
Ich habe mir gerade die playerstructs von css besorgt, und wollte zum testen ein script machen, welches mir von allen möglichen 64 spielern im raum, alle werte liefert.
Nun habe ich ein Paar arrays gesetzt.
So.
Diese offsets gelten für den ersten spieler.
Für den zweiten spieler, muss jeder offset mit 140 addiert werden.
Nur wie mache ich das?
Ich brauche es in diesem abschnitt.
Das ist für Spieler 1.
Aber wie lese ich es für spieler 2 aus?
$NameOff (der 2. array) muss mit 0x140 addiert werden, aber bei mir funktioniert es nicht.
Hier das momentane Script.
Ich dachte mir, dass man es in einer for schleife sogar viel kürzer machen könnte.
Also dass er die 64 playerinfos runterrattert.
Aber habe so wenig erfahrung mit arrays, habe keine ahnung wie ich den array verändere.
Ich habe mir gerade die playerstructs von css besorgt, und wollte zum testen ein script machen, welches mir von allen möglichen 64 spielern im raum, alle werte liefert.
Nun habe ich ein Paar arrays gesetzt.
Code:
Global Const $NameOff[2] = [0x0, 0x38] Global Const $HPOff[2] = [0x0, 0x5c] Global Const $TeamOff[2] = [0x0, 0x58] Global Const $XOff[2] = [0x0, 0x60] Global Const $YOff[2] = [0x0, 0x64] Global Const $ZOff[2] = [0x0, 0x68] Global Const $PitchOff[2] = [0x0, 0x6C] Global Const $YawOff[2] = [0x0, 0x70] Global Const $RollOff[2] = [0x0, 0x74]
Diese offsets gelten für den ersten spieler.
Für den zweiten spieler, muss jeder offset mit 140 addiert werden.
Nur wie mache ich das?
Ich brauche es in diesem abschnitt.
Code:
$Name = _MemoryPointerRead($Base,$OPEN,$NameOff,"Char[32]") GUICtrlSetData($Input2,$Name[1])
Aber wie lese ich es für spieler 2 aus?
$NameOff (der 2. array) muss mit 0x140 addiert werden, aber bei mir funktioniert es nicht.
Hier das momentane Script.
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
$Base = 0x5EFB8098
Global Const $NameOff[2] = [0x0, 0x38]
Global Const $HPOff[2] = [0x0, 0x5c]
Global Const $TeamOff[2] = [0x0, 0x58]
Global Const $XOff[2] = [0x0, 0x60]
Global Const $YOff[2] = [0x0, 0x64]
Global Const $ZOff[2] = [0x0, 0x68]
Global Const $PitchOff[2] = [0x0, 0x6C]
Global Const $YawOff[2] = [0x0, 0x70]
Global Const $RollOff[2] = [0x0, 0x74]
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 859, 107, 192, 124)
$Label1 = GUICtrlCreateLabel("ID", 8, 8, 15, 17)
$Input1 = GUICtrlCreateInput("", 8, 32, 33, 21)
$Label2 = GUICtrlCreateLabel("PlayerName", 56, 8, 61, 17)
$Input2 = GUICtrlCreateInput("", 56, 32, 137, 21)
$Label3 = GUICtrlCreateLabel("Team", 200, 8, 31, 17)
$Input3 = GUICtrlCreateInput("", 200, 32, 49, 21)
$Label4 = GUICtrlCreateLabel("HP", 256, 8, 19, 17)
$Input4 = GUICtrlCreateInput("", 256, 32, 33, 21)
$Label5 = GUICtrlCreateLabel("X-Coord", 312, 8, 42, 17)
$Input5 = GUICtrlCreateInput("", 304, 32, 97, 21)
$Label6 = GUICtrlCreateLabel("Y-Coord", 408, 8, 42, 17)
$Input6 = GUICtrlCreateInput("", 408, 32, 97, 21)
$Label7 = GUICtrlCreateLabel("Z-Coord", 512, 8, 42, 17)
$Input7 = GUICtrlCreateInput("", 512, 32, 97, 21)
$Label8 = GUICtrlCreateLabel("Pitch", 616, 8, 28, 17)
$Input8 = GUICtrlCreateInput("", 616, 32, 97, 21)
$Label9 = GUICtrlCreateLabel("Yaw", 720, 8, 25, 17)
$Input9 = GUICtrlCreateInput("", 720, 32, 97, 21)
$Label10 = GUICtrlCreateLabel("Roll", 824, 8, 22, 17)
$Input10 = GUICtrlCreateInput("", 824, 32, 25, 21)
$Button1 = GUICtrlCreateButton("Get", 8, 72, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
ReadThem()
EndSwitch
WEnd
Func ReadThem()
$pid = ProcessExists("hl2.exe")
SetPrivilege("SeDebugPrivilege",1)
$OPEN = _MemoryOpen($pid)
;while 1
$Name = _MemoryPointerRead($Base,$OPEN,$NameOff,"Char[32]")
$HP = _MemoryPointerRead($Base,$OPEN,$HPOff)
$Team = _MemoryPointerRead($Base,$OPEN,$TeamOff)
$X = _MemoryPointerRead($Base,$OPEN,$XOff,"float")
$Y = _MemoryPointerRead($Base,$OPEN,$YOff,"float")
$Z = _MemoryPointerRead($Base,$OPEN,$ZOff,"float")
$Pitch = _MemoryPointerRead($Base,$OPEN,$PitchOff,"float")
$Yaw = _MemoryPointerRead($Base,$OPEN,$YawOff,"float")
$Roll = _MemoryPointerRead($Base,$OPEN,$RollOff)
GUICtrlSetData($Input1,"1")
GUICtrlSetData($Input2,$Name[1])
GUICtrlSetData($Input3,$Team[1])
GUICtrlSetData($Input4,$HP[1])
GUICtrlSetData($Input5,$X[1])
GUICtrlSetData($Input6,$Y[1])
GUICtrlSetData($Input7,$Z[1])
GUICtrlSetData($Input8,$Pitch[1])
GUICtrlSetData($Input9,$Yaw[1])
GUICtrlSetData($Input10,$Roll[1])
;wend
;MsgBox(0,"","die hp ist: " &$HP[1])
EndFunc
Also dass er die 64 playerinfos runterrattert.
Aber habe so wenig erfahrung mit arrays, habe keine ahnung wie ich den array verändere.