Code: Select all
set r_chan "#dummy"
set r_ban 1
# if 0, the tcl just kick the user
set r_time 60
# duration of ban, 0 for perm, in minutes
bind join -|- "$r_chan *!*@*" out
proc out { nick uhost hand chan } {
global r_ban r_time r_chan
if { ![validuser $hand] } {
putserv "KICK $chan $nick :you're not allowed to be here"
if { $r_ban == 1 } {
newchanban $chan [string trimleft [maskhost [getchanhost $nick $chan]] ~] CrazyHelp "May find your channel" $r_time
}
}
}
putlog "Restrict 1.1 loaded"
Code: Select all
## "set" is a command. Like in mIRC, it is used to create a variable.
## In this case, the variable name is r_chan, and has a value of "#dummy"
set r_chan "#dummy"
set r_ban 1
# if 0, the tcl just kick the user
set r_time 60
# duration of ban, 0 for perm, in minutes
## "bind" is a eggdrop tcl command. It is used to setup event callbacks.
## Event callbacks are simalar to mIRC's "on join:, on text:".
## You tell it what event to look for, the flags a user must have (this is the user that triggers the event)
## Next is the matching text, IE, for channel messages, it matches it agaiunst that
## Last is the command that should be called, when the event matches.
bind join -|- "$r_chan *!*@*" out
## "proc" is a command that creates a new command, and tells it what to name the arguments being sent to it.
## Simalar to the alias command in mIRC. Though you don't use $1, $2 in Tcl, you give each item being sent a name
proc out { nick uhost hand chan } {
## In mIRC, if a variable is created, it can be used by any script
## In Tcl, you have to create it globaly (outside the proc) to use it anywhere.
## Global allow you access to these variables. Youc an also make a var global, if you wish to create or change the var inside the proc.
global r_ban r_time r_chan
## If, very same to mIRC, though the format is different
if { ![validuser $hand] } {
putserv "KICK $chan $nick :you're not allowed to be here"
if { $r_ban == 1 } {
newchanban $chan [string trimleft [maskhost [getchanhost $nick $chan]] ~] CrazyHelp "May find your channel" $r_time
}
}
}
putlog "Restrict 1.1 loaded"
What you should do is instead of looking for a TCL script to do that, try adding a user entry called "AllUsers" with the hoskmask of *!*@* and set the +k flag to it. I think that would do what your asking for.soulja wrote:Ok, i need my egg to hold a User list and only allow the people that are on the list to join the channel. does anyone know how to do this?
i am a total beginner at this. I made a bot for mirc that does this, but now i want my egg to do it and i have no idea how to script TCL's or wutever they call it.. lol
can someone help me out?