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.

HELP! need a script that will restrict a channel.

Old posts that have not been replied to for several years.
Locked
s
soulja

HELP! need a script that will restrict a channel.

Post by soulja »

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?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

take a look in the tcl-archive. should be some scripts which does this in there
Elen sila lúmenn' omentielvo
s
soulja

Post by soulja »

yeah, i found that tcl before i even wrote this post.

But rather than using someone elses code, i'd rather make one myself or at least know how it works.

i want to learn TCL just like i learned mirc scripting, visual basics, and C++.. thats why.

so if anyone thinks that can help me learn or explain the coding to this TCL than please help.

btw, Papillon, thanx for the reply :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

there's lots of way to learn tcl...
u can learn by reading the tutorials all over the net... some good links on this site.
u can learn by studying the tcl-commands.doc on your eggdrop.. though this only applies to eggdrop related tcl-codes..
and perhapse one of the most important things ... study other codes.. try splitting them and to understand what they do :)

start making a code... and when you are stuck.. come here and ask again.. we'll be happy to help... but we ain't (usually) making you're scripts for you ;)
Elen sila lúmenn' omentielvo
s
soulja

Post by soulja »

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"
ok fellas, this code was taken right out of the TCL that i found written by CrazyCat.

Now, wut i am trying to do is learn/understand TCL but i am having a hard time with it. Maybe one of you guys out there that know wut ur doing can take some time to help me. Maybe an explanation of wut each line does will help.

Remember, i am a total beginner at this. (Today is my first day so go easy on me). I script very well for mirc, and this doesnt seem that different so I think I will get the hang of it soon.

So all i ask is that someone give me a line by line explanation to this TCL code so i can understand it better.

thanx :D
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

First off, Tcl is nothing like mIRC script.

The format of various commands can vary from item to item, which can be confusing.

Tcl ont he other hand, uses a simple sturcture, from which everything is based. once you know the structure, you only need to know the commands.

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"
Items enclose in [] are avaluated, and there return values, is used in return. This is simalar to the $blah() identifiers in mIRC.

All the other commands, you will have to read either in the Tcl manual or from tcl-commands.doc int he eggdrop's docs directory.
s
soulja

Post by soulja »

thanks alot ppslim.. I understand it a little better now :D

i still have one question though. this code supposedly only lets people in the channel (#dummy) if they are on the list.

my question is, where is this list and how are users added/removed?

sorry for all the questions but im slowly learning thanks to u guyz. :wink:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As stated, many commands are provided by Tcl itself. Other are provided by eggdrop, for interaction and information retrieval.

As such, the script uses commands provided by eggdrop, to see if the user is in the eggdrops internal userlist.

As such, it is eggdrops own internal userlist that is used. This can be manipulated via commands inside the partyline.
User avatar
mcdarby
Halfop
Posts: 69
Joined: Tue Jul 16, 2002 7:46 pm
Location: Bangor, Pennsylvania
Contact:

Re: HELP! need a script that will restrict a channel.

Post by mcdarby »

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?
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.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This can produce odd reasults.

It's all well and good, for a small eggdrop userbase (owner, and a few helpers). However, once you start using the bot for channel managment, and a few fancy scripts, it can start producing odd results, where one min it matches a user correctly, next, the user is kicked.
Locked