| View previous topic :: View next topic |
| Author |
Message |
achilles1900 Voice
Joined: 21 Apr 2008 Posts: 30
|
Posted: Wed Jul 23, 2008 5:19 am Post subject: Help With Bans in TCL Script |
|
|
Hi people,
the following is the bans section in Op Commands by xTc^bLiTz
I dont know TCL so i hope some kind soul can take a look at it work it out.
1. I would like the bot to ban with : *!*user@*.host.domain which it is currently not doing.
(FYI I do the public command !ban (nick) )
2. When I try to do !unban (nick) it tells me that there is no user in the banlist, although i see the host there. Anyway to fix this?
Thanks in advance for your time and efforts . Following is attached the TCL code
| Code: |
# Ban Process
proc proc_ban { nick uhost hand chan text } {
global botnick
if {[onchan $text]} {
if {$text == $botnick} { return 0 }
set banmask [getchanhost $text $chan]
putquick "MODE $chan +b $banmask"
putkick $chan $text :Requested
} else { putserv "PRIVMSG $chan :$text Is Not In The Channel" }
}
# Unban Process
proc proc_unban { nick uhost hand chan text } {
if {[ischanban $text $chan]} {
pushmode $chan -b $text
} else { putserv "PRIVMSG $chan :$text Is Not In The Ban List" }
}
|
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Jul 23, 2008 11:22 pm Post subject: |
|
|
It's the host you unban (as per the list), not the nick.
.i.e !unban *!*user@*.host.domain _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jul 24, 2008 10:16 am Post subject: |
|
|
Replace
| Code: | | [getchanhost $text $chan] |
with
| Code: | | [maskhost [getchanhost $text $chan]] |
as for !unbaning nick, use this proc instead of yours:
| Code: | # Unban Process
proc proc_unban { nick uhost hand chan text } {
set mask $text![getchanhost $text $chan]
set found 0
foreach ban [chanbans $chan] {
set ban [lindex $ban 0]
if {[string match -nocase $ban $mask]} {
pushmode $chan -b $ban
set found 1
}
}
if {!$found} {
puthelp "PRIVMSG $chan :$text Is Not In The Ban List"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Thu Jul 24, 2008 12:32 pm Post subject: |
|
|
| Mmmm... if the user is banned, I wouldn't suspect he's on the channel necessarily... so getchanhost will most likely fail. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Jul 24, 2008 1:26 pm Post subject: |
|
|
| strikelight wrote: | | Mmmm... if the user is banned, I wouldn't suspect he's on the channel neccessarily... so getchanhost will most likely fail. |
Good observation there, didn't think about it frankly so achilles1900, you want the bot to whois the banned nick and try to unban any bans set on it? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
achilles1900 Voice
Joined: 21 Apr 2008 Posts: 30
|
Posted: Thu Jul 24, 2008 5:41 pm Post subject: |
|
|
Hi Sir_FZ , strikealight & alchera,
thanks for your reply and help.
| Quote: | Good observation there, didn't think about it frankly so achilles1900, you want the bot to whois the banned nick and try to unban any bans set on it?
|
Yes that would be very helpful!  |
|
| Back to top |
|
 |
|