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.

!list

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

!list

Post by pilouuu »

Code: Select all

bind pub -|- "\!bots" request:bots

proc request:bots {nickname hostname handle channel arg} {
  set requestable {}
  foreach user [userlist] {
    if {[matchattr $user b] && [matchattr $user B]} {
      lappend requestable [hand2nick $user]
    }
  }
  putserv "NOTICE $nickname :Here is a list of my requestable bots:"
  putserv "NOTICE $nickname :[join $requestable ", "]"
}
Hi

Bot not say list bot whit Global flags +B or +b. Were is problem

Thx


expl:

!bots

<bot> Here is a list of my requestable bots:
...
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

This code should work, assuming you wish to list user-entries who have both b and B (use the binding from the initial post). If you rather want a listing of user-entries that have either b or B, replace the & with a |

Code: Select all

proc request:bots {nick host hand chan txt} {
 puthelp "NOTICE $nick :Here is a list of my requestable  bots:"
 puthelp "NOTICE $nick :[join [userlist bB&] ", "]"
 return 1
}
NML_375
Post Reply