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
Vedik
Newbie


Joined: 11 Nov 2002
Posts: 1

PostPosted: Mon Nov 11, 2002 11:49 am   

Variable question (Newbie)
 
Hey All

I need a bit of help with this problem I have. On my mud, I use a psionic ability to locate objects and I want to use the response I get to create a variable?

The problem that I'm having is that I can get more than one response from the mud.

The command I type is:

psi blaster

and the responses I can get from the mud are:

1 in the "(place name)".
1 held by the (person/monster).
you can't find any.

How can I write a trigger that'll take the response and put it in a variable @blstr.

Vedik

All help accepted with thanks.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Nov 11, 2002 12:34 pm   
 
Try this:
#ALIAS psi {#VAR blstr "";~psi %-1}
#TRIGGER {%d {in the "|held by the }(*){".|.}} {#VAR blstr "%1"}

So, when you call the command, you are really calling an alias that clears the variable and then sends the command to the MUD. Then a trigger matches any of the first two possibilities and stores the result in the variable. If you get the "you can't find any" possibility, then the variable remains empty.

Kjata
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