lolp1 Posted March 2, 2007 Posted March 2, 2007 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
Sardith Posted March 2, 2007 Posted March 2, 2007 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]
lolp1 Posted March 2, 2007 Author Posted March 2, 2007 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now