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.

ban counter

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

ban counter

Post by EEggy »

Hi, i found this ban counter script at egghelp.org, but script counts doesn't match with bot's dcc commands .bans all's output , not even close

I'llapprecite for the help
thanks

Code: Select all

# Ban Counter by BarkerJr
#
# Usage: .bans [channel]
# If channel is not specified, the current channel is assumed.

# Set this to the prefix you use for commands ("" if you don't want a prefix)
#set cmdchar "."

bind pub - ${cmdchar}bans pub:bans

proc pub:bans {nick uhost hand chan arg} {
  set ctr 0
  if {![validchan $arg]} {
    if {$arg != ""} {
      puthelp "PRIVMSG $chan :Bans: Invalid channel, assuming current channel"
    }
    set arg $chan
  }
  set bans [banlist $arg]
  while {[lindex $bans $ctr] != ""} {
    set ctr [expr $ctr + 1]
  }
  set banctr $ctr
  set bans [banlist]
  while {[lindex $bans $ctr] != ""} {
    set ctr [expr $ctr + 1]
  }
  puthelp "PRIVMSG $chan :Bans: [expr $banctr + $ctr]"
  return 1
}
[/code]
EEggy
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: ban counter

Post by Sir_Fz »

EEggy wrote:Hi, i found this ban counter script at egghelp.org, but script counts doesn't match with bot's dcc commands .bans all's output , not even close

I'llapprecite for the help
thanks

Code: Select all

# Ban Counter by BarkerJr
#
# Usage: .bans [channel]
# If channel is not specified, the current channel is assumed.

# Set this to the prefix you use for commands ("" if you don't want a prefix)
#set cmdchar "."

bind pub - ${cmdchar}bans pub:bans
[snip]
the public .bans command will show you how many bans have been set in the channel, the dcc .bans all command shows you all global bans in this channel and other channels.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: ban counter

Post by user »

An insane ammount of code to do such a simple task :)

Code: Select all

expr {[llength [banlist]]+[llength [banlist #chan]]}
Locked