OpChat and AdminChat on connect
 

OpChat and AdminChat on connect

Started by pR0Ps, 27 April, 2010, 19:24:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pR0Ps

Hello,

I am trying to get OpChat and AdminChat to automatically pop up when a user with the right privileges connects (OpChat for OPs, both for Admins). I am using the logging feature of DiXBoT to keep rack of the logs, now I just need to figure out how to automatically retrieve the last 15 or so lines (if there are that many) and display them when the user connects. Is there an easier, built in way? for now I'm going to try to do it manually with file IO, but if there is a built in way, could someone point me in the right direction?

pR0Ps

EDIT: I have manged to get it all working perfectly except for the IO, specifically reading the last n number of lines from the log file. I'm a bit fuzzy on lua file IO. How would I go about doing this? Would I have to parse the entire file? Doing that seems like a waste of resources and would slow down as the log files got bigger and bigger. Any help would be much appreciated.

EDIT: It's all working perfectly now, I will post the code once the hub I am developing for goes live

SMF spam blocked by CleanTalk