This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

whois script

Old posts that have not been replied to for several years.
Locked
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

whois script

Post by metroid »

Code: Select all

## Binds
bind raw - 311 Public:whois
bind raw - 319 Public:whois
bind raw - 312 Public:whois
bind raw - 330 Public:whois
bind raw - 318 Public:whois
bind pub o|o !whois Public:whois
## Procs
proc Public:whois {nick uhost hand chan text} {
  set person [lindex [split $text] 0]
  putserv "PRIVMSG $chan :4»» Whoise $person ..."
  putserv "WHOIS $person"
  if {[string match -nocase "*No such nickname*" $text]} {
    putserv "PRIVMSG $chan :4»» Unbekannte Person."
    return
  }
  if {[string match -nocase "*Whois*" $text]} {
    putserv "PRIVMSG $chan :4»» Whois: [lindex [split $text] 0] [lindex [split $text] 1] [lindex [split $text] 2]"
    return
  }
  if {[string match -nocase "*Server*" $text]} {
    putserv "PRIVMSG $chan :4»» Server: [lindex [split $text] 0]"
    return
  }
  if {[string match -nocase "*is authed as" $text]} {
    putserv "PRIVMSG $chan :4»» $person is authed as [lindex [split $text] 0]."
    return 0
  }
}
I get the errormessages:

Code: Select all

[20:53:27] <Q13> [20:53] Tcl error [Public:whois]: wrong # args: should be "Public:whois nick uhost hand chan text"
[20:53:27] <Q13> [20:53] Tcl error [Public:whois]: wrong # args: should be "Public:whois nick uhost hand chan text"
[20:53:27] <Q13> [20:53] Tcl error [Public:whois]: wrong # args: should be "Public:whois nick uhost hand chan text"
[20:53:27] <Q13> [20:53] Tcl error [Public:whois]: wrong # args: should be "Public:whois nick uhost hand chan text"
[20:53:27] <Q13> [20:53] Tcl error [Public:whois]: wrong # args: should be "Public:whois nick uhost hand chan text"
I don't understand how to fix it though :|
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Read the docs... (bind raw doesn't need the same args as pub does....) :roll:
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Blah.

It should be:

Code: Select all

bind pub n "!whois" my:proc

proc myproc {nick uhost hand chan text} {
 putserv "WHOIS [lindex $text 0]"
 return 0
}
Then bind raw's will automatically trigger your main proc, the long one which you showed! Use arguments {from keyword arg}.

Note: Do not 'return 0'. For all procs binding to "RAW" use 'return 1' that is better.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Well i didnt write it
Someone else did and he asked me to fix it and seeing as i didnt know how, i asked here :P
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I belive it should be "my:proc" not "myproc" and don't add "return 0" just to be there just in case like you usualy do with the "global botnick" :lol:
Once the game is over, the king and the pawn go back in the same box.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yeah well that was a typing error, I guess he has some common sense to understand that. Well to halt it, I would recommend you use the return command. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked