XxxKills Posted June 17, 2009 Share Posted June 17, 2009 Ok, I'm haveing trouble fiquereing out how to write this the correct way. heres the code I'm working with take a look and tell me what you think. WinSetState("Diablo II", "", @SW_HIDE) ;minimize game Sleep(2000) WinSetState("C:\WINDOWS\system32\cmd.exe", "", @SW_SHOW); opens cmd WinActivate("C:\WINDOWS\system32\cmd.exe", "") Sleep(1000) Send("_netstat") Sleep(1000) Send("{ENTER}") Sleep(1000) FileOpen("Netstat", 2) FileWriteLine("Netstat", "") <------ this is where im haveing trouble(not sure what to add to get the correct line to write, 40000) WinSetState("C:\WINDOWS\system32\cmd.exe", "", @SW_HIDE) Sleep(2000) WinSetState("Diablo II", "", @SW_SHOW) WinActivate("Diablo II", "") Sleep(2000) ;Do actions, else Not sure what to do. I just want it to write the line of the :4000 string. Any one know what to do? I searched the help files and searched on the forums. I've found some examples. But not done in the way I need. Thank you in advance for your time! Link to comment Share on other sites More sharing options...
BrettF Posted June 17, 2009 Share Posted June 17, 2009 Send? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
XxxKills Posted June 17, 2009 Author Share Posted June 17, 2009 No, not exactly, thats not what I'm looking for, trying to write it to a file, but just that line and nothing else. Link to comment Share on other sites More sharing options...
nguyenbason Posted June 17, 2009 Share Posted June 17, 2009 What do you mean by I just want it to write the line of the :4000 string. UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
BrettF Posted June 17, 2009 Share Posted June 17, 2009 (edited) Write what? CMD Can do that you know... http://www.ss64.com/nt/cmd.html Edited June 17, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
geocine Posted June 17, 2009 Share Posted June 17, 2009 Is Netstat a text file? Do Not Steal The Government Hates CompetitionO2JAM AutoPlayBot [|||||.............] 10%Friendster Commenter [..................] 0%Auto Message Download Percentage [|||||||||||||||||] 100% Link to comment Share on other sites More sharing options...
herewasplato Posted June 17, 2009 Share Posted June 17, 2009 Where you see port ":80 " - change that to ":4000 " #include <string.au3> $PID = Run("netstat -n", @SystemDir, @SW_HIDE, 2) Local $Out, $IParray While 1 $Out &= StdoutRead($PID) If @error Then ExitLoop WEnd $OutArray = StringSplit($Out, @CR) For $i = 1 To $OutArray[0] If StringInStr($OutArray[$i], ":80 ", 1) Then MsgBox(0, $i & " of " & $OutArray[0], $OutArray[$i], 3) $IParray = _StringBetween($OutArray[$i], ":", ":") MsgBox(0, $i & " of " & $OutArray[0], ">>>" & _ StringTrimLeft($IParray[0], 9) & "<<<", 3) EndIf NextThis code is from something else. I'll let the gamers help you with putting it in a file if you really think that you want it there. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted June 17, 2009 Share Posted June 17, 2009 Is Netstat a text file?In these lines it is...FileOpen("Netstat", 2)FileWriteLine("Netstat", "")...just no ".txt" file extension. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted June 17, 2009 Share Posted June 17, 2009 What do you mean byIt is the port of interest from the netstat output. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
XxxKills Posted June 17, 2009 Author Share Posted June 17, 2009 (edited) Where you see port ":80 " - change that to ":4000 " #include <string.au3> $PID = Run("netstat -n", @SystemDir, @SW_HIDE, 2) Local $Out, $IParray While 1 $Out &= StdoutRead($PID) If @error Then ExitLoop WEnd $OutArray = StringSplit($Out, @CR) For $i = 1 To $OutArray[0] If StringInStr($OutArray[$i], ":80 ", 1) Then MsgBox(0, $i & " of " & $OutArray[0], $OutArray[$i], 3) $IParray = _StringBetween($OutArray[$i], ":", ":") MsgBox(0, $i & " of " & $OutArray[0], ">>>" & _ StringTrimLeft($IParray[0], 9) & "<<<", 3) EndIf NextThis code is from something else. I'll let the gamers help you with putting it in a file if you really think that you want it there.This works great (thank you by the way, so great I rewrote my code to use yours instead lol) but when I try to write it back to the character screen it gives me nothing. FileOpen("Netstat.txt", 2) FileWriteLine("Netstat.txt","Netstat=" & $OutArray[$i]) FileClose("Netstat.txt") EndIf Next Sleep(2000) WinSetState("Diablo II", "", @SW_SHOW) WinActivate("Diablo II", "") Sleep(4000) FileReadLine("Netstat", 2) Send("{ENTER}") Sleep(5000) Send($Netstat,"") Send("{ENTER}") Sleep(5000) I cant find in the help files where to only write the line in the file to the diablo screen. I know I'm missing something, and its probably something simple. can some one point me in the right direction on this. Edited June 17, 2009 by XxxKills Link to comment Share on other sites More sharing options...
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