[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Convert World To Script

Convert World To Script

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Xvordan   (29 posts)  [Biography] bio
Date Tue 24 May 2016 07:54 PM (UTC)
Message
I've had a lot of situations where I'll create an alias or trigger, thinking it need not be complicated, and so I just set it to send to world. Later on, if I want to convert that trigger to a script but retain the text to send to the mud, I have to go back through and manually add Send("[line]") for every line of text. This can get quite tedious, especially if the send field has populated with a lot of commands on separate lines.

Unless there's a way to do it and I just don't know how, is there a chance Mushclient could be given a Convert To Script button, rather like Convert to Regular Expression? All it has to do is add Send(" ") around text on individual lines, since (I'm assuming) that's all send to world is doing anyway.
[Go to top] top

Posted by Nick Gammon   Australia  (22,991 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 25 May 2016 03:08 AM (UTC)

Amended on Wed 25 May 2016 03:09 AM (UTC) by Nick Gammon

Message
The simple thing would be to use the Lua multi-line literals.

eg.


Send [[
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 Praesent in eleifend mi.
 Integer dignissim euismod odio eu ullamcorper.
 Integer urna justo, porttitor vitae justo et, convallis suscipit libero.
 Nam sit amet cursus felis.
 Quisque viverra sit amet orci et dapibus.
 Proin lobortis cursus augue, non iaculis arcu condimentum consequat.
 Etiam finibus, libero a dictum placerat, risus purus vulputate ligula, ut euismod libero augue quis ligula.
 Quisque enim augue, imperdiet et efficitur sed, sollicitudin sit amet tortor.
 Nullam dolor lorem, euismod ut pellentesque id, mattis vitae augue.
 Proin ac nulla id dui euismod porttitor vel vitae enim.


Quisque sapien felis, viverra eu libero at, suscipit mattis velit.
 Donec ultrices ex sed erat euismod, in malesuada augue ultricies.
 Curabitur bibendum orci enim.
 Pellentesque volutpat placerat accumsan.
 Nulla id diam in est ultrices rutrum id in orci.
 Interdum et malesuada fames ac ante ipsum primis in faucibus.
 Phasellus ac velit augue.
 Cras non blandit elit, ut hendrerit nibh.
 Interdum et malesuada fames ac ante ipsum primis in faucibus.
]]
 


If the text to be sent happens to have [[ in it, then put one or more equals signs between then, like this:


Send [=[
  ...
]=]

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Xvordan   (29 posts)  [Biography] bio
Date Reply #2 on Fri 03 Jun 2016 03:44 PM (UTC)
Message
Thank you Nick. I admit I didn't know I could do Send[[ ]]. That'll definitely make my life a whole lot easier -- it was tedious converting multiline sends into line-by-line Send(" ") statements.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,829 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]