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.

calling dcc proc from msg proc

Old posts that have not been replied to for several years.
Locked
s
soul
Voice
Posts: 31
Joined: Fri Apr 25, 2003 6:25 pm
Location: Portugal

calling dcc proc from msg proc

Post by soul »

set login "L"
set b "[-] "

## delete cookie

bind part L * userinfopart
proc userinfopart { nick uhost hand chan msg } {
global login
if {[matchattr $hand L $chan]} {
chattr $hand -$login
dccbroadcast "$b$arg fez logout (part)"
}
return 0 }

bind sign L * userinfoquit
proc userinfoquit {nick uhost hand chan reason} {
if {[matchattr $hand L $chan]} {
chattr $hand -$login
dccbroadcast "$b$arg fez logout (sign)"
}
return 0 }
bind kick L * userinfokick
proc userinfokick {nick uhost hand chan target reason} {
if {[matchattr $hand L $chan]} {
chattr $hand -$login
dccbroadcast "$b$arg fez logout (kick)"
}
return 0 }
bind nick L * userinfonick
proc userinfokick {nick uhost hand chan newnick} {
if {[matchattr $hand L $chan]} {
chattr $hand -$login
dccbroadcast "$b$arg fez logout (nick change)"
}
return 0 }
putlog "userinfo-cookie.tcl"

## auth proc

bind msg U identificar msg:identificar
proc msg:identificar {nick uhost hand text} {
global login b
set pass [lindex $nick 0]
if {[passwdok $nick $pass]} {
putserv "notice $nick :identified!"
dcc:identificar { hand } ; return
} else {
putserv "notice $nick :not identified!" ; return
}
}

bind dcc b identificar dcc:identificar
proc dcc:identificar { hand } {
global login b
chattr $hand +$login
save
dccbroadcast "$b$hand fez login (pass auth)"
}
return }

###

i get a reply : "not identified!" when the pass is OK. why? did i confused $nick with $hand ?
am i calling right the bind dcc proc from the msg bind ? or setting calling non used vars inside bind msg?

regards,
i'll believe in justice when the pope is accused {
if {$true == "$censured" }{return nothing}}
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Are you sure this is what you want?

Code: Select all

set pass [lindex $nick 0] 
Setting the pass as the nick itself?

(Also, as mentioned a million times before in this forum and various other resources on the net concerning TCL, you MUST convert a string to a list when performing list operations, otherwise you leave yourself open for nastiness you don't want. Use [split $var] to convert to list before performing such functions as "lindex" on them.)
Locked