| View previous topic :: View next topic |
| Author |
Message |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Sat Oct 04, 2008 12:38 pm Post subject: Public command for !gbanlist |
|
|
Hey,can someone write me tcl with public command for !gbanlist?
It should say his global bans,from userfile.. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Wed Oct 08, 2008 11:27 am Post subject: RE: Public command for !gbanlist |
|
|
| Code: | bind pub -|- !gbanlist gbanlist:pub
proc gbanlist:pub {nick host handle channel text} {
if {([llength [banlist]] == 0)} {
puthelp "NOTICE $nick :Global ban list is empty."
return 0
} else {
set count 0
foreach b [banlist] {
set count [expr $count +1]
if {([lindex $b 4] != 0) && ([lindex $b 2] != 0)} {
puthelp "PRIVMSG $nick :\[$count\] [lindex $b 0] ([lindex $b 1]) [join [ctime [lindex $b 4]]]"
puthelp "PRIVMSG $nick :Set By [lindex $b 5] on [join [ctime [lindex $b 3]]]. (expires [join [ctime [lindex $b 2]]])"
}
if {([lindex $b 4] != 0) && ([lindex $b 2] == 0)} {
puthelp "PRIVMSG $nick :\[$count\] [lindex $b 0] ([lindex $b 1]) [join [ctime [lindex $b 4]]]"
puthelp "PRIVMSG $nick :Set By [lindex $b 5] on [join [ctime [lindex $b 3]]]. (perm)"
}
if {([lindex $b 4] == 0) && ([lindex $b 2] != 0)} {
puthelp "PRIVMSG $nick :\[$count\] [lindex $b 0] ([lindex $b 1]) never used."
puthelp "PRIVMSG $nick :Set By [lindex $b 5] on [join [ctime [lindex $b 3]]]. (expires [join [ctime [lindex $b 2]]])"
}
if {([lindex $b 4] == 0) && ([lindex $b 2] == 0)} {
puthelp "PRIVMSG $nick :\[$count\] [lindex $b 0] ([lindex $b 1]) never used."
puthelp "PRIVMSG $nick :Set By [lindex $b 5] on [join [ctime [lindex $b 3]]]. (perm)"
}
}; puthelp "PRIVMSG $nick :$count Global bans."; return 1
}
} |
This is not tested, and the default is to output it to PM of the nickname that used the trigger '!gbanlist'. Unless there are no global bans, then it will notice the nickname this. To change this, to output it to notice the notice the banlist change ALL to -OR- to get output it to the channel where the command was used change ALL to . Also it currently allows anyone to use the command '!gbanlist' to change this you will need to add flags to the | Code: | | bind pub -|- !gbanlist gbanlist:pub | part. Example: if you wanted Global Ops to be able to use this command and no one else. Use: | Code: | | bind pub o|- !gbanlist gbanlist:pub | See Here for flags. And its in the form of <global flag>|<channel flag>  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Thu Oct 09, 2008 6:09 pm Post subject: |
|
|
Thanks man  |
|
| Back to top |
|
 |
|