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
Eowyn
Apprentice


Joined: 19 Jan 2001
Posts: 117
Location: Norway

PostPosted: 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?
Reply with quote
Humpton
Apprentice


Joined: 10 Oct 2000
Posts: 158
Location: Chicago, IL

PostPosted: 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.
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Tue Nov 20, 2001 3:02 am   
 
Follow Humpty down his PrettyPath.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Tue Nov 20, 2001 7:35 am   
 
Wouldn't be a loop then anymore, would it

Acaila
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
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