Seen script.

By Ghost-writer on Oct 11, 2009

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)
  }
}

Comments

Sign in to comment.
BeginnerS   -  Dec 11, 2015

Hey Man love your script I just have to add a question,,,,,can you help me rewrite this so the person who types !seen can get a notice instead ....
of chan msg. THank you very much good sir ^_____^

 Respond  
BeginnerS   -  Sep 16, 2015

How to add for Masks. To be able to do !seen mask.numb.ers.here

 Respond  
Testor   -  Nov 27, 2009

/whowas has an "expiration time" :\ so over long time frames, it wont work; as far as i know.

 Respond  
PurplesurgeMirc   -  Nov 26, 2009

Lol, /whowas is an rfc command. Any IRC daemon that doesn't have it is nonstandard.

 Respond  
Ghost-writer   -  Nov 24, 2009

Not all of us are on purplesurge and have that server command.

 Respond  
PurplesurgeMirc   -  Nov 24, 2009

I'd still rather do /whowas NICK

 Respond  
knoeki   -  Oct 12, 2009

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. :_)

 Respond  
Testor   -  Oct 11, 2009

make a skip-over for unknown, like you have with guest. as the same principal occurs.

 Respond  
FordLawnmower   -  Oct 11, 2009

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.

 Respond  
Ghost-writer   -  Oct 11, 2009

Thanks jethro_, thats nice :P. i updated script. tyvm :D.

 Respond  
Jethro   -  Oct 11, 2009

The use of isin operator is not safe, because if nicks have "uest" in them, they'll be negated, hence your use of /halt

 Respond  
Jethro   -  Oct 11, 2009

Oh, I mistook that as a nickname. Then you can use

if (guest* !iswm $nick)
 Respond  
Ghost-writer   -  Oct 11, 2009
if ($nick != uest) {

That wouldnt work, that will only take place if $nick == uest, i want if guest isin the nick or guest9823498 isin the nick, it doesnt track, not just 1 nick.

and i dont see ho that list of things will work, all on events in 1. thats a first for me.

 Respond  
Jethro   -  Oct 11, 2009

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.

 Respond  
Atr   -  Oct 11, 2009

Lol @ not tracking Guests..

 Respond  
sunslayer   -  Oct 11, 2009

maybe add so it will track the host too?
also > im very proud of the fact i added my $fulldate with out the ending which would just annoy me :|

$time(ddd mmm d)

:p

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.