|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: 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 |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Mon Nov 10, 2003 12:51 am |
whats the text you get from the mud when you move those directions?
-Dag |
|
|
|
Cbisazza Wanderer
Joined: 27 Feb 2003 Posts: 69 Location: Australia
|
Posted: 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. |
|
|
|
stick Newbie
Joined: 11 Nov 2003 Posts: 7 Location: USA
|
Posted: 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. |
|
|
|
tbone235 Apprentice
Joined: 02 Nov 2002 Posts: 107 Location: Australia
|
Posted: 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 :)
|
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: 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} |
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: 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 |
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: Thu Nov 20, 2003 1:38 am |
no one knows?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 . |
|
|
|
Cuttlefish Apprentice
Joined: 28 Oct 2003 Posts: 164
|
Posted: 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. |
|
|
|
|
|