Lua

Posted by Mindloss on Sun 09 Sep 2007 07:03 PM — 2 posts, 10,796 views.

#0
Hi, I'm trying to enable my MUSH to use Lua commands. I've disabled the sandbox.

From the input window, I can type /os.execute("notepad") and it works as expected. I set up a trigger with the matching string /*, with %1 in the send area, going to script.

For some things, it works as expected, e.g.

think /print(os.clock())
/print(os.clock())
429.312

But for os.execute, it's giving me the following error:

think /os.execute("notepad")
/os.execute("notepad")
Compile error
World: TCX
Immediate execution
[string "Trigger: "]:1: unexpected symbol near '\'



What am I doing wrong? Thanks in advance for any help.
Australia Forum Administrator #1
When MUSHclient puts wildcards into the "send to" area in place of %1, and you are sending to script, it assumes that things like " need a \ in front of them.

For example, say you had:


Match: say *
Send : Send ("say %1")
Send to: script


Now if you typed in:


say Nick says "hi there"


Then you have quotes within quotes, so MUSHclient expands out like this:


Send ("say Nick says \"hi there\"")


This is where the \ is coming from.

If you want to just test out Lua commands, simply go to the script configuration box and type "/" into the "Script Prefix" box, and then get rid of your alias.