Variable adding trigger

Posted by Ketsui on Sun 18 Oct 2009 11:07 PM — 5 posts, 25,394 views.

#0
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?

#1
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.
#2
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).
#3
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.

Template:search
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.
Amended on Mon 19 Oct 2009 02:00 AM by Blainer
Australia Forum Administrator #4
This looks like Aardwolf, and if it is I have done a couple of plugins for quests and campaigns:

http://www.gammon.com.au/forum/?id=8815

http://www.gammon.com.au/forum/?id=8814

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.