taking a variable from the output and using it

Posted by Angelomcm on Mon 24 Jan 2005 04:59 PM — 3 posts, 13,201 views.

#0
Hello,

I need some feature real bad and i lack the total skill
to make it happen in mushclient. Perhaps someone
can give me some insight, maybe even (oh do i dream of it)
a quick solution in this ? It would be so appreciated..

I need to be able to make an "on-the-fly" variable grabbing.

Example of what i need:

I have a variable called A, which we will assign as "rabbit".

All i need, that upon mushclient gets any of these lines.
{
rabbit leaves nort.
rabbit leaves east.
rabbit leaves south.
rabbit leaves west.
rabbit leaves up.
rabbit leaves down.
}
(rabbit being variable A)

it stores the direction variables somewhere as DIRECTION.

Like for example, on "rabbit leaves south."
it will store "south" as variable DIRECTION
and i can assign F3 to "look DIRECTION".
Same goes for north, east, west, up and down.
Optionally, a local echo that the variable
has been set could be nice.

I have played with the "send to variable:" options
in the trigger menu, without any luck.

I am not looking for total spoonfeeding or anyone
investing any time making this from scratch (unless it
takes like 2 minutes..)

Perhaps someone has such a script lying around that does
exactly that ?

(I decided to post it here since it sounds script'ey)

Thank you for reading this if you got that far.
Bye.
-Ange
USA #1
You simply need two variables (one for your rabbit, one for the direction). You then create a trigger which has the match text of (assuming A is the variable for the rabbit, although I suggest you pick a better one): "@A leaves *." (no quotes) then check expand variables, ignore case is probably a good one too. Send to: Variable, and then at the bottom in the variable field type the name of the variable for the direction. If you want confirmation of sorts, change the color of the line (from the pulldown menu).

To change the first variable (rabbit) you could edit it manually, or (more easily) you could create an alias (which is basically the same thing as above, only change the variable name, change "@A leaves" to "target" or whatever you'd like. And of course, that would be an alias instead of a trigger.

To use the variable in a macro (thats the F3 thing) you need to make a third alias, which has the send text of whatever you'd like (if you ever want to type something out and get the same result, that'd be good, otherwise we can just have something that you wouldn't normally type, like... "ADSFADFadsFASDFASDFASDfasdfasdf", put that in the match text of the alias, and send whatever you'd like (look @direction) if direction is the name of your direction variable, then check expand variables, and omit whatever you'd like (probably omit the ASDFASDFAsdfaadsf and keep the look XX) and then send the same thing as your match text with the macro.
#2
thank you, worked real great.

-Ange