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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Parse info from a trigger

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Parse info from a trigger
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Thu 08 Nov 2007 07:07 AM (UTC)  quote  ]
Message
I have extracted the few triggers and 2 needed aliases for this task, and put them into a plugin. This is still using a Mushclient variable to do the work, because this was implemented directly within my world file, and I do not use a script file.

www.torasin.com/~venificius/DBE_Target_Cycle.xml

Sadly the URL is VERY case sensitive, tried talking to my friend that is hosting it and has not gotten around to playing with it. Some times it will not even matter, other times it will.

This was created for use on Dragon Ball Evolution, but can easily be altered to work for other things.

Basically it triggers on the output of "Look" or "Scan" or the automatic "Look" that occurs when you enter a room. It sets the clipboard to the selected target, and then allows you to use the clipboard via %C in 'send to world', or GetClipboard() in 'send to script'. You might want to make a clear_clipboard alias, and possibly bind it to a key as well as, like the "Help File" describes, 'fmob' and 'pmob' commands as well.

Hope this is decipherable.

-Onoitsu2
[Go to top] top

Posted by Bortaz   (3 posts)  [Biography] bio
Date Wed 07 Nov 2007 01:18 AM (UTC)  quote  ]
Message
Ok thanks that sounds like what I might need, I will mess with this and try to come up with something and if I have any questions I will report back here.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 06 Nov 2007 08:47 PM (UTC)  quote  ]
Message
It is hard to be more specific without knowing what you are wanting to do, but look up string.gmatch. With that you could break a line of text into words, then each word could be put into a table.

http://www.gammon.com.au/scripts/doc.php?lua=string.gmatch

- Nick Gammon

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

Posted by Bortaz   (3 posts)  [Biography] bio
Date Tue 06 Nov 2007 05:55 PM (UTC)  quote  ]
Message
well say the things i am trying to parse do follow a regular syntax that does not change. is there a general way that i can script this information to go into a table?
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 05 Nov 2007 10:25 PM (UTC)  quote  ]
Message
Quote:

I was wondering if it is possible to capture text with a trigger in MUSHclient, and then parse this info into a Lua table.


That is certainly possible, although as Onoitsu2 points out, a lot depends on what you want to do with the information.

- Nick Gammon

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

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Mon 05 Nov 2007 09:44 PM (UTC)  quote  ]
Message
It would be difficult, unless the messages followed a standard and fairly constant syntax.

I have been working on a target cycler for DB Evolution, that allows me to 'look' in a room, and use 1 button to cycle forward and another back, and set the "target" variable accordingly, as well as prepend the #. to the name if more than one is in the room. The issue with this is that things can "stand", "walk", "jog", "waddles", etc. Usually it ends with "here.", but there are also items that would be captured, so it takes some careful scanning of these things and prevent adding them to the table, and if it fails all the prevention checks then it is added.

I can say with 100% certainty, if it does not follow a regular message pattern, and can be ANYTHING, then this will a very difficult, if not impossible thing to script.

I will post a copy of my triggers and aliases when I am at home, and can do so. (Am at computer lab right now, and forgot to drag mushclient back to USB drive)

-Onoitsu2
[Go to top] top

Posted by Bortaz   (3 posts)  [Biography] bio
Date Mon 05 Nov 2007 06:48 PM (UTC)  quote  ]
Message
Hello, I have been using Mushclient for a while now and am just starting to get into some of the other functions that are available from the client.

I was wondering if it is possible to capture text with a trigger in MUSHclient, and then parse this info into a Lua table.

Info would look something like this

A Cityguard Stands here.
A kobold attacks you!
The grocer is here.

If this is possible any help would be appreciated :)
[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.


2,658 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]