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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
deadman
Voice
Posts: 18 Joined: Mon May 08, 2006 6:32 pm
Post
by deadman » Sat Mar 24, 2007 8:33 pm
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Mar 25, 2007 8:21 pm
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.
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Thu Apr 03, 2008 8:04 pm
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
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?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Apr 04, 2008 7:10 am
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
}
}
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Fri Apr 04, 2008 11:39 am
Awesome! Thanks for the fast reply!
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Sat Apr 19, 2008 8:47 pm
How would you edit the script to make it a timed ban?
Thanks
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat Apr 19, 2008 9:04 pm
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.
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Sat Apr 19, 2008 9:18 pm
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
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Fri Aug 08, 2008 1:04 am
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.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat Aug 09, 2008 11:29 am
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."
}
}
outthere
Voice
Posts: 33 Joined: Sat Nov 26, 2005 7:25 pm
Post
by outthere » Sat Aug 09, 2008 1:24 pm
Thank you!