| View previous topic :: View next topic |
| Author |
Message |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Sat Sep 27, 2008 7:40 am Post subject: Script for public command !banlist and for # ban |
|
|
Hey guys,can somebody write me tcl which will reacts when I type "!banlist" in some channel,and then he will say all bans in that channel..also public..I tried to edit code that I find in manager.tcl :
| Code: | # Usage: !banlist
proc pub:banlist {nick host hand chan arg} {
global botnick
putserv PRIVMSG $chan "\002Global bans:\002"
if {[banlist] == ""} {
putserv "PRIVMSG $chan :None."
} else {
foreach ig [banlist] {
set what [lindex $ig 0]
set by [lindex $ig 5]
set comment [lindex $ig 1]
putserv "PRIVMSG $chan : "$what - by $by, Reason: $comment"
}
}
putserv "PRIVMSG $chan : Bans for $chan:"
if {[banlist $chan] == ""} {
putserv "PRIVMSG $chan :None."
} else {
foreach b [banlist $chan] {
set what [lindex $b 0]
set by [lindex $b 5]
set comment [lindex $b 1]
putserv "PRIVMSG $chan : $what - by #4$by#, Reason: $comment"
}
}
putserv "PRIVMSG $chan : End Of Banlist."
putcmdlog "<<$nick>> !$hand! banlist $chan"
} |
And second tcl..I need script that will ban anyone who writes *#* in channel #bla..And I wanna to add more channels,2 or 3 ,but not all channels bot is on.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Sep 27, 2008 11:20 am Post subject: |
|
|
This should display the channel-bans after requesting !banlist (feel free to modify it).
| Code: | bind pub - !banlist proc:banlist
proc proc:banlist {nick uhost hand chan arg} {
foreach b [chanbans $chan] {
puthelp "privmsg $chan :[lindex $b 0] by [lindex $b 1]"
}
} |
As for the second request, there are tons of anti-advertising/bad words scripts in the Tcl archive. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Sat Sep 27, 2008 11:45 am Post subject: |
|
|
I tried tons of them, but no one works like i want.They usually works for all chanells and i need it just for few chanells which i can add and remove.
[EDIT] - Okey,I made this from few tcl scripts :
| Code: | bind pubm -* "*#*" badchar:pub
# Define the channel where u want the kickbans to work:
set bchan "#botchan"
proc badchar:pub {nick uhost hand chan arg} {
global bchan
if {$chan == "#botchan"} {
if {[botisop $bchan]} {
putquick "MODE $bchan +b *!*@[lindex [split $uhost @] 1]"
putserv "KICK $bchan $nick :Bad Character"
}
}
} |
Now..I need to have an option that will protect channel ops (will not kick @'s even if they say # on some channel) ..But I need to can put 1 ( protect @'s) ,and 2 (don't protect ops)..And I wanna to can add more channels.. |
|
| Back to top |
|
 |
|