OliMaylen commented on a Page, server !seen and !idle scripts  -  Apr 22, 2008

Thought this might be useful, I have progressed a lot since my last comment, which I am unable to delete. I think I had other errors which accounted for the error I had before. Anyway I edited part of the script & added bits to handle the 319 code from the raw whois. Now instead of just saying if the user is on the server, it now returns a list of channels the user you \"!seen\" is on. It now also handles if users are on the server but not in any rooms and tells you this info also.

The bits I added may be a little crude, but it works. Changed the

msg $chan\"

to

.notice %xseen.nick

in a lot of places for my own use so as not to spam the room with people going mad with the script. It puts a nice touch to an already great script I think. :-)

Here is the bit i edited:

raw 402:*: {
  if (%xseen) {
    if (!$hget(xSeen,%xseen.target)) { .notice %xseen.nick 12Sorry,4 %xseen.target 12was not found in my database, or on the server. }
    if ($hget(xSeen,%xseen.target)) {
      var %xseen.data $left($hget(xSeen,$2),1) 
      tokenize 32 $hget(xSeen,%xseen.target)
      if ($1 = Q) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen Quitting 4(Quit Message: $4- $+ ) $duration($calc($ctime - $3)) ago. }
      if ($1 = S) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen by me on the server4 $duration($calc($ctime - $3)) ago. }
      if ($1 = K) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen being kicked from4 $4 (Kick Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
      if ($1 = P) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen parting4 $4 (Part Reason: $5- $+ ) $duration($calc($ctime - $3)) ago. }
      if ($1 = N) { .notice %xseen.nick 4 $+ %xseen.target 12was last seen changing his/her nick to4 $4 $duration($calc($ctime - $3)) ago. }
    }
    xdefclear
  }
  if (%idle.time.get = on) {
    .notice %idle.x 12Sorry4 %idle.x $+ 12,4 %idle.nick 12was not found on this server. Try 4!seen12 %idle.nick
    unset %idle.nick
    unset %idle.chan
    unset %idle.time.get
    unset %idle.x
    halt
  }
}

raw 319:*:{
  if (%xseen) {
    .notice %xseen.nick 12User4 $2 12is currently in:9 $3-
    .notice %xseen.nick 12Click a room(s) to join them, or type 4!search 12& I\'ll tell them you\'re looking for them.
    set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
    hadd -m xSeen %xseen.target S $nick $ctime
    xdefclear
    ;halt
  }
}

raw 317:*:{ 
  if (%xseen) { 
    .notice %xseen.nick 4 $+ $2 12was found on the server but not in any channel.
    .notice %xseen.nick 12If you would like me to inform4 $2 12you are looking for them, type 4!search
    set -u60 %xfind. [ $+ [ %xseen.nick ] ] %xseen.target
    hadd -m xSeen %xseen.target S $nick $ctime
    xdefclear
  }
  if (%idle.time.get = on) {
    set %temp.idle.time $3
    .notice %idle.x 4 $+ $2 12has been idle for4 $duration(%temp.idle.time)
    unset %temp.idle.time
    unset %idle.nick
    unset %idle.chan
    unset %idle.time.get
    halt 
  }
}
 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.