egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get #auth on Mask

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sun Dec 14, 2008 5:23 am    Post subject: Get #auth on Mask Reply with quote

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
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Sun Dec 14, 2008 8:58 am    Post subject: Reply with quote

try:
Code:
putquick "privmsg $chan :Hello $nick ($nick!$host)"


:>
Back to top
View user's profile Send private message Visit poster's website
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sun Dec 14, 2008 9:01 am    Post subject: Reply with quote

Hello.

No, i just want the Auth-name:

"$auth"should be, in this case, "ZIMBORA"

Smile
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Sun Dec 14, 2008 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Dec 14, 2008 4:24 pm    Post subject: Reply with quote

Its better to use WHO with a special reply, raw 354 with %na arguments.
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Sun Dec 14, 2008 4:55 pm    Post subject: Reply with quote

Im using whois to check "account : " section.
It's just one line of output, can be easier? ;p
Back to top
View user's profile Send private message Visit poster's website
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Dec 14, 2008 7:44 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Dec 15, 2008 12:46 am    Post subject: Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Dec 15, 2008 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Mon Dec 15, 2008 7:47 am    Post subject: Reply with quote

now garfwen need to test them all ;p
Back to top
View user's profile Send private message Visit poster's website
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Tue Dec 16, 2008 3:31 pm    Post subject: hehhe Reply with quote

Hello Very Happy

They are all working.

Ty :]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber