New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make commandSeparator settable with a function #3677
Comments
or you could use the proper form, which is sendAll("com1", "com2", "com3", "com4") local cs = getCommandSeparator
local commands = {
"com1",
"com2",
"com3",
"com4",
}
send(table.concat(commands, cs)) I'm not sure we want to encourage script authors to be setting/resetting the command separator in their scripts. I'll end up with tons of people coming in asking why they can't use a semi-colon again, or why the colon suddenly splits things into two commands and all it takes is your function erroring once before resetting it. Especially since you don't do anything with it if it's |
That being said, setCommandSeparator could be good to have just to have the full suite of preference getters/setters but this is exactly what it shouldn't be used for. |
Fair enough. Potential issues aside, being able to |
I'm confused why all this temporary changing of the command separator is going on. If they're used to |
It seems like you want an alias that will feed into sendAll along the lines of demonnic's first comment What exactly do folks type then in your other clients to send multiple commands, but not interfere with winky smileys and server side shenannigans? |
I also thought that the omission of a function to set the command separator was a conscious and deliberate decision at the executive level 😁 to avoid the breakage that could arise from one script/package changing it whilst another (possibly asynchronous one run from a timer!) was active. As far as I can tell the main discussion on this was in #1866 . |
That does sound like something we might have done, but I think accessibility may wind up requiring that we create some way to set it from the command line at least, even if it's separate from the lua API itself. |
The problem lies in cases where the MUD accepts ';' as input and there's no way to input a ';' without menu hopping if ';' is your command separator. Being able to make smiley faces is one thing (one could create a mudlet alias that switches the command separator temporarily to something innocuous when using a chat channel to avoid that). Another is that the MUD can store server side aliases, which are generally going to be faster to process and quicker/easier to create than client side aliases, but these use ';' to separate the command as well. |
these all sound to me like reasons not to use |
Not an option unfortunately when we already have hundreds of triggers and client side aliases that use |
Do you think people will take well to typing out the semicolon four times? 🤔 I don't think that is realistic. |
I don't think those who have adopted a 2-character command separator already would find the need to escape their command separator very often. How often would you need to escape out of a command separator this is already set to |
I don't think a poll will help because that's saying "let's screw the minority", whoever the minority ends up being. The original script: local x = getCommandSeparator()
if x ~= ";" then setCommandSeparator(";")
send("com1;com2;com3;com4")
setCommandSeparator(x)
else
send("com1;com2;com3;com4")
end This is an insane amount of work, why complicate things so much? If you have several things to send, use |
I don't see how anybody would be screwed by a method to escape the command separator. A new preferences option or function shouldn't be breaking any current functionality. I am curious about what people actually use for their command separator, if people have adopted a 2 character command separator so that they can send that character to the MUD or not. If your command separator is a single
It would be a workaround if we had a I guess this has become 2 suggestions now, one for |
I don't think you're being realistic when you're telling someone that they have to type We didn't include the function to begin with for a specific reason - it enables bad habits. I understand the friction the players in your game have with this bad habit and how difficult it is, and they'd like to do more work by putting in really large scripting aliases that change, edit, etc mess with the separator instead of changing the habits... but perhaps it's best to change the habit to something better instead? If you'd like to send multiple things, don't use I totally get that you'd like to make the transition to Mudlet smoother. But enabling bad habits probably isn't a good way to go, because in the end Mudlet will become as shitty as the other clients then, wouldn't it? |
They don't have to of course, only if they want to escape the command separator for whatever purpose. If they used a single
Unfortunately I didn't realize that Back to the topic though, I don't believe that having to menu hop to swap command separators when the need arises to send whatever character the user has chosen for command separator to the MUD, then menu hop again to switch it back, is a design improvement over other clients in this regard and I think Mudlet can do better. |
Open up an editor that can do regex search & replace, put this pattern in:
Alright we'll improve the docs here so it helps for the future. Edit: that's done in all relevant places. |
My question still remains unanswered:
For example, I can assume most players don't even want to dive into alias scripting all too much, they just want to type something like for example If so you can easily build and distribute an alias that will recognize the Voilá, players are happy, no need to use or change any separators at all, at all. In no way I recommend the menu hopping to keep setting and resetting your favorite command separator vs. the one someone used in their scripts (remember, there could be conflicting authors as well). |
From the players that I've asked, I've heard four different methods for disabling/bypassing the command separator outside of menu hopping.
From what I can tell, the preferred command separator is |
Escaping it sounds fine to me - anyone know what zmud/mush do? |
|
Mushclient's approach seems more reasonable... but still, do want to help condone bad behaviour? Fixing existing aliases isn't hard, see #3677 (comment), and with better docs less people would start making the mistake. @KitchenMUD are you able to repair your aliases with it? |
It is tedious, but I can convert those that use |
Hopefully not much more work than embedding the use of |
@vadi2 Perhaps that was a poor example on my part. I figured since we already have Maybe a better function would be a new one that ignores parsing of the command separator altogether and sends directly what is input in the code? That is safer to keep end users from mucking something up, outside of a UI solution. |
I like that idea. Would it solve it for you? What do others in @Mudlet/lua-interface think? |
I think this has run its course and we have given strong reasons for not wanting to do what the OP requested - It is hoped that the alternatives that we do provide will be sufficient for them. |
We already have the getCommandSeparator() function, we need a way to set the command separator without having to jump into the preferences. I suggest adding a setCommandSeparator() function.
Reasons for adding feature:
This will (I think) retreive the command separator, check whether not it is a semi-colon, and if it isn't a semi-colon then change it to a semi-colon then execute the code and then change it back to whatever it was before.
The text was updated successfully, but these errors were encountered: