bind pub -|- "!rdy" ::rdy
set cflag "+v"
proc ::rdy {nick host handle chan text} {
putserv "PRIVMSG $chan : $nick ist bereit"
if {![validuser $nick]} {
adduser $nick *!*@[lindex [split [getchanhost $nick $chan] @] 1]
foreach culist [userlist b] {
set user [lindex $culist 0]
putbot $user "%adduser $nick *!*@[lindex [split [getchanhost $nick $chan] @] 1]"
putlog "$nick added in the userlist"
set cflag "+v"
foreach culist [userlist b] {
set user [lindex $culist 0]
putbot $user "%gchattr $nick $cflag"
set anick "[nick2hand $nick]"
chattr $anick |$cflag $chan
putlog "$nick aka $anick has now $cflag @ $chan"
foreach culist [userlist b] {
set user [lindex $culist 0]
putbot $user "%chattr $anick $cflag $chan"
}
}
}
}
}
the bot adds the user in the userfile. but the bots adds no flags for the user who triggered rdy.
There is no error in the Partyline while triggering " !rdy ! in chan!
Can anyone help me with my script.
thx a lot
S0nnY
delete the 2nd set cflag "+v" and make the varible global or use it with the :: within the proc.
set anick "[nick2hand $nick]" <-- either you delete it, since adduser wont create a handle other than $nick or place it before you put the gchattr to the other bot(s) @_o.
if I see it right, you have stacked 3 foreach loops foreach culist [userlist b], you might want to delete the 2nd and 3rd, beauce they are pretty useless (if you have more than 2 bots, it will cause pretty good spamming to the bots ^^)
i dont know why it gets no flags, if the user didnt exist before ^-^
you might find the example procedure at the end of this tcl guide which does very much the same thing....
and I agree with De Kus' assessment.......un-formatted tcl scripts suck!