|
Vedik Newbie
Joined: 11 Nov 2002 Posts: 1
|
Posted: 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. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
|
|