|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: Fri Mar 07, 2003 2:53 pm
Remembering which direction |
How would you do this. If I type e to go east and kill a mob. Is there a way it will remember that east when I type withdraw to flee from battle.
I would want to make the alias called withdraw. I would type this:
e
k mob
withdraw(and it sends to the mud flee e)
is there anyway to do that? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Mar 07, 2003 4:05 pm |
#ONINPUT {^(%t)$} {#VAR lastdir %1}
Now whenever you enter a direction, the variable @lastdir contains the most recent direction entered.
Kjata |
|
|
|
doomfyre Apprentice
Joined: 03 Jan 2002 Posts: 152 Location: USA
|
Posted: Fri Mar 07, 2003 5:17 pm |
And the alias, after putting in what Kjata gave you:
#ALIAS withdraw {flee @lastdir} |
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: Sat Mar 08, 2003 7:00 am |
It doesn't seem to be working. When I type withdraw it sends to the mud {flee} and not a direction
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Mar 08, 2003 7:59 am |
Debug it by watching the tracking trigger:
#ONINPUT {^(%t)$} {#VAR lastdir %1;#ECHO Lastdir @lastdir}
Does that echo the direction you travelled? Sounds like the
variable isn't being set.
Ton Diening |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Mar 08, 2003 11:50 am |
First, did you go in at least one direction after setting the script and before typing withdraw? If so, then your directions might not be set-up properly, try entering this into the command line:
.2n
and see if it sends "2n" to the mud or two "n"'s. If the former is true, then enter this into the command line:
#DIR ns "n|north" n
#DIR sn "s|south" s
#DIR ew "e|east" e
#DIR we "w|west" w
#DIR ud "u|up" u
#DIR du "d|down" d
#DIR hl "nw|northwest" nw
#DIR lh "se|southeast" se
#DIR jk "ne|northeast" ne
#DIR kj "sw|southwest" sw
Kjata |
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: Sat Mar 08, 2003 9:26 pm |
Yeah, it doesn't set a variable. I also put the #DIR in and it still isn't working...Here is some more output of the mud I play.
Hp:614 Mv:373 Tnl:944west
And then it would be the same for north south east up and down. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Mar 09, 2003 1:36 am |
Try the short form instead of the whole direction (i.e. use "e", instead of "east").
Kjata |
|
|
|
Samus Novice
Joined: 01 Jan 2003 Posts: 32
|
Posted: Sun Mar 09, 2003 2:13 am |
Okay, it works with just the e instead of east, but withdraw only works if you use the full name, east. And also I must of been thinking backwards because what I wanted it to do was do the reverse direction ie.
I type north
then fight and mob and type withdraw
zMUD then sends flee south
Is that at all possible? |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sun Mar 09, 2003 6:53 am |
Possible, but the opposite of what you originally posted. You want to go back the way you came, not continue on in the same direction?
#var dirs {north|east|south|west|up|down}
#ONINPUT {(@dirs)$} {getnextdir %1}
#alias getnextdir {
#case (%ismember(%1, @dirs)) {
#var nextdir south} {
#var nextdir west} {
#var nextdir north} {
#var nextdir east} {
#var nextdir down} {
#var nextdir up} {
#echo default case in nextdir assignment}
}
#alias withdraw {flee @nextdir}
This will work when you type in the full name of the direction to move. Abbreviations will not fire the trigger.
--edit--
Sorry Samus, I didn't read your last post carefully enough to see you acknowledge the direction reversal error. I apologize for that first sentence, it was unwarrented.
--edit2-
When i edit a post compulsively, does it create some sort of spam that I don't see? If so I'll try to cut back.
--------
moon.icebound.net:9000 |
|
|
|
|
|