!seen - alternate method

By PuNkTuReD on Jun 16, 2011

this uses the "whois" and "nickserv info" command rather than storing random parts quite join etc etc etc

Command:
!seen [nick]

thanks to jethro_ for some tips to shorten the code.

;====================================
; ===================================
;
; !seen (nick)
; Made By PuNkTuReD
;
; ===================================
;====================================
on *:text:!seen *:#: { 
  if ($($+(%,seenwait),2)) { return }
  else { set -u5 %seenwait 5 | seen $2 }
}
alias seen {
  if ($1 ison $chan) { 
    if ($1 == $nick) { msg $chan You dont know where you are $+($nick,?) }
    elseif ($1 == $me) { msg $chan You can't see me $+($nick,?) }
    else { msg $chan $1 is on $+($chan,.) }
  }
  else { set -u5 %seen $chan | whois $1 }
}
raw *:*: {
  if (%seen) {
    if ($istok(307 310 311 312 313 314 317 318 320 335 371 378 379,$numeric,32)) { halt }
    elseif ($numeric == 319) { msg %seen $2 is on $3- }
    elseif ($numeric == 402) { nickserv info $2 | halt }
  }
}
on ^*:notice:*:*: {
  if ($nick == NickServ) && (%seen) {
    if ($count($1-,last seen time:,last quit message:)) { msg %seen $1- }
    if (isn't registered isin $1-) { msg %seen I can not retrieve any information on $+($2,.) }
    halt
  }
}

Comments

Sign in to comment.
Cheiron   -  Jun 19, 2011

12<20212:250pm12> !seen aucun
12<20212:250pm12> I can not retrieve any information on aucun.

yeap works :) nice one and a darn good script to boot also like and a 10 mate :)

 Respond  
PuNkTuReD   -  Jun 19, 2011

in the code, try to change 402, to 401...

the server i was on, had it as 402...

 Respond  
Cheiron   -  Jun 19, 2011

there is no 402 mate

its 401

-> cqchat.co.in WHOIS aucun
<- :cqchat.co.in 401 Cheiron aucun :No such nick/channel
<- :cqchat.co.in 318 Cheiron aucun :End of /WHOIS list.

 Respond  
PuNkTuReD   -  Jun 19, 2011

do a manual whois, to a nick who is offline.
what does raw 402 return?

 Respond  
Cheiron   -  Jun 19, 2011

doesnt return anything if user is not online

looking on bot status screen for an error i can see

nick No such nick/channel

could do with a fix please. otherwise awesome script

 Respond  
PuNkTuReD   -  Jun 16, 2011

good point, ive never thought of using count like that before.

 Respond  
Jethro   -  Jun 16, 2011

You can use $count() in place of || and isin like so:

if (Last seen time: isin $1-) || (Last quit message: isin $1-) { msg %seen $1- }

compared to:

if ($count($1-,last seen time:,last quit message:)) { msg %seen $1- }

These two conditions are pretty much the same thing, but one is shorter than the other as shown.

 Respond  
PuNkTuReD   -  Jun 16, 2011

good catch, thanks mate.

 Respond  
Jethro   -  Jun 16, 2011

Also, you have two if conditions under the seen alias with $2, I think they both should be $1

 Respond  
Jethro   -  Jun 16, 2011

Nice one using the raw events. But unfortunately Some hybrid irc networks don't support nickserv.

 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.