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.

Problems with a script which adds users and give flags

Old posts that have not been replied to for several years.
Locked
S
S0nnY
Voice
Posts: 8
Joined: Tue Sep 07, 2004 9:52 am
Location: Germany

Problems with a script which adds users and give flags

Post by S0nnY »

Heloo together.
I have a Problem with the following scripts:

Code: Select all

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
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Re: Problems with a script which adds users and give flags

Post by De Kus »

  1. you would help us much posting formated text ><
  2. delete the 2nd set cflag "+v" and make the varible global or use it with the :: within the proc.
  3. 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.
  4. 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 :P (if you have more than 2 bots, it will cause pretty good spamming to the bots ^^)
  5. i dont know why it gets no flags, if the user didnt exist before ^-^
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

:idea: you might find the example procedure at the end of this tcl guide which does very much the same thing....
:mrgreen: and I agree with De Kus' assessment.......un-formatted tcl scripts suck!
Locked