Using Keypad for Aether travel and normal travel

by Unknown

Back to Mechanic's Corner.

Unknown2006-06-15 07:02:35
Ok.. I know I'm doing something wrong along the lines but, don't know what.

The gist is that I want to travel in aetherspace with the keypad like I do with walking. I have it set via Game > Configure > Keypad so that if I press Ctr1 + Keypad 8 It will "Pilot Steer N".

It's all nice and dandy, BUT! I want to make my life easier and not having to press Ctrl for every damn time I want to travel in A.S.

So I started coding

I have set a trigger with the "Step up to the command chair and so and so" to set a variable "keypadtravel" to 1 and another trigger with the "With a long, slow blink blah blah blah" to set the same variable back to 0

I am doing that right, but, nothing happens.

here's the actual script and tell me if you note something horribly wrong


'============================================================
'********************Aethercraft Travel!*********************
'============================================================

Sub Keypad (a, b, c)
keypadtravel = getvariable ("keypadtravel")
if keypadtravel = "1" then
world.docommand "Keypad0" , "Pilot dock"
world.docommand "Keypad5" , "Pilot launch"
world.docommand "Keypad1" , "Pilot steer sw"
world.docommand "Keypad2" , "Pilot steer s"
world.docommand "Keypad3" , "Pilot steer se"
world.docommand "Keypad4" , "Pilot steer w"
world.docommand "Keypad6" , "Pilot steer e"
world.docommand "Keypad7" , "Pilot steer nw"
world.docommand "Keypad8" , "Pilot steer n"
world.docommand "Keypad9" , "Pilot steer ne"
end if
if keypadtravel = "0" then
world.DoCommand "Keypad0" , "down"
world.DoCommand "Keypad5" , "up"
world.DoCommand "Keypad1" , "sw"
world.DoCommand "Keypad2" , "s"
world.DoCommand "Keypad3" , "se"
world.DoCommand "Keypad4" , "w"
world.DoCommand "Keypad6" , "e"
world.DoCommand "Keypad7" , "nw"
world.DoCommand "Keypad8" , "n"
world.DoCommand "Keypad9" , "ne"
end if
end sub

unsure.gif

and not really a coder. Just glanced on what I had on the Ethelon's system and tried to play with it...
Daganev2006-06-15 18:36:42
In zmud, what I would do is set an if statement inside of each key, if aethertravel ==1 then do pilot stuff, if walking = 1 , do normal walk stuff, if swiming == 1, do swim direction, etc.
Unknown2006-06-15 20:12:36
While that looks nice and elegant, I'm not familiar with Docommand, and I intend to make something like Daganev said for the same purposes. Basically, each keypad key will call a different alias, and each alias will do this, for different directions:

if getvariable ("keypadtravel") = "1" then
send "pilot steer N"
else
send "n"
end if
Unknown2006-06-15 22:23:40
QUOTE(vale_kant @ Jun 15 2006, 03:12 PM) 298524

While that looks nice and elegant, I'm not familiar with Docommand, and I intend to make something like Daganev said for the same purposes. Basically, each keypad key will call a different alias, and each alias will do this, for different directions:

if getvariable ("keypadtravel") = "1" then
send "pilot steer N"
else
send "n"
end if

mmh.. didn't though of that. However, I wouldn't like to depend that much on aliases. It gets messy.

Anyone able to help around?
Daganev2006-06-15 22:52:56
You don't need to do an alias.. you can stick that in your macro...
Unknown2006-06-16 00:59:15
OK, having looked into it, Docommand doesn't do anything even remotely useful for your purposes. (Rather, it lets you use menu commands like Edit > Copy from the command line or from your scripts.) The script you wrote doesn't work because (a) Docommand doesn't work like that, nor with that number of arguments, and (b) I don't think you're calling Sub Keypad anywhere, and even if you did, and you got the syntax for Docommand right... it would just try to move in every direction at once.

The only way to do it is the way I described above: make a series of aliases (Keypad1, Keypad2, etc...) and use the script snippet I posted in each.

And unfortunately, Daganev, MUSHclient only lets you enter a single line of commands or aliases for the keypad keys. You cannot insert script snippets directly in the Keypad dialog. You have to create aliases that contain those script snippets first.
Unknown2006-06-16 07:44:37
QUOTE(vale_kant @ Jun 15 2006, 07:59 PM) 298655

OK, having looked into it, Docommand doesn't do anything even remotely useful for your purposes. (Rather, it lets you use menu commands like Edit > Copy from the command line or from your scripts.) The script you wrote doesn't work because (a) Docommand doesn't work like that, nor with that number of arguments, and (cool.gif I don't think you're calling Sub Keypad anywhere, and even if you did, and you got the syntax for Docommand right... it would just try to move in every direction at once.

The only way to do it is the way I described above: make a series of aliases (Keypad1, Keypad2, etc...) and use the script snippet I posted in each.

And unfortunately, Daganev, MUSHclient only lets you enter a single line of commands or aliases for the keypad keys. You cannot insert script snippets directly in the Keypad dialog. You have to create aliases that contain those script snippets first.

Ooh.. thanks

Stupid Mush

And yeah, I hate the keypad thingie not being able to put some script