Sign in to follow this  
Followers 0
lolp1

Same result untill I restart the program.

3 posts in this topic

Basicly, I'm having a small problem. A simple tool I'm making seems to want to not display the correct info except for the first time, then I have to restart it to do it again.

For example:

Lets say the current IP i am on is 63.241.83.67 , so I start the program and let it do its check, and it displays the correct IP.

Then, I go into a new game (with a new IP) and start it, and it still says the 63.241.83.67, if I restart the whole program it displays the correct info.

Any advice? Heres the code:

#include <Memory.au3>
Global $OFFSET_D2MULTI_IPADDRESS_ASCII = 0x6FA2B1F8

HotKeySet("{insert}", "displayip")
$WindowName = "classname=Diablo II"
$CurrentIP = Read_Diablo_Memory (GetD2ProcessID(), $OFFSET_D2MULTI_IPADDRESS_ASCII, 'char[16]')
While 1
    Sleep(20)
    Wend
Func displayip()
    TrayTip ( "Current game IP", $CurrentIP, 10 , 1 ); Notify the user that it has started sucsfully

Endfunc



Func GetD2ProcessID()
  $ProcID = WinGetProcess("Diablo II")
If $ProcID = -1 Then
        MsgBox(4096, "ERROR", $Procid)
        Exit
    EndIf
    Return $ProcID
EndFunc  ;==>GetD2ProcessID

Share this post


Link to post
Share on other sites



I can't test this, but..

#include <Memory.au3>
Global $OFFSET_D2MULTI_IPADDRESS_ASCII = 0x6FA2B1F8

HotKeySet("{insert}", "displayip")
$WindowName = "classname=Diablo II"
$CurrentIP = Read_Diablo_Memory (GetD2ProcessID(), $OFFSET_D2MULTI_IPADDRESS_ASCII, 'char[16]')

While 1
    Sleep(100)
    Wend

Func displayip()
    $CurrentIP = Read_Diablo_Memory (GetD2ProcessID(), $OFFSET_D2MULTI_IPADDRESS_ASCII, 'char[16]')
    Sleep(10)
    TrayTip("Current game IP", $CurrentIP, 10 , 1 ); Notify the user that it has started sucsfully
Endfunc



Func GetD2ProcessID()
  $ProcID = WinGetProcess("Diablo II")
If $ProcID = -1 Then
        MsgBox(4096, "ERROR", $Procid)
        Exit
    EndIf
    Return $ProcID
EndFunc  ;==>GetD2ProcessID

By having the line $CurrentIP = Read_Diablo_Memory (GetD2ProcessID(), $OFFSET_D2MULTI_IPADDRESS_ASCII, 'char[16]') once at the top of script, it only gathers the info once. By having it set on the hotkey, every time the hotkey is pushed, it will gather the IP.


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites

By having the line $CurrentIP = Read_Diablo_Memory (GetD2ProcessID(), $OFFSET_D2MULTI_IPADDRESS_ASCII, 'char[16]') once at the top of script, it only gathers the info once. By having it set on the hotkey, every time the hotkey is pushed, it will gather the IP.

Thanks - so far it seems to be working, I would have never personally thought of that.

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