Channel Logger Script
From Jin
The Channel Logger script will log all channel tells, or if you choose, all channel tells from a specific channel, to a file.
- Script Type
- BeanShell.
- Event Type
- Chat
- Event Subtype
- Channel Tell
- Code to log channel 1 into
c:\log.txt
if (channel == 1){
String filename = "c:\\log.txt";
FileOutputStream fout = new FileOutputStream(filename, true);
PrintStream out = new PrintStream(fout);
String line = sender + "(" + channel + "): " + message;
out.println(line);
out.close();
}
Replace the channel number in if (channel == 1){ to the channel you want to log and the name of the file in String filename = "c:\\log.txt"; to the file you want to log to (don't forget to use \\ instead of \). You can also change the exact text written to the file by changing the assignment to the line variable. If you want to log more than one channel, change the if on the first line to something like if ((channel == 1) || (channel == 5) || (channel == 10)){. If you want to log all the channels, just remove the if statement and the corresponding } on the last line.
