Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Variable adding trigger

Variable adding trigger

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


Posted by Ketsui   (2 posts)  Bio
Date Sun 18 Oct 2009 11:07 PM (UTC)
Message
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?

Top

Posted by Blainer   (191 posts)  Bio
Date Reply #1 on Sun 18 Oct 2009 11:30 PM (UTC)
Message
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.
Top

Posted by Ketsui   (2 posts)  Bio
Date Reply #2 on Mon 19 Oct 2009 01:05 AM (UTC)
Message
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).
Top

Posted by Blainer   (191 posts)  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

Message
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.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 19 Oct 2009 05:16 AM (UTC)
Message
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.

- Nick Gammon

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


19,412 views.

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

Go to topic:           Search the forum


[Go to top] top

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