speedwalk questions

  • Uzo
  • Uzo's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 2 months ago #5634 by Uzo
Uzo created the topic: speedwalk questions
Hello everyone im new to coding and mudding

i downloaded tbamud and quickly got tired of walking so i found a speedwalk command
it Works and compiles well

how ever just writing speedwalk doesnt ask where people wanna go, where and how would i do that. also the speedwalk is extremely fast, maybe a delay would be good ?

any ideas and sulutions will be apreciated.


ACMD(do_speedwalk) {
int dir, r;

for (r = 1; *argument && r; argument++) {
while (*argument == ' ')
++argument;

switch (*argument) {
case 'N':
case 'n':
dir = NORTH;
break;
case 'E':
case 'e':
dir = EAST;
break;
case 'S':
case 's':
dir = SOUTH;
break;
case 'W':
case 'w':
dir = WEST;
break;
case 'U':
case 'u':
dir = UP;
break;
case 'D':
case 'd':
dir = DOWN;
break;
default:
send_to_char(ch, "Alas, you can't go that way.\r\n");
return;
break;
}

r = perform_move(ch, dir, 1);
if (r && *(argument + 1))
send_to_char(ch, "\r\n");
}
}

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #5636 by WhiskyTest
WhiskyTest replied the topic: speedwalk questions
Hi Uzo

There are a few ways to do this.

1.) Alias
Within TBAMud you can use the 'alias' command to create your own speedwalk routes.
Eg: alias mypath n;n;s;s;e;d;n
Then when you type 'mypath' the alias would send the commands n;n;s;s;e;d;n to the MUD.
It's limitations are that it only works from point A to point B, you wouldn't be able to use it from anywhere else in the game.
For more info see HELP ALIAS in game

2.) Mud Clients
MUD clients like Zmud/Cmud will have their own methods of saving paths, aliases and macros which will do similar things as option 1. CMUD even has an automapper that you can double click on and it will walk you to that room.
The automapper feature works anywhere in the game as long as the mapper has your correct location, and you have mapped the path to the destination correctly.

3.) DG Scripts
You could look into creating scripts that can teleport you to locations

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago - 2 years 1 month ago #5683 by Kyle
Kyle replied the topic: speedwalk questions

how ever just writing speedwalk doesnt ask where people wanna go, where and how would i do that.


I haven't tested it but something like this should accomplish what you desire.
 ACMD(do_speedwalk) {
 int dir, r;
+if (!argument || !*argument) {
+  send_to_char(ch, "Where do you want to go?\r\n");
+    return;
+}
 for (r = 1; *argument && r; argument++) {
 while (*argument == ' ')
 ++argument;
Last Edit: 2 years 1 month ago by Kyle. Reason: fixed formatting and added forgotten bracket

Please Log in or Create an account to join the conversation.

Time to create page: 0.930 seconds