egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Public command for !gbanlist

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
DaRkOoO
Halfop


Joined: 27 Sep 2008
Posts: 67

PostPosted: Sat Oct 04, 2008 12:38 pm    Post subject: Public command for !gbanlist Reply with quote

Hey,can someone write me tcl with public command for !gbanlist?
It should say his global bans,from userfile..
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Oct 08, 2008 11:27 am    Post subject: RE: Public command for !gbanlist Reply with quote

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
Code:
PRIVMSG $nick
to
Code:
NOTICE $nick
-OR- to get output it to the channel where the command was used change ALL
Code:
PRIVMSG $nick
to
Code:
PRIVMSG $channel
. 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> Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
DaRkOoO
Halfop


Joined: 27 Sep 2008
Posts: 67

PostPosted: Thu Oct 09, 2008 6:09 pm    Post subject: Reply with quote

Thanks man Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber