Welcome to the Builder Academy

Question Help links in wrong commands

More
19 Apr 2026 17:31 - 19 Apr 2026 17:34 #11020 by Fubar


Just playing around and I added a few commands. My poor spelling lead me to:
Code:
zerdit Huh!?! Did you mean:   zedit

Now normally you would just type the command again. But I was like I know we can make clickable links in the mud. So I wanted to change it. So it acts like normal but with this change they become clickable.

In interpreter.c around line 555 you should see:
Code:
      /* Only apply levenshtein counts if the command is not a trigger command. */       if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) &&            (cmd_info[cmd].minimum_level >= 0) )       {         if (!found)         {           send_to_char(ch, "\r\nDid you mean:\r\n");           found = 1;         } send_to_char(ch, "  %s\r\n", cmd_info[cmd].command);       }
 
Change
Code:
send_to_char(ch, "  %s\r\n", cmd_info[cmd].command);

To
Code:
        send_to_char(ch, "  \t<send href='google %s'>%s\t</send>\r\n", cmd_info[cmd].command, cmd_info[cmd].command);

Now when when i mistake it made it show the nearest command and when clicked pulls up the help file.

You can also do this with help and help files as well.
Code:
        send_to_char(ch, "  \t<send href='google %s'>%s\t</send>\r\n", help_table[i].keywords, help_table[i].keywords);

Help files just change HELPFILE to whatever help
Code:
SEE ALSO: @<send "google HELPFILE"hint="Click here">HELPFILE@</send>,
Last edit: 19 Apr 2026 17:34 by Fubar.

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

Time to create page: 0.181 seconds