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 user not in list

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
deadman
Voice
Posts: 18
Joined: Mon May 08, 2006 6:32 pm

kick user not in list

Post by deadman »

hi guys
is there away to kick a user that is not in a text file
i.e use the command !add <nick>

bot adds nick to db.txt

user joins channel bot ignores user

user not added to db.txt ..... bot will kick from channel and keep kicking till the third join and then set channel ban

thanks guys
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Why not create a handle, give it a specific flag, and then add the nicks to this handle. This way, instead of checking if the nick is in a text file, you just check if the user has that specific flag.

Code: Select all

bind pub n|n !add add:nick
bind join - "#channel *" kick:et

proc add:nick {nick uhost hand chan arg} {
 if {![validuser allowed]} {
  adduser allowed
  chattr allowed +A
 }
 set n [string tolower [lindex [split $arg] 0]]!*@*
 if {[lsearch -exact [getuser allowed HOSTS] $n] == -1} {
  setuser allowed HOSTS $n
  puthelp "privmsg $chan :Added $n to allowed list."
 }
}

proc kick:et {nick uhost hand chan} {
 if {![matchattr $hand A|A $chan]} {
  putserv "kick $chan $nick :ETs not allowed."
 }
}
This way, only +A users will be allowed on #channel.
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

this is what i have been looking for!

Post by outthere »

I have been searching for this exact script and finally found it. Could you please add 2 features?

1. kick and ban
2. voice the user if nick is allowed

Thanks in advance

:D

now that i think of it.. maybe 1 one thing? put a notice to the user that lets them know they are added to the list? :wink:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub n|n !add add:nick
bind join - "#channel *" kick:et

proc add:nick {nick uhost hand chan arg} {
 if {![validuser allowed]} {
  adduser allowed
  chattr allowed +A
 }
 set n [string tolower [lindex [split $arg] 0]]!*@*
 if {[lsearch -exact [getuser allowed HOSTS] $n] == -1} {
  setuser allowed HOSTS $n
  puthelp "privmsg $chan :Added $n to allowed list."
  puthelp "notice [lindex [split $arg] 0] :You've been added to the allowed list on $chan"
 }
}

proc kick:et {nick uhost hand chan} {
 if {![matchattr $hand A|A $chan]} {
  putserv "kick $chan $nick :ETs not allowed."
  pushmode $chan +b *!*@[lindex [split $uhost @] 1]
 } {
  pushmode $chan +v $nick
 }
}
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

Awesome! Thanks for the fast reply!

:D
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

How would you edit the script to make it a timed ban?

Thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Add a timer to remove the ban after x minutes. For example:

Code: Select all

timer 10 [list pushmode $chan -b *!*@[lindex [split $uhost @] 1]]
This will remove the ban after 10 minutes from setting it.
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

That easy huh? I am picking up on this a little bit. I did some modification to the script and it worked! lol..

thanks again
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

!delete user

Post by outthere »

Ok how would I be able to !delete the user? I have tried adding a new process but it is not working correctly. I tried to use the !add as a guide.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub n|n !del del:nick

proc del:nick {nick uhost hand chan arg} {
 set n [lindex [split $arg] 0]
 if {[validuser allowed] && [delhost allowed $n!*@*]} {
  puthelp "privmsg $chan :Removed $n from allowed list."
  puthelp "notice $n :You've been removed from the allowed list on $chan."
 } {
  puthelp "privmsg $chan :$n is not on the allowed list." 
 }
}
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

Post by outthere »

Thank you!
Post Reply