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
Samus
Novice


Joined: 01 Jan 2003
Posts: 32

PostPosted: Sun Nov 09, 2003 3:29 pm   

fleeing trigger
 
How would I go about making a trigger that would capture the last move you made?
moves are {north|south|west|east|up|down}
and say I go north and I fight a mob and want to flee, I would type the alias flee. and it would output the withdraw south

-thanks
Reply with quote
Dagnimaer
Wanderer


Joined: 05 Apr 2003
Posts: 60
Location: USA

PostPosted: Mon Nov 10, 2003 12:51 am   
 
whats the text you get from the mud when you move those directions?

-Dag
Reply with quote
Cbisazza
Wanderer


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Mon Nov 10, 2003 2:59 am   
 
What you need is a combination of two things.

1. you want to capture the last direction you moved in, and
2. you want to confirm that it was succesful.

If the mud outputs something like "you move north" then it can all be incorporated into one stage.

If it does not, then the best way to tackle stage 1 would be to create a trigger based on the text you send to the MUD (i.e. a command input trigger) and get the direction you're trying to move in from there.

You would probably need to confirm the retreat direction in some way based on the MUD output.

You might want to paste the output of your MUD into this - it will enable us to give more relevant suggestions.
Reply with quote
stick
Newbie


Joined: 11 Nov 2003
Posts: 7
Location: USA

PostPosted: Tue Nov 11, 2003 4:20 am   
 
The easiest way to do what you want is to just make an alias.

IE. #alias north {#var lastdir north;~north}

Do the same for the other directions, then make an alias for fleeing, like

#alias flee {#if (@lastdir == north) {flee south} {...
and on. There's probably a more efficient way to do this but I'm tired, can't think right now.

As for the confirmation that the move was successful, like Cbisazza, you wouldn't really need that because if you didn't successfully move in that direction, you'd simply enter a new direction to go in and make a new variable. If you really want to though, it's possible, and quite easy.
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Thu Nov 13, 2003 6:23 am   
 
Can certainly be done with triggers... but we need to see your output from the mud to write them correctly :)
Reply with quote
Samus
Novice


Joined: 01 Jan 2003
Posts: 32

PostPosted: Thu Nov 13, 2003 8:37 pm   
 
well when you go north it says nothing so, and when I scan
Up:
NAME
NAME
Down:
NAME
NAME

I can probalby make an emote where it says the direction I am going to go?

#ALIAS n {emote is going to the north.;~n}
Reply with quote
Samus
Novice


Joined: 01 Jan 2003
Posts: 32

PostPosted: Tue Nov 18, 2003 7:23 pm   
 
what's wrong with this?

#ALIAS withdraw {#IF (@moves = west) {flee east} {#IF (@MOVES = east) {flee west} {#IF (@moves = north) {flee south} {#if (@moves = south) {flee north} {#if (@moves = up) {flee down} {#if (@moves = down) {flee up}}}}}} {}}

than I have macros for each move n,s,w,e,u,d. and it says this in each of them

ie
the macros is n and the value is:
n
#VAR moves {%null}
#VARIABLE moves {north}

and it does that for each move I listed above. when i type withdraw it is supposed to flee east or flee west, (basically the opposite of what the @MOVES var says. and when I tried it it displayed nothing
Reply with quote
Samus
Novice


Joined: 01 Jan 2003
Posts: 32

PostPosted: Thu Nov 20, 2003 1:38 am   
 
no one knows?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Nov 20, 2003 4:04 am   
 
You can't assign a macro to key n.

It would make typi g ki d of difficult a yway, si ce you could 't ever use .
Reply with quote
Cuttlefish
Apprentice


Joined: 28 Oct 2003
Posts: 164

PostPosted: Thu Nov 20, 2003 4:29 am   
 
Try this:

#ALIAS withdraw {#IF (@moves = west) {flee east} {#IF (@MOVES = east) {flee west} {#IF (@moves = north) {flee south} {#if (@moves = south) {flee north} {#if (@moves = up) {flee down} {#if (@moves = down) {flee up}}}}}} {}}
#ONINPUT {^e$} {#VAR moves {%null};#VARIABLE moves {east}}
#ONINPUT {^s$} {#VAR moves {%null};#VARIABLE moves {south}}
#ONINPUT {^n$} {#VAR moves {%null};#VARIABLE moves {north}}
#ONINPUT {^w$} {#VAR moves {%null};#VARIABLE moves {west}}

Note that you could make this more complicated. One of the shortcomings is that even if you type an incorrect direction, this assumes it was right. Also, if you type "east" instead of "e", it misses it.

But I think this might meet your needs if you don't want to get too complex.
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