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.

Public command for !gbanlist

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Public command for !gbanlist

Post by DaRkOoO »

Hey,can someone write me tcl with public command for !gbanlist?
It should say his global bans,from userfile..
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

RE: Public command for !gbanlist

Post by TCL_no_TK »

Code: Select all

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

Code: Select all

PRIVMSG $nick
to

Code: Select all

NOTICE $nick
-OR- to get output it to the channel where the command was used change ALL

Code: Select all

PRIVMSG $nick
to

Code: Select all

PRIVMSG $channel
. Also it currently allows anyone to use the command '!gbanlist' to change this you will need to add flags to the

Code: Select all

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: Select all

bind pub o|- !gbanlist gbanlist:pub
See Here for flags. And its in the form of <global flag>|<channel flag> :)
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Post by DaRkOoO »

Thanks man ;)
Post Reply