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.

[SOLVED] Channels bans problem

Old posts that have not been replied to for several years.
Locked
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

[SOLVED] Channels bans problem

Post by Aron »

I wrote a piece of code to show the bot's banlist, both in the channel as on a website.
When people type !banlist in the channel, i want to count the bans, and if its greater than 10, tell them to go to the web page, otherwise just show the bans.

I cant discover anything wrong with my code, but somehow it just shows the channel bans in the channel, and doesnt give them a link to the URL...

Here's a piece of code:

Code: Select all

  set num_bans [llength [banlist $chan]]

  if {$num_bans > 10} {
    putserv "NOTICE $nick :I have more than 10 bans in my banlist. You can view the banlist at http://blablabla.com. This banlist is updating every 5 minutes."
    return 0
  }

     set num 1
      foreach bans [banlist $chan] {
        set ban [lindex $bans 0]
        set reason [lindex $bans 1]
..................
..............
..........etc
The best way to start learning is to start helping.
Locked