I was born with a plastic spoon in my mouth.
Home Blog About Contact
News

Fast !seen

Download FastSeen.zip (352.34 KB)

Fast !seen is a very fast threaded dll-based !seen solution. If you don't know what !seen is - it is a command on IRC channel to find out when user was last around. Normally it is used as !seen <nick>. Fast !seen further enchances this age-old command.

Why did I write yet another !seen solution? There are already a myriad of those! Some are for mIRC, using hashes or text files for storing data. Others are for Eggdrop bots, written in TCL.

There are several reasons. For one thing, in Fast !seen all CPU-intensive fuctions are in the dll and use threads - this means that even in case of a bad net split, your mIRC will not "freeze" and you won't get disconnected.

For another, Fast !seen is both fast and with low CPU consumption. If scripts that store info in a text file will start to eat lots of CPU when there are 2000-3000 nicks in the "database" and hash-based solutions on 6000-8000 then Fast !seen will not use noticeably CPU during normal operation (ie not after net split or rejoin of the splitters) even if there are more then 20,000 nicks in the database. I used 20,000 since I simply haven't had a chance to test it with a bigger nick count but I suspect this holds true to some 100,000 entries.

Few more reasons are that most other !seen scripts do not allow people who run them use the script themselves and/or don't have ability to change script configuration in any other way then coding changes into script. Also, I wanted to test my TmIRCManager Delphi class (will be released for script developers as soon as I'll bother with some docs).

Memory usage of Fast !seen is fairly low, considering that it keeps the database in the memory. 10000 nicks in the database uses roughly 1.4..1.6 MB RAM, which in modern times is next to nothing. However, if I ever do Fast !seen v2, I will cut back memory use some 30%, as right now too much information is stored in the database.

 

Installation

Very easy, just like with other scripts. Extract all three files from the archive and put them to your mIRC folder. You can create a special subfolder for the Fast !seen but don't forget to alter the load command to reflect this.

After extracting the files, type into any mIRC window:

/load -rs FastSeen.mrc

and press enter. If you did everything correctly then you will get the warning message that you are loading the script (sheesh!), press "Yes". Fast !seen configuration window will pop up (You can later access that window from Commands --> Fast !seen --> Options or by pressing Shift+F5 ).

 

Configuration and overview

First tab lists the channels.

Note that only those channels are listed where you are. If you join a new channel and it is not listed, press the "Refresh" button.

Check the channels where you want Fast !seen to be enabled - both in data collecting mode and accepting !seen requests.

Nicks are entered to the database with a delay of 2 seconds. The reason for that is to avoid the rush of other scripts processing same events.


In the second tab are the options.

As you can see, you can limit the number of nicks in the database - select desired value and press "Set". Limit will be enforced when the next nick is entered to the database or you can do it manually - "Enforce limit".

Normally you don't have to save the database manually, dll does it automatically when mIRC exits. But if you want to look at the database in Notepad (it is nothing more then an ASCII file) or got a premonition that mIRC will crash, then "Save database" button is your friend.

"Verify database". It is recommended that you do this if you have manually messed around in it (note that changes made while mIRC works will be overwritten when mIRC exits!).

"Thread priorities" sets the thread priority for both adding new nicks to the database and searching for !seen matches. "Below normal" is recommended, as that way updating database or trying to find a match will not interfere with the other processes.

"Also report negative result" means that searcher will be notified if there is no match is found for !seen search. Useful when your database is still small.

If you uncheck "Enable "seen on channels", !seen commands from channels will not be accepted. "Enable wildcard search" means that if there is no nick found in regular search, dll will do an extended wildcard search and display up do five resulting nicks. For example, if someone searches "!seen Tipi" and you don't have Tipi in the database, wildcard search is engaged and first five nicks that contain *tipi* (such as TipiQueen, TipiCop, PiTiPi") will be returned to the user in a message "<his/her nick> matches found for "Tipi": TipiQueen, TipiCop, PiTiPi". Minimum nick length for wildcard search must be at least 4 characters.

For the message type, private notice is recommended. If you use public channel notice/message, there is a fair chance that you'll piss someone off and risk with getting banned. I know I will ban for such public messages. Note that in the Undernet, CNotice or CPrivMsg will be sent if possible.

The local search searches only from the database - ie if nick is in the channel right now and you don't have it in the database, you will get "not found". Wildcard search works in the same way as in previous tab, except that you will get a full message not just 5 nicks. "Full" means that the nick will be searched from whole message - try it if you don't understand.

 

 

Using Fast !seen on several networks

Fast !seen has both advantages and disadvantages in multi-network environment. For one thing, it is a global script, ie if someone does "!seen thisnick" in the UnderNet then Fast !seen can report to him if thisnick is on NullusNet right now - providing, of course that you have a common channel with thisnick on NullusNet. Same applies for offline nicks, if thisnick was last seen on NullusNet then searcher will get back that info.

On the downside, you cannot enable Fast !seen only on Undernet #bookz and not on IrcHighway #bookz. While Fast !seen records also network info, it is not possible to enable it on #channel1 on one network and disable on #channel1 in another network.

 


Version info

  • v1.0. Initial release.
  • v1.1. Lots of changes. Adding entries will no longer spawn a thread for every nick, now only one updating thread is running. That effectively means that there cannot be duplicates anymore. Prettified the message format - borrowed some of it from Tipi's kick message. On quit and on nick are now recorded only in Fast !seen channels. Some other minor tinkering.
  • 1.11. Fixed code injection security bug with FastSeen and new(-er) mIRC versions.
'

Valid HTML 4.01 Transitional Valid CSS!