Unknown2007-01-31 00:36:11
So, I've a really basic little thing I want set up in zMUD - just something that notices if I have to swim in a certain direction, and does it for me. I tried this:
Hardly a collosal beauty of scripting, is it? But then again it seems to do the job most of the time, happily taking 'e' and turning it into 'swim e'...
Occasionally, however, it'll skip up the direction history and input 'swim swim ne' or similar. If it starts this, the problem usually snowballs, with 'swim swim swim swim ne' following quickly, even though I've got a little trigger set up to combat typos:
Anything I've missed? Is it too simple a piece of scripting?
Any help would be lovingly recieved
CODE
#TRIGGER {You'll have to swim} {swim %lastdir}
Hardly a collosal beauty of scripting, is it? But then again it seems to do the job most of the time, happily taking 'e' and turning it into 'swim e'...
Occasionally, however, it'll skip up the direction history and input 'swim swim ne' or similar. If it starts this, the problem usually snowballs, with 'swim swim swim swim ne' following quickly, even though I've got a little trigger set up to combat typos:
CODE
#TRIGGER {no exit in that direction} {#NODIR}
Anything I've missed? Is it too simple a piece of scripting?
Any help would be lovingly recieved
Unknown2007-01-31 00:57:17
QUOTE(Thirtian @ Jan 30 2007, 04:36 PM) 378879
So, I've a really basic little thing I want set up in zMUD - just something that notices if I have to swim in a certain direction, and does it for me. I tried this:
Hardly a collosal beauty of scripting, is it? But then again it seems to do the job most of the time, happily taking 'e' and turning it into 'swim e'...
Occasionally, however, it'll skip up the direction history and input 'swim swim ne' or similar. If it starts this, the problem usually snowballs, with 'swim swim swim swim ne' following quickly, even though I've got a little trigger set up to combat typos:
Anything I've missed? Is it too simple a piece of scripting?
Any help would be lovingly recieved
CODE
#TRIGGER {You'll have to swim} {swim %lastdir}
Hardly a collosal beauty of scripting, is it? But then again it seems to do the job most of the time, happily taking 'e' and turning it into 'swim e'...
Occasionally, however, it'll skip up the direction history and input 'swim swim ne' or similar. If it starts this, the problem usually snowballs, with 'swim swim swim swim ne' following quickly, even though I've got a little trigger set up to combat typos:
CODE
#TRIGGER {no exit in that direction} {#NODIR}
Anything I've missed? Is it too simple a piece of scripting?
Any help would be lovingly recieved
I stole this from Kharaen, who has a topic in this section called Free Maps
which has this code in it:
#TRIGGER {^You cannot swim while mounted on a steed.$} {#var swimming 0}
#TRIGGER {^You begin to steadily swim} {#var Swimming 1}
#TRIGGER {^You get down on your belly and begin trying to swim, but only succeed in rolling} {#var Swimming 0}
#TRIGGER {^Kicking quickly, you rise back to the surface.$} {#var Swimming 1}
#TRIGGER {^Taking a deep breath, you dive below the surface.$} {#var Swimming 1}
#TRIGGER {^There's water ahead of you. You'll have to swim in that direction to make it} {#var Swimming 1}
Then it's a simply a matter of having your keypad swim if @swimming==1
Unknown2007-01-31 02:42:11
The %lastdir variable is renowned for getting out of sync. You're better off aliasing the directions and capturing the direction in your own @lastdir variable.
CODE
#ALIAS n {~n;lastdir = n}
Unknown2007-02-03 16:37:49
I would have stolen the system of variables from Kharaen, but sadly I have no NUMpad at all - the joys of owning a laptop.
I'd never considered going as far as aliasing the directions themselves, but it really is an ingenious solution...
And thank you also for making me feel a little bit better, I'm glad it's not just me who finds lastdir silly.
Thankee!
I'd never considered going as far as aliasing the directions themselves, but it really is an ingenious solution...
And thank you also for making me feel a little bit better, I'm glad it's not just me who finds lastdir silly.
Thankee!
Unknown2007-02-04 21:16:23
QUOTE(Thirtian @ Feb 3 2007, 08:37 AM) 380094
I would have stolen the system of variables from Kharaen, but sadly I have no NUMpad at all - the joys of owning a laptop.
I'd never considered going as far as aliasing the directions themselves, but it really is an ingenious solution...
And thank you also for making me feel a little bit better, I'm glad it's not just me who finds lastdir silly.
Thankee!
I'd never considered going as far as aliasing the directions themselves, but it really is an ingenious solution...
And thank you also for making me feel a little bit better, I'm glad it's not just me who finds lastdir silly.
Thankee!
Get a usb keyboard! Laptop keyboards are evil! Evil!