programing an auto sail program

Posted by Ixne on Mon 19 Aug 2002 08:54 AM — 2 posts, 12,923 views.

#0
Ok, on this mud I play on when sailing theres a short delay from when you type sail <dir> till you arive at that place and sometimes when sailing somewhere kinda far its rather annoying to have to have to manually sail there so I was wondering how to code a program to sail a dir, get a trigger for when it hits the destination, then sail again.

sail east
The ship is pointed east.
450 hps|215 sp|499 mp > The ship sails east.
Only the wide open ocean can be seen.

Thats what happens when you type sail <dir> in the mud.
You type sail <dir> the ship gets pointed one way then a few heartbeats later it sails that way.

So, how would you be able to sail a dir, then sail a different dir, then another dir etc?
USA #1
I dont know what the syntax would be, but basically I think you would have to have set runs and write little subroutines for each one of them, PROVIDING there is functionability to insert a delay between commands.. Nick I presume you can advise if delays like this are possible, and if so, what the syntax is..?

For example, if you have a regular run from A to B, you set an alias of 'sailA2B' which calls a subroutine.. the subroutine would then send:

World.send "sail east"
wait 2
World.send "sail east"
wait 2
World.send "sail west"
wait 2
..and so on

Although this would only be much use when you're sailing from and to known places.

The other option is to contact the coders of the MUD and tell them it sucks and they should remove the directional "The ship is pointed xxx" messages, or at least put it all on one line with "The ship sails xxx" message.