My seen script, im very proud of the fact i added my $fulldate with out the ending which would just annoy me :| anyways, heres the script :). Type !seen < person > if you seen them, the script has to.
on *:TEXT:!seen*:#: {
.timerfloods 1 10 unset %s
if ( %s >= 3 ) { halt }
inc %s 1
if ( $2 ison $chan ) {
msg $chan $2 is currently in the channel
halt
}
if ($readini(seen.ini, $2, time)) {
msg $chan I last saw 12{14- $2 14-12} $iif($readini(seen.ini, $2, channel),in) $readini(seen.ini, $2, channel) 12{14- $readini(seen.ini, $2, action) 14-12} 12{14- $readini(seen.ini, $2, saying) 14-12} on 12{14- $Readini(seen.ini, $2, date) 14-12} at 12{14- $readini(seen.ini, $2, time) 14-12}
halt
}
if (guest* iswm $2) { msg $chan I do not keep track of guests, there are to many and to few logs. | halt }
msg $chan I have no logs of $2 $+ , sorry.
}
on *:TEXT:*:#: {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick channel $chan
writeini -n seen.ini $nick action saying
writeini -n seen.ini $nick saying $1-
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
on *:KICK:*: {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick channel $chan
writeini -n seen.ini $nick action kicking
writeini -n seen.ini $nick saying $knick
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
writeini -n seen.ini $knick channel $chan
writeini -n seen.ini $knick action being kicked
writeini -n seen.ini $knick time $time
writeini -n seen.ini $knick saying by $nick with reason $1-
writeini -n seen.ini $knick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
on *:PART:#: {
if ($nick != $me) {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick channel $chan
writeini -n seen.ini $nick action leaving
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick saying with reason $iif(!$1,no reason,$1-)
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
}
on *:JOIN:#: {
if ($nick != $me) {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick channel $chan
writeini -n seen.ini $nick action joining
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick saying nothing obviously.
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
}
on *:QUIT: {
if ($nick != $me) {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick action quiting
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick saying with reason $1-
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
}
on *:ACTION:#: {
if ($nick != $me) {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick channel $chan
writeini -n seen.ini $nick action actioning
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick saying $1-
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
}
on *:NICK: {
if ($newnick != $me) {
if (guest* iswm $nick) { halt }
writeini -n seen.ini $nick action changing their nick to
writeini -n seen.ini $nick saying $newnick
writeini -n seen.ini $nick time $time
writeini -n seen.ini $nick date $remove($fulldate,$right($fulldate,14)) $right($date,4)
}
}
As fordlawnmower said, hashtables are much better suited for this job. Just use a timer or so to ocassionally store the hashtable to a file, in case of a sudden crash, and load the file back in the hashtable in an on START event or so.
Also, instead of checking if the nick IS a guest nick and halting, why not check if the nick ISNT a guest, and then write to a file, else do nothing. saves a bit code and looks somewhat more neat, imho.
I might post my own seen script in a while, when it's completely done. :_)
Using ini's for a script like this is impractical.
For a script that is constantly writing data you must use hashtables if you want to make an efficient script. Writeini was not made to be used this way. This is why the -n was added as an afterthought to override the 64k limit.
Also, if someone is using the script at the same time that someone gets kicked, the .ini is likely to get corrupted.
Not to mention the fact that your script will be to busy writing files during kicks that it won't be able to respond in a timely manner to the current event.
If you used hashtables you would just write one entry with all the information.
if ( uest isin $nick ) { halt }can be coded as:
if ($nick != uest) {
on *:PART:#: {
if ($nick != $me) {
on *:JOIN:#: {
if ($nick != $me) {
on *:QUIT: {
if ($nick != $me) {
on *:ACTION:#: {
if ($nick != $me) {
can be coded as:
on !*:PART:#: {
on !*:JOIN:#: {
on !*:QUIT: {
on !*:ACTION:#: {
p.s. for your on nick event...if I'm correct, is supposed to trigger when a user changes nickname. If that's the case, your $nick != $me will never be true.