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.

user flags in tcl ?!

Old posts that have not been replied to for several years.
Locked
Z
Zygomaticum

Post by Zygomaticum »

Hi.

I'm working on a .<command> trigger script.
I'm doing fine right now, but somme commands are only working if a user got the right flag.
I also got a .help command with the basic commands that are working for any user, no matter what flags they got.

I wanna add something to the .help commands:
i wanna add commands that a user can only use when he got's the right flag to the help command when they're using it (so: if a user with flag +A types .help, he also can see the commands that are using only when you got the flag +A, if a user without the flag +A types .help, he can't see it).

I think it must be something like:
if {$flag == "A"} { putserv "PRIVMSG $nick :<text>"
but dunno what it'll have to be exactly.

Can someone help me?

Greejtz, Zygo.
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

Read tcl-commands.doc for matchattr
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It is possible to add items to the ".help" command, but they will not show up, when typing a plain ".help" unless you re-program the ".help" command itself.

something like

Code: Select all

unbind dcc - "help" *dcc:help
bind dcc - "help" my:dcc:help
proc my:dcc:help {hand idx arg} {
  *dcc:help $hand $idx $arg
  if {$arg != ""} { return }
  if {[matchattr $hand A]} {
    putdcc $idx "COMMANDS AVAILABLE TO +A FLAG HOLDERS"
  }
}
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

actually a simple modification of help/core.help is easier than rewriting the whole help subsystem as it already has flag matching.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

And then it comes back to the simple task of reading the README (yer right).

Modification is no problem, but it leaves the problem of, if multiple modifications are made, then only the last one sticks (though, this is very unlikely to heppen).

There isn't anything simple about it, no matter which way you choses, it has it's pros and cons.

As for the core.help replacment, I wouldn't choose it. As much as some of us read the docs, it means for a harder method of installing. Some files here, some here and some there. As you have seen, it's hard enough for some to read guides on how to do the simple tasks, let alone change a help file around.
Locked