Send newline to MUD

Post Reply
Wiploo
Posts: 1
Joined: Tue May 03, 2016 9:19 am

Send newline to MUD

Post by Wiploo »

Hi, I'm quite new to Mudlet and completely new to LUA script.

I'like to script some functionality of mob editing using alias. From prompt i manually send (enter is the key on the keyboard):
  • > wmedit nosfe
    > 1
    > shadow demon
    > ENTER
    > ENTER
Using LUA, I write:
Code: [show] | [select all] lua
send("wmedit nosfe")
send("1")
send("shadow demon")
send("\n")
send("\n")
Unfortunately "\n" is not sent to mud or not recognized correctly. How I can bypass this problem?

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Send newline to MUD

Post by SlySven »

A new-line is inherent in the end of each send(...) IIRC. Does it HAVE to be an empty line or would a space character work. Note that by default the semi-colon ';' is defined as a command separator so you may be fine with a single:

Code: Select all

send("wmedit nosfe;1;shadow demon; ;")
Although it does look as though you could be using a MUD provided "editor" of some type so YMMV!

Post Reply