|
Eowyn Apprentice
Joined: 19 Jan 2001 Posts: 117 Location: Norway
|
Posted: Mon Nov 19, 2001 8:22 pm
Make trigger write to variable? |
Is it possibe to have triggers add to a variable? Let me explain. On my mud, there is this changing area that changes the way you can navigate it every day. If you stand still too long or make a bad step - you die. Now I got a script that can navigate it. Only - the script is a bit risky since it takes one step at a time in there. What I do to make it safer is to get an expendable newbie to navigate in there, then I write down where he went, get my highbie out and use the spams the newbie provided. What I want to do, is to have an alias that starts logging the newbies movement to another alias via triggers.
Ex: the navigator sends
north
*dosomestuff*
east
*dosomestuff*
up
*dosomestuff*
Now I use an alias to set up triggers to react to the words "north" "east" and "up", and add these directions to an alias:
#al spam1 {north;east;up;....etc.}
In other words I want to record into an alias where I've moved, and be able to spam it afterwards. Is this possible? |
|
|
|
Humpton Apprentice
Joined: 10 Oct 2000 Posts: 158 Location: Chicago, IL
|
Posted: Mon Nov 19, 2001 10:33 pm |
You can do anything in zMud - that's the beauty!
Can you use the mapper for this?
No? Try this. (I hope this is what you mean?)
We need a Variable to keep the stuff in.
#VAR PathKeeper {}
We need a Trigger to do it.
#TRIGGER {Catch the stuff with a (%w) in it somewhere so we can pass the direction to our variable} {#VAR PathKeeper %additem(%1, @PathKeeper)}
And, we need some way to see what we've got.
#ALIAS ShowMePath {#ECHO @PathKeeper}
Or you could make it a bit pretty like this
#ALIAS ShowMePrettyPath {#ECHO ** Start List;#FORALL @PathKeeper {#SHOW %1};ECHO ** End List}
Note: We need to use %additem instead of #ADDITEM because the latter doesn't create duplicates.
I think that's all you need.
Stay JOLLY!
H
___
Humpton lives like he types.... fast, and full of mistakes!
Core 2651: For those who prefer the future to the past. |
|
|
|
decantor Apprentice
Joined: 14 Nov 2001 Posts: 100
|
Posted: Tue Nov 20, 2001 3:02 am |
Follow Humpty down his PrettyPath.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Nov 20, 2001 3:23 am |
can you use %1 in place of %i when in a loop?
li'l shmoe of Dragon's Gate MUD |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Tue Nov 20, 2001 7:35 am |
Wouldn't be a loop then anymore, would it
Acaila |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Nov 21, 2001 2:55 am |
quote:
Wouldn't be a loop then anymore, would it
Acaila
You don't HAVE to have %i for the loop to loop. However, without it (I'm guessing), I don't think you could automatically cycle through the items of your #forall variable.
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|