hab mal nen kleines beispiel für dich gemacht
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <nomadmemory.au3>
$PID = WinGetProcess("Guild Wars")
$hprocess = _MemoryOpen($PID)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 201, 154, 192, 124)
$Input1 = GUICtrlCreateInput("0xd28c54", 66, 6, 121, 21)
$Input2 = GUICtrlCreateInput("0xd28c58", 66, 34, 121, 21)
$Label1 = GUICtrlCreateLabel("wert x", 8, 8, 32, 17)
$Label2 = GUICtrlCreateLabel("wert y", 8, 38, 32, 17)
$Button1 = GUICtrlCreateButton("read", 4, 72, 75, 25, 0)
$Button2 = GUICtrlCreateButton("save", 110, 72, 75, 25, 0)
$Input3 = GUICtrlCreateInput("", 6, 114, 181, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
dim $xerg, $yerg, $x, $y
HotKeySet("{F1}", "save")
go()
func go()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
$x = GUICtrlRead($Input1)
$y = GUICtrlRead($Input2)
auslesen()
EndSwitch
WEnd
EndFunc
func auslesen()
if not ProcessExists("gw.exe") then
MsgBox(1,"achtung!", "erst gw starten dann auf read klicken...")
go()
endif
while 1
sleep(100)
$Xerg1 = _MEMORYREAD($X, $hprocess , "float")
$Yerg1 = _MEMORYREAD($Y, $hprocess , "float")
$xerg = Round($Xerg1, 0)
$yerg = Round($Yerg1, 0)
guictrlsetdata($Input3, "koordinaten: " & "x= " & $Xerg & " ; " & "y= " & $Yerg)
$nMsg = GUIGetMsg()
if $nMsg = $Button2 then save()
if $nMsg = $GUI_EVENT_CLOSE then exit
WEnd
EndFunc
func save()
FileWrite("koords.txt", "koordinaten: " & "x= " & $Xerg & " ; " & "y= " & $Yerg & @crlf)
EndFunc