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 banlist output problems

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

Public banlist output problems

Post by Aron »

Im making a public banlist command, but i want it to show different output messages for different userlevels.

Code: Select all

proc banslist {nick host handle channel arg} {
  set type [lindex $arg 0]
  if {$type == ""} {
   if {[matchattr $handle o]} {
    putserv "NOTICE $nick :Usage: banlist <chan|global>"
    return 0
   } 
   if {[matchattr $handle o $chan]} {
    putserv "NOTICE $nick :Usage: banlist <chan>"
   }
  }
Somehow, it will only show the message to global ops, not the one for channel ops.

Am i doing something wrong with the syntax? I dont get any error messages.
The best way to start learning is to start helping.
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

try

matchattr $handle -|o $chan
photon?
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

i already tried that too, didnt work :(
The best way to start learning is to start helping.
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

this code works for me

Code: Select all

bind pub o|o banlist pub:banlist
proc pub:banlist { nick host handle chan arg } { 
  putlog "$::lastbind triggered"
  set type [lindex [split $arg] 0] 
  if {$type == ""} { 
    if {[matchattr $handle o]} { 
      putserv "PRIVMSG $chan :Usage: banlist <chan|global>" 
      return 0 
    } 
    if {[matchattr $handle -|o $chan]} { 
      putserv "PRIVMSG $chan :Usage: banlist <chan>" 
    }
  }  
} 
photon?
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

also
looks like you used $chan when you should've been using $channel

EDIT:
and you should not use list commands on strings (split them first :) )
photon?
Locked