| View previous topic :: View next topic |
| Author |
Message |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sun Dec 14, 2008 5:23 am Post subject: Get #auth on Mask |
|
|
Hello.
On quakenet, when you'r authed, you can see you'r auth on your mask:
GaRfWeN!GaRfwen@ZIMBORA.users.quakenet.org
("ZIMBORA" is the #auth)
| Code: |
bind pub - hello proc:hello
proc proc:hello {nick host hand chan text} {
putquick "privmsg $chan :Hello $nick (#$auth)"
}
|
Now my question is how can i put the AUTH-NAME on the variable $auth ?
Ty,
GaRfWeN |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Sun Dec 14, 2008 8:58 am Post subject: |
|
|
try:
| Code: | | putquick "privmsg $chan :Hello $nick ($nick!$host)" |
:> |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sun Dec 14, 2008 9:01 am Post subject: |
|
|
Hello.
No, i just want the Auth-name:
"$auth"should be, in this case, "ZIMBORA"
 |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Sun Dec 14, 2008 9:58 am Post subject: |
|
|
better to use WHOIS command than parse user host:
| Code: | # Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
set auth_chans {#chan1 #chan2}
##################################################
bind pub - hello hello_proc
bind raw - 330 whois_proc
proc hello_proc { nick uhost hand chan arg } {
global user_irc_name user_irc_chan auth_chans
if {[lsearch $auth_chans $chan] != -1} {
set user_irc_name $nick
set user_irc_chan $chan
putserv "WHOIS $nick"
}
}
proc whois_proc { from keyword arg } {
global user_irc_name user_irc_chan
set list_of_args [split $arg]
set auth_name [lindex $list_of_args 2]
if {($auth_name != "") && ($keyword == 330)} {
putquick "PRIVMSG $user_irc_chan :Hello $user_irc_name (\#$auth_name)"
}
}
putlog "show-auth.tcl ver 0.1 by tomekk"
|
try :> |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Dec 14, 2008 4:24 pm Post subject: |
|
|
Its better to use WHO with a special reply, raw 354 with %na arguments. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Sun Dec 14, 2008 4:55 pm Post subject: |
|
|
Im using whois to check "account : " section.
It's just one line of output, can be easier? ;p |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Dec 14, 2008 7:44 pm Post subject: |
|
|
Its infact 5 lines of output, but your only processing a certain line from the whois reply. WHO is however one line of output. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Dec 15, 2008 12:46 am Post subject: |
|
|
In this case, adding another callback seems overkill to me, given the nature of the network.
| Code: | bind pub - hello proc:hello
proc proc:hello {nick host hand chan text} {
set auth ""
regexp {[^[:space:]@]+@([^[:space:].]+)\.users.quakenet.org} $host match auth
putquick "privmsg $chan :Hello $nick (#$auth)"
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Dec 15, 2008 5:32 am Post subject: |
|
|
| Code: | bind join - {*} hello:join
bind raw - {354} hello:raw
proc hello:join {n u h c t} {
global hello
if {[string match -nocase *users.quakenet.org $h]} {
putserv "PRIVMSG $c :Hello $n ([lindex [split [lindex [split $h @] 1] .] 0])"
} elseif {![info exists hello([string tolower $n])]} {
set hello([string tolower $n]) "$c"
putserv "WHO $n %nat,97"
}
}
proc hello:raw {from raw arg} {
global hello
set t [lindex [split $arg] 1]
set n [lindex [split $arg] 2]
set a [lindex [split $arg] 3]
if {![info exists hello([string tolower $n])]} { return }
set c "$hello([string tolower $n])"
unset hello([string tolower $n])
if {$t == "97"} {
if {$a != "" && $a != "0"} {
putserv "PRIVMSG $c :Hello $n ($a)"
} else {
putserv "PRIVMSG $c :Hello $n"
}
}
} |
Untested.. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Mon Dec 15, 2008 7:47 am Post subject: |
|
|
| now garfwen need to test them all ;p |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Tue Dec 16, 2008 3:31 pm Post subject: hehhe |
|
|
Hello
They are all working.
Ty :] |
|
| Back to top |
|
 |
|