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
}
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
}
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!
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
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
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.
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
}
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 :)
I dont really do SSL, but im sure it can be done.