| View previous topic :: View next topic |
| Author |
Message |
deadman Voice
Joined: 08 May 2006 Posts: 18
|
Posted: Sat Mar 24, 2007 8:33 pm Post subject: kick user not in list |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 25, 2007 8:21 pm Post subject: |
|
|
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: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Thu Apr 03, 2008 8:04 pm Post subject: this is what i have been looking for! |
|
|
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?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Apr 04, 2008 7:10 am Post subject: |
|
|
| Code: | 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
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Fri Apr 04, 2008 11:39 am Post subject: |
|
|
Awesome! Thanks for the fast reply!
 |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Sat Apr 19, 2008 8:47 pm Post subject: |
|
|
How would you edit the script to make it a timed ban?
Thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Apr 19, 2008 9:04 pm Post subject: |
|
|
Add a timer to remove the ban after x minutes. For example:
| Code: | | timer 10 [list pushmode $chan -b *!*@[lindex [split $uhost @] 1]] |
This will remove the ban after 10 minutes from setting it. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Sat Apr 19, 2008 9:18 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Fri Aug 08, 2008 1:04 am Post subject: !delete user |
|
|
| 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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Aug 09, 2008 11:29 am Post subject: |
|
|
| Code: | 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."
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
outthere Voice
Joined: 26 Nov 2005 Posts: 33
|
Posted: Sat Aug 09, 2008 1:24 pm Post subject: |
|
|
| Thank you! |
|
| Back to top |
|
 |
|