| View previous topic :: View next topic |
| Author |
Message |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sat Feb 24, 2007 8:46 pm Post subject: kick script [Solved] |
|
|
Hi,
I'd like a script to kick people who joins #channel B without being on a #channel A.
Eggdrop should show the kick' reason.
People who joins #channel A and not #channel B must not be punished...
Thanks in advance 
Last edited by Torrevado on Sat Mar 03, 2007 11:31 am; edited 1 time in total |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun Feb 25, 2007 6:20 am Post subject: |
|
|
| Code: | set channel(A) "#somechannel"
set channel(B) "#someotherchannel"
bind JOIN - * kick:join
proc kick:join {nick host hand chan} {
global channel;
if {[string equal -nocase $chan $channel(B)] && ![onchan $nick $channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
} |
|
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun Feb 25, 2007 12:39 pm Post subject: |
|
|
Thanks, it works
But... could this script add a feature to check every X minutes that people don't part #channel A after joining #channel B? If they are not on #channel A, eggdrop should kick them
Thanks again  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 25, 2007 12:50 pm Post subject: |
|
|
Add to metroid's code:
| Code: | bind time - {?0 *} check:chans
proc check:chans args {
global channel
foreach n [chanlist $channel(B)] {
if {![onchan $n $channel(A)]} {
putserv "KICK $channel(B) $n :Not allowed to be here."
}
}
} |
This will check every 10 minutes and kick all users in channel B that are not in channel A.
Edit: Fixed errors. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sun Feb 25, 2007 9:01 pm; edited 1 time in total |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun Feb 25, 2007 2:49 pm Post subject: |
|
|
uhm.... eggdrop kicks itself. It doesn't kick anybody else
| Code: | [19:30] Tcl error [
foreach n [chanlist $::channel(B)] {
if {![onchan $n $::channel(A)]} {
putserv "KICK $chan $nick :not allowed to be..."
}
}
]: invalid command name "30"
[19:30] @#channel A (+trnl 58) : [m/9 o/2 h/0 v/0 n/7 b/1 e/0 I/0]
[19:30] eggdrop kicked from #channel A by eggdrop: not allowed to be... |
The kick is on #channel A, to itself, there are no kicks on #channel B
Full script is:
| Code: | set channel(A) "#somechannel"
set channel(B) "#someotherchannel"
bind JOIN - * kick:join
proc kick:join {nick host hand chan} {
global channel;
if {[string equal -nocase $chan $channel(B)] && ![onchan $nick $channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
bind time - {?0 *} {
foreach n [chanlist $::channel(B)] {
if {![onchan $n $::channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
#
} |
|
|
| Back to top |
|
 |
Linux Halfop

Joined: 04 Apr 2004 Posts: 71 Location: Under The Sky
|
Posted: Sun Feb 25, 2007 7:49 pm Post subject: |
|
|
Replace:
| Code: | | if {![onchan $n $::channel(A)]} { |
From:
| Code: | | if {![onchan $nick $::channel(A)]} { |
(PS: Not Checked, try your luck.) _________________ I'm an idiot, At least this one [bug] took about 5 minutes to find... |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun Feb 25, 2007 8:26 pm Post subject: |
|
|
Now I have this in the console:
| Code: | [01:00] Tcl error [
foreach n [chanlist $::channel(B)] {
if {![onchan $nick $::channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
#
]: invalid command name "00"
[01:10] Tcl error [
foreach n [chanlist $::channel(B)] {
if {![onchan $nick $::channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
#
]: invalid command name "10"
|
There are no kicks... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 25, 2007 9:04 pm Post subject: |
|
|
My bad, I copied metroid's kick line so $chan and $nick became invalid variables. Use
| Code: | set channel(A) "#somechannel"
set channel(B) "#someotherchannel"
bind JOIN - * kick:join
bind time - {?0 *} check:chans
proc kick:join {nick host hand chan} {
global channel
if {[string equal -nocase $chan $channel(B)] && ![onchan $nick $channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
proc check:chans args {
global channel
foreach n [chanlist $channel(B)] {
if {![onchan $n $channel(A)]} {
putserv "KICK $channel(B) $n :Not allowed to be here."
}
}
} |
@Linux: Don't give a suggestion if you're not sure about it. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun Feb 25, 2007 10:08 pm Post subject: |
|
|
It works fine now, thanks  |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Tue Jul 17, 2007 10:39 pm Post subject: +v or ban |
|
|
Hello,
Can u tell me how to modify this script to check to see if a user that joins channel B is voiced on channel A and if not they will be kicked and banned?
Thanks |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 3:45 am Post subject: |
|
|
Use this:
| Code: |
set channel(A) "#somechannel"
set channel(B) "#someotherchannel"
bind JOIN - * kick:join
bind time - {?0 *} check:chans
proc kick:join {nick host hand chan} {
global channel
if {[string equal -nocase $chan $channel(B)] && [isvoice $nick $channel(A)]} {
putserv "KICK $chan $nick :Not allowed to be here."
}
}
proc check:chans args {
global channel
foreach n [chanlist $channel(B)] {
if {[isvoice $n $channel(A)]} {
putserv "KICK $channel(B) $n :Not allowed to be here."
}
}
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Wed Jul 18, 2007 6:49 pm Post subject: |
|
|
thanks awyeah but after trying this i realize its not what i really need. I have searched through many sites and pages of scripts and I am pretty sure there should be one like i need but cant find it. I am looking for a script that I can use to allow only certain nicks access to a channel. I dont want to use the userfile because there are quite a few nicks and alot dont have a set host. Do you happen to know of an existing script like that?
thanks again |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 8:18 pm Post subject: |
|
|
No, sorry I don't have any idea, neither I know about any script which can do that. What is ur definition of allowing certain nicks to access a channel? Allowing them to only join? or what? Please clarify. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Wed Jul 18, 2007 8:19 pm Post subject: |
|
|
| yes.. to join the channel.. nicks not on the list would be kicked/banned |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Jul 18, 2007 8:40 pm Post subject: |
|
|
These type of scripts are already present if you search the forum thoroughly. Anyway heres a short snipplet for you, as part of your request.
| Code: |
#Set channels you want this script to work on
set nicksnotallowed(chans) "#chan1 #chan2 #chan3"
#Set the nicks you want to allow in the channel seperated in a
#new line withing quotations marks. This is not case sensitive.
set nicksnotallowed(nicks) {
"nick1"
"nick2"
"nick3"
}
bind join - "*" nicks:not:allowed
proc nicks:not:allowed {nick uhost hand chan} {
global nicksnotallowed
if {[isbotnick $nick] || ![botisop $chan]} {return 0}
if {[lsearch -exact [split [string tolower $nicksnotallowed(chans)]] [string tolower $chan]] == -1} {return 0}
foreach user [split $nicksnotallowed(nicks)] {
if {[string equal -nocase $user $nick]} {
set foundnick 1; break
}
}
if {![info exists foundnick]} {
putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
putserv "KICK $chan $nick: Your nick is not allowed on this channel"
} else {
return 0
}
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
|