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.

simple tcl question

Old posts that have not been replied to for several years.
Locked
M
MarlbMan
Voice
Posts: 20
Joined: Tue Apr 15, 2003 9:20 pm

simple tcl question

Post by MarlbMan »

hello all... I have installed restrict.tcl on my eggy, and would like to modify it a bit, but I am a TCL dummy. It allows anyone in the userlist to enter a channel, those who are now, are kicked/temp banned on join. Brilliant idea, and I appreciate the script writers effort, but I would like to change it a bit so that it allows people in the userlist with a certain flags. I think this is the line that needs changed.

if { ![validuser $hand] } {

any help would be appreciated, I have had to remove my auto-voices and a few of my auto-ops just to lock down this channel to the appropriate user list. (and no, I dont want to +k or +i the channel, I've been through that, the whole reason I went with this script was to get away from that)
M
MarlbMan
Voice
Posts: 20
Joined: Tue Apr 15, 2003 9:20 pm

better reference

Post by MarlbMan »

This script is small, so for better reference, here is a bigger exerpt.

set r_chan "#complete-servers"

set r_time 60

bind join -|- "$r_chan *!*@*" out

proc out { nick uhost hand chan } {
global r_ban r_time r_chan
if {![file exists restrictkick]} {
set rnum [open restrictkick w]
puts $rnum "0"
close $rnum
}

set rnum [open restrictkick r]
gets $rnum knum
close $rnum
set cnum [expr $knum + 1]
set rnum [open restrictkick w]
puts $rnum "$cnum"
close $rnum

if { ![validuser $hand] } {
newchanban $chan [string trimleft [maskhost [getchanhost $nick $chan]] ~] neutralized " ReSTRICTED CHANNeL! \[\002\037$cnum\002\037|\002\037$r_chan\002\037\]" $r_time

}
}

putlog "Restrict 1.2 loaded <\002quantum\002>"
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The "matchattr" will do fine. You should see the tcl-commands.doc file and read all about it.
Once the game is over, the king and the pawn go back in the same box.
M
MarlbMan
Voice
Posts: 20
Joined: Tue Apr 15, 2003 9:20 pm

ok... I'm a tcl n00b... obviously...

Post by MarlbMan »

OK... took your advice, but I must be doing something wrong... can someone please tell me where I screwed up and how to fix it? I get this error.

[13:56] <CW-Bot> "proc out { nick uhost hand chan }"
[13:56] <CW-Bot> (file "scripts/restricted.tcl" line 21)
[13:56] <CW-Bot> invoked from within

from this script:

bind join -|- "$r_chan *!*@*" out

proc out { nick uhost hand chan } {
global r_ban r_time r_chan
foreach user [chanlist $r_chan] {
if {![matchattr] $hand S]} { halt }
if {![file exists restrictkick]} {
set rnum [open restrictkick w]
puts $rnum "0"
close $rnum
}

set rnum [open restrictkick r]
gets $rnum knum
close $rnum
set cnum [expr $knum + 1]
set rnum [open restrictkick w]
puts $rnum "$cnum"
close $rnum

if { ![validuser $hand] } {
newchanban $chan [string trimleft [maskhost [getchanhost $nick $chan]] ~] neutralized " ReSTRICTED CHANNeL! \[\002\037$cnum\002\037|\002\037$r_chan\002\037\]" $r_time

}
}
M
MarlbMan
Voice
Posts: 20
Joined: Tue Apr 15, 2003 9:20 pm

found an answer

Post by MarlbMan »

OK folks... found the answer, thanks
Locked