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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  How To ...
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

How To ...

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

Posted by Ves   (8 posts)  [Biography] bio
Date Mon 11 Oct 2010 02:57 AM (UTC)

I wanted to write something to store a bunch of variables.

I want to store the following:

The following beings are in your entourage:
A simpering Sycophant#309909, a sharp-toothed gremlin#406665, a bloodleech#405041, a chaos orb#406735, a dervish#359545, an ethereal firelord#316659, a humbug#406843, a bubonis#406885, a chimera#406830, Vraet#317671, a worm#406925, a soulmaster#407037, a green slime#407078, a minion of chaos#406879, a chaos storm#406881, a chaos hound#188622.

Each creature's number below "The following beings are in your entourage:"

I tried using wildcards but it was having issues with the multiple lines. I know there is a much cleaner way to do it with scripting. Anyone able to help?

Basically want to store them in variables so I can see which creatures im missing. etc.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #1 on Mon 11 Oct 2010 03:43 AM (UTC)
Basically, you'll want to do this in three parts. I am assuming all the different entities are on a seperate line, as that is how the last IRE mud I played showed that. If it is all on the same line, you'll need a different approach and this outline won't be of much help.

1. A trigger that matches the first 'beginning' line The following beings are in your entourage:, clears your current entourage and enables a triggergroup which I'll call entourage_triggers for clarity.

2. A trigger that matches a single line of your chaos entities, which starts out disabled and has entourage_triggers as its group. Make it a regular expression along the lines of ^\s*(.+?)#(\d+), and use a script that adds it.

3. Have another trigger that matches whatever follows this, also disabled by default and also the same group, which disables the entourage_triggers group.

I didn't give you the exact script because IRE games are pretty scriptheavy in nature, and having you work your way through the problem to get it to do what you want will help you far more in the long run. Although, in my experience, there's quite a few MUSH users on those games, so you might be able to have one of them help you in more detail (seeing how they know the game better than I would).

Feel free to ask any more questions though, preferably with a bit more detail and showing what you have tried.
[Go to top] top

Posted by Nick Gammon   Australia  (21,674 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Mon 11 Oct 2010 04:42 AM (UTC)
A multi-line trigger might do it in your case.

Template:post=10581 Please see the forum thread: http://gammon.com.au/forum/?id=10581.

If the trigger searched for "^The following beings are in your entourage:\n" followed by pretty-much what I had in the other post, then that should fetch the whole lot, up to the period, as one piece of text. Then you could do a similar thing, replace newlines by spaces, and then do a string.gmatch to extract out the mob names and numbers.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


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.


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 FutureQuest]