egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

kick script [Solved]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sat Feb 24, 2007 8:46 pm    Post subject: kick script [Solved] Reply with quote

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 Smile


Last edited by Torrevado on Sat Mar 03, 2007 11:31 am; edited 1 time in total
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Feb 25, 2007 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Feb 25, 2007 12:39 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Feb 25, 2007 12:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Feb 25, 2007 2:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Linux
Halfop


Joined: 04 Apr 2004
Posts: 71
Location: Under The Sky

PostPosted: Sun Feb 25, 2007 7:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Feb 25, 2007 8:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Feb 25, 2007 9:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Feb 25, 2007 10:08 pm    Post subject: Reply with quote

It works fine now, thanks Very Happy
Back to top
View user's profile Send private message
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Tue Jul 17, 2007 10:39 pm    Post subject: +v or ban Reply with quote

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
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 3:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Wed Jul 18, 2007 6:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 8:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Wed Jul 18, 2007 8:19 pm    Post subject: Reply with quote

yes.. to join the channel.. nicks not on the list would be kicked/banned
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Jul 18, 2007 8:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber