[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]  General
. . -> [Subject]  Variable adding trigger
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

Variable adding trigger

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

Posted by Ketsui   (2 posts)  [Biography] bio
Date Sun 18 Oct 2009 11:07 PM (UTC)
I'm really new to this so I'm basically asking for a complex program.

What I'm looking for is say you have 10 lines of text that are very similar but have special information that has to be aliased...example

Kill Big Dog
Kill Big Cat
Kill Ugly Horse
Kill Smelly Cow

Ok What I'd like this program to do is assign the F1 button an alias based off the first line and so forth for each line to F4.

I'm completely lost on how this would be written but im assuming a variable counter for each time a line is added, if i knew the total lines being requested it might work.

Is there any tech master who could assist me?

[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #1 on Sun 18 Oct 2009 11:30 PM (UTC)
Not a tech thingy but...

What does the output from the MUD look like? Say the output from the look or consider command that you want to use.
[Go to top] top

Posted by Ketsui   (2 posts)  [Biography] bio
Date Reply #2 on Mon 19 Oct 2009 01:05 AM (UTC)
To complete this quest, you must:
Kill at least 1 * a lazy pupil (Art of Melody).
Kill at least 1 * A violent pumpkin (Gallows Hill).
Kill at least 1 * Some rotten cheese (Gallows Hill).
Kill at least 1 * the front desk clerk (Hotel Orlando).
Kill at least 1 * A Barbarian Archer (The Cover of Trees).
Kill at least 1 * a bobwhite quail (Beneath a Large Tree).
Kill at least 1 * a deer (The Goblin Path).
Kill at least 2 * a screaming child (The Land of the Beer Goblins).
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #3 on Mon 19 Oct 2009 01:56 AM (UTC)

Amended on Mon 19 Oct 2009 02:00 AM (UTC) by Blainer

The first thing to do is make a trigger to catch the lines with a mobile in them and create a script to get the key word used to reference the mobile. I would suggest using Lua's gsub and match functions. I use a process of elimination to remove words that will not work. Like "the", "of" and "red" etc and then take the word from the end of the string, it seems to be about the same accuracy if you grab the first or the last word after eliminating all you can. I've not managed to make a script to do this 100%.

Template:scripting Scripting tutorial

There is extensive information about scripting in MUSHclient at http://mushclient.com/scripting. This includes screen shots and examples.

Template:regexp Regular expressions
  • Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
  • Also see how Lua string matching patterns work, as documented on the Lua string.find page.

Please try searching this forum.

These pages may help. The help file that comes with MUSH is great it has all the info you will need to make these scripts and triggers.
[Go to top] top

Posted by Nick Gammon   Australia  (21,563 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Mon 19 Oct 2009 05:16 AM (UTC)
This looks like Aardwolf, and if it is I have done a couple of plugins for quests and campaigns:



Although they don't assign mob names to hotkeys, they do the basic stuff of remembering the names and keeping them in a window. Your display looks slightly different, but this might give the general idea.

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