!whois script

By Stewie1k94 on Oct 17, 2011

I have made a whois dialog before, but,i though i'd make it like this aswell

command: !whois

must be a nick currently connected on the server.

dialog version: http://www.hawkee.com/snippet/8959/

on *:TEXT:*:#:{
  if ($1 == !whois) && ($2) {
    if ($($+(%,whois,$remove($chan,$chr(35))),5) == $null) {
      hadd -m whois chan $chan
      whois $2
      set -u20 $+(%,whois,$remove($chan,$chr(35))) on
    }
    else { .notice $nick This command can only be used once every 20 seconds! }
  }
}
raw 401:*:{ msg $hget(whois,chan) No such nick/channel: $2 | halt }
raw 311:*:{
  msg $hget(whois,chan) Nick: $2
  msg $hget(whois,chan) Real Name: $mid($gettok($2-,2,42),2,99) 
  msg $hget(whois,chan) Address: $mid($address($2,1),4,99)
  halt
}
raw 379:*:{ msg $hget(whois,chan) User Modes: $6- | halt }
raw 378:*:{ msg $hget(whois,chan) Host: $6 IP: $7 | halt }
raw 312:*:{ msg $hget(whois,chan) Using Server: $3 - $remove($4-,$chr(58)) | halt }
raw 319:*:{ msg $hget(whois,chan) Channels: $3- | halt }
raw 317:*:{
  msg $hget(whois,chan) Has Been Signed On For: $replace($duration($calc($ctime - $4)),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)
  msg $hget(whois,chan) Has Been Idle For: $replace($duration($3),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)
  halt
}

Comments

Sign in to comment.
Somsubhra1   -  Feb 06, 2016

Does this even show the secret and private channels in which the user is, too?

 Respond  
ovelayer   -  Mar 04, 2013

is there anyway to add to this script to see if a user is using an ssl connection and msg that as well?
thanks

Protheus  -  Aug 28, 2013

I dont really do SSL, but im sure it can be done.

Protheus  -  Jan 07, 2017

Here's my version, which does check for SSL. Forgive the colors:

on 900:TEXT:*:#:{
  if ($1 == !whois) && ($2) {
    if ($($+(%,whois,$remove($chan,$chr(35))),5) == $null) {
      hadd -m whois chan $chan
      whois $2
      set -u20 $+(%,whois,$remove($chan,$chr(35))) on
    }
    else { .msg This command can only be used once every 20 seconds! }
  }
}
raw 401:*:{ msg $hget(whois,chan) 3{14-14 3N14o such nick/channel:3 $2
  halt 
}
raw 301:*: {
  msg $hget(whois,chan) 3{14-14 3A14way: Yes: ( $+ $3- $+ ) 14-3} 
  halt
}
raw 307:*: {
  msg $hget(whois,chan) 3{14-14 3R14egistered 3N14ickname: Yes. 14-3} 
  halt
}
raw 310:*: {
  msg $hget(whois,chan) 3{14-14 3I14RC 3H14elper: Yes. 14-3} 
  halt
}
raw 311:*: {
  msg $hget(whois,chan) 3{14-14 3W14hois for $2 14-3}
  msg $hget(whois,chan) 3{14-14 3N14ick3N14ame: $2 14-3} 
  msg $hget(whois,chan) 3{14-14 3R14eal 3N14ame: $6- 14-3}
  msg $hget(whois,chan) 3{14-14 3I14dent: $3 14-3}
  msg $hget(whois,chan) 3{14-14 3A14ddress: *!*3@14 $+ $4 14-3}
  halt
}
raw 378:*: {
  msg $hget(whois,chan) 3{14-14 3H14ostmask: $6 14-3} 
  msg $hget(whois,chan) 3{14-14 3I14P: $7 14-3}
  halt
}
raw 379:*: {
  msg $hget(whois,chan) 3{14-14 3M14odes: $6- 14-3}
  halt
}
raw 671:*: {
  msg $hget(whois,chan) 3{14-14 3S14ecure 3C14onnection: Yes 14-3} 
  halt

}
raw 276:*: {
  msg $hget(whois,chan) 3{14-14 3C14lient 3C14ert 3F14ingerprint: $7 14-3}
  halt
}
raw 320:*: {
  msg $hget(whois,chan) 3{14-14 3N14etwork 3A14dministrator: Yes 14-3}
  halt
}
raw 330:*: {
  msg $hget(whois,chan) 3{14-14 3L14ogged in as: $2 14-3}
  halt
}
raw 312:*: {
  msg $hget(whois,chan) 3{14-14 3S14erver: $3 14-3}
  msg $hget(whois,chan) 3{14-14 3D14escription: $4- 14-3}
  halt
}

raw 313:*: {
  msg $hget(whois,chan) 3{14-14 3N14etwork 3R14ank: $5-9 14-3}
  halt
}
raw 319:*: {
  msg $hget(whois,chan) 3{14-14 3C14hannels: $Replace($3-,~,3~14,&,3&14,@,3@14,%,3%14,+,3+14) 14-3}
  halt
}
raw 317:*: {
  msg $hget(whois,chan) 3{14-14 3S14igned on at: $asctime($4,dddd mm/dd/yyyy HH:nn:sstt) 14-3}
  msg $hget(whois,chan) 3{14-14 3T14ime 3I14dle: $duration($3) 14-3}
  msg $hget(whois,chan) 3{14-14 3T14ime 3O14nline: $duration($calc($ctime - $4)) 14-3}
  halt
}
raw 335:*: { 
  msg $hget(whois,chan) 3{14-14 3B14ot: Yes. 14-3} 
  halt
}

raw 318:*: { 
  msg $hget(whois,chan) 3{14-14 3E14nd of 3W14hois 14-3} 
  halt
}
Sign in to comment

Stewie1k94   -  Nov 04, 2012

Updated with some Flood Protection.... > [1:00am] <~Stewie> !whois Stewie
[1:00am] <&thunderbolt> Nick: Stewie
[1:00am] <&thunderbolt> Real Name: Stewie
[1:00am] <&thunderbolt> Address: I@m.Sexy.Stewie
[1:00am] <&thunderbolt> Channels: (Not Showing Channels >.<)
[1:00am] <&thunderbolt> Using Server: Irc.Torn.Com - Torn's Server
[1:00am] <&thunderbolt> Has Been Signed On For: 9Hours 29Minutes 27Seconds
[1:00am] <&thunderbolt> Has Been Idle For: 2Seconds
[1:00am] <~Stewie> !whois Stewie
[1:00am] thunderbolt This command can only be used once every 20 seconds!

 Respond  
Stewie1k94   -  Nov 24, 2011

You just made my day xD

 Respond  
Jethro   -  Nov 24, 2011

toclafane1, we can use more gentlemen like you at Hawkee. ^^

 Respond  
Stewie1k94   -  Nov 24, 2011

Thanks.

 Respond  
Protheus   -  Nov 22, 2011

I use this for my bot, works fine for me. Had to change some things around though. 8/10. Good job, toclafane. Salut!

 Respond  
WorldDMT   -  Nov 03, 2011

tien de la pub!
kickban Wims Spammer hehehehe

 Respond  
Wims   -  Nov 03, 2011

Wims ça va toi? :)ça va et toi :)? tu devrais jeter un oeil a mon pacman et venir jouer!
Btw jethro, why don't you come play pacman with me if your avatar is a pacman one :(?

 Respond  
WorldDMT   -  Nov 02, 2011

lol jethro

 Respond  
Jethro   -  Nov 01, 2011

WorldDMT wrote:> Hey Jethro :)
it's been a long time how r u my friend?Hey, WorldDMT! Excuse me for the belated acknowledgment of your existence. My French comrade. It's been too long indeed. How's life treating you? It's nice seeing your words with that thick, unique French accent...:P lol

 Respond  
WorldDMT   -  Oct 31, 2011

hey Jethro :)
it's been a long time how r u my friend?

Wims ça va toi? :)

about the condition above it's like Wims told u

eg

    if ($left(#chan,1) == $chr(35)) {
      whois $2
    }
    else { whois $2 }

and

    if ($left(NickName,1) == $chr(35)) {
      whois $2
    }
    else { whois $2 }

both return "whois $2" so the condition is useless without mentioning other details that we can whois channel or not

 Respond  
Stewie1k94   -  Oct 25, 2011

And It's supposed to message the active channel, but it wont halt, it just keeps messaging the same thing, instead of stopping when it should!

 Respond  
Stewie1k94   -  Oct 25, 2011

Yes i wanted it to msg the active channel, sorry if it's not good enough :(

 Respond  
Jethro   -  Oct 25, 2011

it just keeps msging channel instead of haltingWhat do you mean? You set a variable for %whoisResult $chan

Didn't you intend to message the info to the active channel? Are we having some sort of a miscommunication here?

 Respond  
Wims   -  Oct 25, 2011

Not at all lol, re read the code you posted, it doesn't make sense to whois $2 if $2 doesn't 'exist'.
As to your original question, yes! Checking if the parameter is a channel doesn't make sense because indeed you cannot whois a channel, however, making a condition to finally doing the same thing is useless and that's a different thing, WorldDMT was pointing out that the same thing is done whatever the condition, he wasn't saying it doesn't make sense to whois a channel :p

 Respond  
Stewie1k94   -  Oct 25, 2011

And updated, but when i updated it, it just keeps msging channel instead of halting, no idea why

 Respond  
Stewie1k94   -  Oct 25, 2011

is it?

 Respond  
Jethro   -  Oct 25, 2011

I see what happens now. It's apparently missing a curly bracket, and the curly bracket between those two else conditions is needless:> if ($2) {
set %WhoisResult $chan
}
if ($left($2,1) == $chr(35)) {
whois $2
}
else { whois $2 }
else { msg $chan Syntax is !whois . }
}Still, though, the second if condition to check if $2 starts with # is redundant.

 Respond  
Jethro   -  Oct 25, 2011

I don't know, Wims, because $chr(35) equals to #, and $left($2,1) == $chr(35) has to mean the $2 starts with # to trigger the second if condition. Did I miss something here?

 Respond  
Wims   -  Oct 25, 2011

It's not because you can't whois a channel Jethro, it's because in all case the exact same thing is done "whois $2"

 Respond  
Stewie1k94   -  Oct 25, 2011

Can someone tell me why this wont halt anything, just keeps messaging the channel:

on $*:text:/^!whois\s(.*)/iS:#:{
  if ($2) {
    set %WhoisResult $chan
    whois $2 
  }
  else { msg $chan Syntax is !whois <nick to whois>. } 
}
raw 401:*:{ msg %WhoisResult No such nick/channel: $2 | halt }
raw 311:*:{
  msg %WhoisResult Nick: $2
  msg %WhoisResult Real Name: $mid($gettok($2-,2,42),2,99) 
  msg %WhoisResult Address: $mid($address($2,1),4,99)
  halt
}
raw 379:*:{ msg %WhoisResult User Modes: $6- | halt }
raw 378:*:{ msg %WhoisResult Host: $6 IP: $7 | halt }
raw 312:*:{ msg %WhoisResult Using Server: $3 - $remove($4-,$chr(58)) | halt }
raw 319:*:{ msg %WhoisResult Channels: $3- | halt }
raw 317:*:{
  msg %WhoisResult Has Been Signed On For: $replace($duration($calc($ctime - $4)),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)
  msg %WhoisResult Has Been Idle For: $replace($duration($3),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)
  halt
}
 Respond  
Jethro   -  Oct 24, 2011

toclafane1, WorldDMT is right though, you can who $chan but not whois $chan. :/

 Respond  
fraguk   -  Oct 24, 2011

its not returnin these 2 msg lines....
msg %WhoisResult Has Been Signed On For: $replace($duration($calc($ctime - $4)),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)
msg %WhoisResult Has Been Idle For: $replace($duration($3),wk, Week,min, Minute,sec, Second,day, Day,hr, Hour)

 Respond  
Stewie1k94   -  Oct 24, 2011

Really? Well you could do better?

 Respond  
WorldDMT   -  Oct 24, 2011

hi

    if ($left($2,1) == $chr(35)) { 
      whois $2
    }
    else { whois $2 }

this condition is useless

 Respond  
alabama   -  Oct 17, 2011

nice :)

 Respond  
Pangaea   -  Oct 17, 2011

nope ;)

its ok tho.. its good as it is

 Respond  
Jethro   -  Oct 17, 2011

Pan, use this one here:

on *:text:$($iif(!whois* iswm $strip($1),$1)):#:{
  var %2 = $strip($2)
  if ($nick isreg #) {
    msg # Sorry $nick $+ , you cannot use this command.
  }
  elseif (!%2) {
    msg # Syntax is !whois <nick to whois>.
  }
  else {
    set %WhoisResult #
    whois %2
  }
}
 Respond  
Pangaea   -  Oct 17, 2011

ok.. lets see now..neither suddgestions are working
toclafane. that 2nd script dosent seem to work at all, no matter if im voiced, oped, it just says
" Sorry Pangaea, you cannot use this command."

i replaced the line (ont he first orginal code)
if ($2) {
with jethros one, but, im getting a
syntax is !whois
if im deopped and devoiced
I took that line out
}
else { msg $chan Syntax is !whois . }
but the the script dosent work at all.

not sure what im doing wrong, but hey the script is ok as it is ,. nevermind :)

 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.