|
Imaginos Newbie
Joined: 03 Sep 2002 Posts: 2
|
Posted: Tue Sep 03, 2002 7:28 pm
MUD Output to Variable |
I got a -maybe- silly question but I do not find an answer.
What I want to do is send a command like look to the MUD. The MUD responds with a description of the room which is exactly one response. How do I get this response to a variable ?
Thx |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Sep 03, 2002 9:08 pm |
Make an alias to toggle the capturing and send the command.
Either additem each line or concat it all together.
Have a trigger that makes sense to stop the capturing.
#ALIAS GrabDesc {#VAR CapturedThing "";#TEMP {^~<My Prompt is a good trigger to stop the capture} {#UNTRIGGER CaptureItAll};#TRIGGER CaptureItAll {^(*)} {#VAR CapturedThing %additem("%1",@CapturedThing)};#SEND look}
Ton Diening |
|
|
|
Imaginos Newbie
Joined: 03 Sep 2002 Posts: 2
|
Posted: Wed Sep 04, 2002 4:12 pm |
Can't get it to work with zMud 6.16. Does the ID-Flag in #TRIGGER exist in 6.16 or only in later versions?
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Sep 04, 2002 8:39 pm |
Just tested it and what is happening is that the line
#TRIGGER CaptureItAll {^(*)} {#VAR CapturedThing %additem("%1",@CapturedThing)}
when created with default zmud settings it gets parsed to
#TRIGGER CaptureItAll {^(*)} {#VAR CapturedThing %1}
and my order of things was faulty by having the look sent after #TEMP trigger as in normal muds the look would show up on the prompt line and trip the #TEMP trigger.
--
I tested/modified things on a random diku mud.
1)
Then to keep things simple, in the settings editor make a trigger:
Pattern tab:
Pattern: ^(*)
Value:CapturedThing=%additem( "%1", @CapturedThing)
Options Tab:
ID: CaptureItAll
2)
Paste into your command line:
#T- CaptureItAll
#ALIAS GrabDesc {#VAR CapturedThing "";look;#TEMP {^(%d)Hp} {#T- CaptureItAll};#T+ CaptureItAll}
This gets around the issue with the parsing which strips the %additem. This should get you working and I'll review it when I get home.
Ton Diening |
|
|
|
|
|