Problem description: Is there a way to view the command entered into an input through a custom interface before it's executed?
|
Jan 25 2014, 7:57 pm
|
|
If you mean input as in the interface element, then you'd want its "text" parameter.
|
You mean something like:
mob/verb This will retrieve anything you have, commands included, and output it. I apologize if this is not what you're asking for, your question is very confusing |
I don't want a command that takes the text for me, I just want to disable a few verbs from being used from the input.
|
A few verbs or all of them? if it's all then you can go to your input in the Interface and click edit -> Options. There's a option there that disables the input from being used as a command. Toggle it
|
I don't want to disable the entire input. Hiding the command isn't what I want to do either, I would rather provide an error message for attempting to use the verb and have the player macro it instead.
|
You can set a default command for the input and route things through there. Useful if you only want players to use one command (say would be a good example). Or you could go through command() and then hascall() and call() things dynamically.
However I think you're going about this the wrong way. If a player is explicitly not supposed to have a verb, take it away from them. |
In response to Neimo
|
|
Neimo wrote:
I don't want a command that takes the text for me, I just want to disable a few verbs from being used from the input. I may be wrong, but I think he means he wants certain verbs to work in the put command, and some not to work. For example: Say, World Chat, Emote work b y typing the verb in to the input. Verbs like Rest, Use Potion, Save, don't work when you type them in to the input and hit enter. |
DM Reference
An alternate way to hide a verb from the command-line and verb panels is to make "." the first character in the name. This may be what you want, I believe. Just add "." in a verb's name setting and players won't be able to access it from the command-line. EDIT: Seems I made an oversight. The only way to truly hide it is to generate a series of characters. mob/verb/test() The only way they'd be able to access it from the command-line is if they type in those symbols. (Note: the verb's name must begin with ".") |
In response to Magnum2k
|
|
They need to know what their commands are, that's why it shows them in the input when a player presses enter, I don't know how to intercept the command, Jittai. I'm having a brain fart.
|
Misunderstood the function of Command() for clients. Always thought it processed through that for all verbs and not just for telnet.
|
Going to be perfectly honest here, the fact that this question was asked is indicative of a poor design methodology being applied.
There is no way to distinguish between verbs typed into the command line and verbs pressed in statpanels. Instead of what you are trying to do, you should most likely be using a custom verb applied to the specific input element, and parsing the results, calling specific behavior manually dependent on the input supplied by the user. |