lolp1 Posted May 2, 2007 Share Posted May 2, 2007 Ok, here is what I need to do. Lets say I log something to a file, every time it logs it of course makes a new line. 1 2 3 4 etc I need a way to detect every time it logs a new line, so I can report what it logged to another place, how could I do this? Link to comment Share on other sites More sharing options...
Valuater Posted May 2, 2007 Share Posted May 2, 2007 maybe... #include <File.au3> $Log = "C;\Log.txt" $CountLines = _FileCountLines($Log) While 1 $nCountLines = _FileCountLines($Log) If $nCountLines <> $CountLines Then MsgBox(0, 0, FileReadLine($Log, $nCountLines)) $CountLines = $nCountLines EndIf Sleep(20) WEnd 8) Link to comment Share on other sites More sharing options...
lolp1 Posted May 2, 2007 Author Share Posted May 2, 2007 Thanks, works! I came up with this, the problem is I now need to report the latest line logged, and I need to report the actual log line, for example instead of it reporting Log.txt108, I need it to report like: 2007-05-01 20:13:08 : Text 1 Any idea ? #include <File.au3> #include <IRC.au3> Global $server = "irc.gamersvault.net" Global $port = 6667 Global $nick = "Au3Bot" Global $channel = "#xferbot" $Log = "Log.txt" $CountLines = _FileCountLines($Log) TCPStartup () Global $sock = _IRCConnect($server, $port, $nick); Connects to IRC and Identifies its Nickname ;$recv = TCPRecv($sock, 8192); Recieve things from server _IRCJoinChannel ($sock, $channel) While 1 $nCountLines = _FileCountLines($Log) If $nCountLines <> $CountLines Then _IRCSendMessage($sock, $log & $ncountlines, $channel) $CountLines = $nCountLines EndIf Sleep(20) WEnd 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