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.

kick script [Solved]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

kick script [Solved]

Post by Torrevado »

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.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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."
  }
}
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

Thanks, it works :wink:

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 :)
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Add to metroid's code:

Code: Select all

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.
Last edited by Sir_Fz on Sun Feb 25, 2007 9:01 pm, edited 1 time in total.
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

uhm.... eggdrop kicks itself. It doesn't kick anybody else

Code: Select all

[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: Select all

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." 
  } 
 } 
 # 
}
User avatar
Linux
Halfop
Posts: 71
Joined: Sun Apr 04, 2004 4:20 pm
Location: Under The Sky

Post by Linux »

Replace:

Code: Select all

if {![onchan $n $::channel(A)]} { 
From:

Code: Select all

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...
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

Now I have this in the console:

Code: Select all

[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...
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

My bad, I copied metroid's kick line so $chan and $nick became invalid variables. Use

Code: Select all

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.
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

It works fine now, thanks :D
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

+v or ban

Post by outthere »

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Use this:

Code: Select all

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.
==================================
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

yes.. to join the channel.. nicks not on the list would be kicked/banned
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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: Select all

#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.
==================================
Post Reply