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.
Old posts that have not been replied to for several years.
edze
Voice
Posts: 2 Joined: Tue Jul 12, 2005 8:43 am
Post
by edze » Tue Jul 12, 2005 8:52 am
Code: Select all
bind pub - !123 123
set uname " "
proc 123 {nick host hand chan rest args} {
global uname
putserv "WHOIS $nick"
puthelp "PRIVMSG $chan :$uname"
}
proc get_whois { from keyword args } {
global uname
set largs [split $args " "]
set uname [lindex $largs 2]
}
bind raw - "330" get_whois
I've written this script, where I want to get the auth of qnet.
But now I have this problem:
[14:46] <[DuL]edze> !123
[14:47] <edze-bot>
[14:47] <[DuL]edze> !123
[14:47] <edze-bot> edze
The bot shows only every second instruction the right authnick.
How can I correct this?
P.S. Sorry for my bad English.
MfG edze
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Tue Jul 12, 2005 8:59 am
You almost had it right. I just re-juggled your procs around a bit
Code: Select all
bind pub - !123 123
bind raw - "330" get_whois
proc 123 {nick uhost hand chan arg} {
putserv "WHOIS $nick"
}
proc get_whois { from keyword arg } {
set uname [lindex [split $arg] 2]
puthelp "PRIVMSG $chan :$uname"
}
This should do the trick although I haven't tested it.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Jul 12, 2005 9:06 am
That will not work since there's no $chan in the raw proc. Try:
Code: Select all
bind pub - !123 123
bind raw - "330" get_whois
proc 123 {nick uhost hand chan arg} {
putserv "WHOIS $nick"
set ::requested $chan
}
proc get_whois { from keyword arg } {
set uname [lindex [split $arg] 2]
if {[info exists ::requested]} {
puthelp "PRIVMSG $::requested :$uname"
unset ::requested
}
}
edze
Voice
Posts: 2 Joined: Tue Jul 12, 2005 8:43 am
Post
by edze » Tue Jul 12, 2005 9:19 am
Thank you!
It's work now.
MfG EdZe
^DooM^
Owner
Posts: 772 Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:
Post
by ^DooM^ » Tue Jul 12, 2005 5:24 pm
Ahh well spotted mr fz
I should really debug my own work ;P
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Wed Jul 13, 2005 1:33 am
If you want to retrieve the auth info you might aswell use RAW 354 as it's much more specific.
Code: Select all
bind pub -|- !123 get:auth
bind raw -|- 354 raw:auth
proc get:auth {nick host hand chan args} {
if {[lindex [split $args] 0] == ""} {
putquick "WHO $nick n%na"
} else {
putquick "WHO [lindex [split $args] 0] n%na"
}
set ::return $chan
}
proc raw:auth {server raw args} {
if {[info exists ::return]} {
putquick "PRIVMSG $::return :[lindex [split $args] 0] is authed as [lindex [split $args] 1]"
unset ::return
}
}
Something like this should do the trick, you can use !123 <nothing> to get your own auth or !123 <nickname> to get someone's authname