Page 1 of 1

I found a strange alias issue

Posted: Tue Sep 30, 2014 11:49 pm
by Talkslowtome
I made some simple aliases. They work fine. But they fire when other text uses the same letters. For instance I aliased ds for draw sword. Later when I tried to look woods, the alias fired instead.

My guess is that I have made some mistake. I cannot imagine what it is. In the end I ended up turning all the aliases off.

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 2:27 am
by SlySven
You need to modify the alias's idea of what to trigger off of - in the box where you typed "ds" to be the thing to trigger your alias to work you need to change that to be "^ds$" - the extra symbols mean:
'^' = "match the start of the line"
'$' = "match the end of the line"
this makes it so that the alias only gets activated if the 'd' is the FIRST letter on the line and 's' the LAST - otherwise the alias will trigger whereever it sees the two letter pair "ds" in your input.

This is what is known as a regex - a contraction of "regular expression" and can be a very powerful way to specify what you do and don't what to be found out of a whole lot of text...

P.S. for any really new to MUD type text games people the '^' character is known as a "caret" typically on shifted 6 key on a keyboard, and the '$' is the dollar symbol, which I can find on shifted-4 on my UK keyboard.

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 2:34 am
by Talkslowtome
You! You are my hero!

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 3:08 am
by Talkslowtome
I have a similar problem with the semicolons. When speaking on the mud, if I type a semicolon as part of the sentence, the mud things I'm asking for it to go to a new line. How do you get the client to differentiate between punctuation in commands and punctuation in "speech?'

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 1:52 pm
by Jor'Mox
Speech is also commands. So it is actually impossible to make such a distinction. But, you can avoid the difficulty by changing the command separator. I made mine ;; rather than ;, because I never use ;; for any other purpose.

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 11:00 pm
by SlySven
You may also find that a leading '\' works e.g. use "\;" to switch off the special meaning of "end the current command and start another one":
* HP:50/50 MV:85/90 > say hello pussy; stroke cat
You say: 'hello pussy'
You caress their thigh

* HP:50/50 MV:85/90 > say hello pussy\; stroke cat
You say: 'hello pussy; stroke cat'

* HP:50/50 MV:85/90 >

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 11:02 pm
by Vadi
:|

Re: I found a strange alias issue

Posted: Wed Oct 01, 2014 11:24 pm
by SlySven
I found that emote response by accident on the main MUD I play when I met a player who successfully role plays (no verbal responses other than yowls, hisses and purrs) a feline :oops:

Re: I found a strange alias issue

Posted: Thu Oct 02, 2014 1:37 am
by Talkslowtome
Thanks!

Re: I found a strange alias issue

Posted: Sun Oct 05, 2014 2:40 am
by Talkslowtome
I'm so pleased. Apart from figuring out what to do about that semicolon issue (I'm thinking the / is the way to go) mudlet now does everything I need it to do in the way I want it done. I used cmud for years, but windows 8 said it had to go. Transitioning was hard. You guys made it much easier.