Sign in to follow this  
Followers 0
Harmonful

Help Whit Loop (like a live program)

2 posts in this topic

well

im trying to make like info program about a game (Tibia)

I have this:

#Include <_Memory.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 4)

Global $ProcessID = WinGetProcess("[TITLE:Tibia]")
Global $Mana

$PlayerHP = Read_WoW_Memory()

Func Read_WoW_Memory()
    While 1
    Local $Value
    Local $Value1
    Local $DllInformation = _MemoryOpen($ProcessID)
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to open memory.")
        Exit
    EndIf
    While 1
    $Value = _MemoryRead(0x00635F0C, $DllInformation)
    $Mana= _MemoryRead(0x00635EF0, $DllInformation)
    WEnd
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to read memory.")
        Exit
    EndIf

    _MemoryClose($DllInformation)
    If @Error Then
        MsgBox(4096, "ERROR", "Failed to close memory.")
        Exit

    EndIf

    Return $Value
    WEnd
EndFunc

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 188, 83, 192, 124, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS), 0)
$Label1 = GUICtrlCreateLabel("Hp:", 8, 8, 21, 17)
$Label2 = GUICtrlCreateLabel("Mana:", 8, 32, 34, 17)
$Input1 = GUICtrlCreateInput($PlayerHP, 48, 8, 73, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY), $WS_EX_STATICEDGE)
$Input2 = GUICtrlCreateInput($Mana, 48, 32, 73, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY), $WS_EX_STATICEDGE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

but i want to make that the labels change when the memory change

im tried of tryng and tryng

plx help

thx!

:mellow:

Share this post


Link to post
Share on other sites



I don't even think it will work, I know may be I am wrong but let's have a look,

You declared

$PlayerHP = Read_WoW_Memory()

Now to set this variable this function will be called and in this function are two while loop, first time first one is executed and then while still in first one the next one is executed, which is like

While 1
$Value = _MemoryRead(0x00635F0C, $DllInformation)
$Mana= _MemoryRead(0x00635EF0, $DllInformation) 
WEnd

So while 1 is always true, and so the script won't get over it and will loop forever in this loop, correct me if I am wrong ?:mellow:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0