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

Post by outthere »

Wow... thanks a bunch. This is what I have been looking for. Would it be possible to allow others to add to the list, without having to edit the script? Like !add nick ? anyways this works for me :D
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yeah that can be done, but you would have to make a file on the shell to add or delete nicknames and store them in it. It would be a bit more complicated as each nick would be to have an entry on a channel.

Something like: "nick:#chan" can be stored for each entry.

I am currently busy at the moment. Goodluck, hope someone else can do the rest for you, heh. :P

I did make a script of a similar sort recently, which utilizes the same exact database structure, but its for adding/deleting auto-voice users from a channel. Maybe you can have a look at it and try to work on it yourself:

Here is the link:
http://channels.dal.net/awyeah/scripts/voiceserv.tcl
·­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 »

Cool. I will take a look at it. Thanks again for your help.

Nice looking script. In fact that is how I need to add nicks to the allow list, with different levels of access. Maybe I can figure out how to replace a few things and make it work.. then again maybe not. :lol:
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

hmm.. the bot is banning nicks in the list.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The code seems perfectly OK, not sure why that is happening. Try this:

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}
 if {[lsearch -exact [split [string tolower $nicksnotallowed(nicks)]] [string tolower $nick]] == -1} {
   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.
==================================
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

still banning users in the list. dunno.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Replace these lines:

Code: Select all

 if {[lsearch -exact [split [string tolower $nicksnotallowed(nicks)]] [string tolower $nick]] == -1} {
   putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
   putserv "KICK $chan $nick: Your nick is not allowed on this channel"
  } else {
   return 0
  }
}
with these and then try:

Code: Select all

 if {[lsearch -exact [split [string tolower $nicksnotallowed(nicks)]] [string tolower $nick]] != -1} {return 0}
  putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
  putserv "KICK $chan $nick: Your nick is not allowed on this channel"
  return 0
}
·­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 »

same thing..
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I've tried three different variations of the script, still the same, meaning you are using some other scripts which are counter kicking those users, because the script I coded for you is correct, no logic problem what so ever.

Remove all scripts and only use the one I gave. Then restart and then check the bot.
·­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 »

ok i did that and got same thing again.. i did have other scripts but i didnt load them and did a restart. maybe i should use a fresh bot. thanks for all the help i will try on a new one tomorrow. :?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

*scratches* his head and wonders why..
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply