Page 1 of 1

command separator incorrectly parsed

Posted: Fri May 08, 2020 9:46 am
by zhenzh
When I try running lua send() from input command line, separators were parsed incorrectly.

For example, I'm using ; as separator and will send a batch of commands from lua.
I used:

Code: Select all

lua send("north;north;north")
While the command was considered as send("north, north, north") 3 parts which lead to input failure.

It would be better to avoid separators being parsed within a pair of "

Re: command separator incorrectly parsed

Posted: Fri May 08, 2020 3:19 pm
by Vadi
For this particular example you can use the speedwalk function: https://wiki.mudlet.org/w/Manual:Mapper ... #speedwalk

lua speedwalk("north,north,north")

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 7:25 am
by zhenzh
How about the other non-walk comands?
When I try to do send("north;look;south")

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 7:37 am
by Vadi
Don't use send? It's redundant - just type north;look;south - and you get the result :)

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 7:54 am
by zhenzh
I use send here for there are some additional lua judgement around, for example:

Code: Select all

if string.match(line, "north") then
    send("north;look;south")
else
    send("south;look;north")
end
Besides, the # repeat script may also be impacted.
When I run #3 north;look to expect the result north;look;north;look;north;look

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 7:58 am
by Vadi
This seems like it should go into an alias, not the input line, don't you think?

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 8:23 am
by zhenzh
Yes, it can be processed in an alias as a work around.
Just wonder whether there will be a better solution as some times I may run a batch of lua commands from input cli for debugging.
I have to create some temp aliases and edit them again and again for different trouble shooting purpose. Updating lua from input directly will be much more convenient.

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 9:39 am
by Vadi
Changing the command separator to something else would do the trick - like ;;

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 10:03 am
by zhenzh
Then, the send command will also be changed to send("north;;look").
Or, the "north;look" will be considered as the entire string and the ; will not be parsed as separator.

Re: command separator incorrectly parsed

Posted: Sat May 09, 2020 10:23 am
by Vadi
Yes, that's what you want, correct?

If you'd like to send separate commands, the right way to do this is to use sendAll()