Re: [CODE] Globally Handle Abbreviations

From: Francis Hotchkiss (
Date: 02/11/99

> From: Nephanor of the Fraal <>
> That's what I was looking for, the original one on Alex's site.  However,
> it doesn't seem to be there at this moment.  If you could point me to it,
> or at least tell me what to change it to, I would be most appreciative.
Here it is.  Sorry it took so long, I missed your first post, and this was
on one of my backups, and i didn't know which one.  Anyways here it is.


From: Jvrgen Zigge Sigvardsson <>
Subject: Abbreviations for objects, mobs and players.

If anyone is interested here is a piece of code that will allow
everything to be abbreviated. Instead of typing 'kill
mobwithaverylongandcomplicatedname' you could type 'kill mob'.
It is VERY appreciated by players.

In 'handler.c', change isname() to this:

#define WHITESPACE " \t"

int isname(char *str, char *namelist)
  char *newlist;
  char *curtok;

  newlist = strdup(namelist); /* make a copy since strtok 'modifies'
strings */

  for(curtok = strtok(newlist, WHITESPACE); curtok; curtok = strtok(NULL,
     if(curtok && is_abbrev(str, curtok))
        return 1;
  return 0;

This will check for an abbreviation on every word in the namelist.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST