Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Imaginos
Newbie


Joined: 03 Sep 2002
Posts: 2

PostPosted: 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
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
Imaginos
Newbie


Joined: 03 Sep 2002
Posts: 2

PostPosted: 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?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net