Just for fun, here's a snippet of code, or you can grab the full source, last modified April 28, 1994. Fortunately I found I still had an electronic copy of it, buried in the recesses of my home directory. It is, of course, provided "as is", without any expressed or implied warrantees, and it's almost certainly of no use to anyone sane. Some truly frightening stuff :-).
void readmsg (char *msg) {
char temp[50];
char temp2[80];
int i=0;
if (MASTER != NULL) {
sprintf(temp, "### %s just flashed", MASTER);
}
if (debug) fprintf (stderr, "Msg: %s\n", msg);
if (strindex(msg, "how much xp?") &&
strindex(msg, "just flashed"))
report(msg);
if (strindex(msg, "how much xp?") &&
strindex(msg, "broadcasted"))
broad_report();
else if (MASTER != NULL)
if (strindex(msg, temp))
command (hackoff(msg));
/* else if (strindex(msg, "just flashed"))
forward (msg);
*/
else if (strindex(msg, "stinks up") && (strindex(msg, MASTER))) {
strcpy(temp2, "give sc ");
strcat(temp2, MASTER);
for (i=0; i < 20; i++)
sendmud(temp2);
}
else if (strindex(msg, "sucks you") && strindex(msg, MASTER))
sendmud("clear ignore");
else if (strindex(msg, "hugs you") && strindex(msg, MASTER))
sendmud("set ignore");
else if (strindex(msg, "just arrived") &&
(solo) &&
(enemy == NULL)) {
if (prepare(msg)) { /* if attackable monster, returns TRUE when ready */
attack(msg);
}
}
else if (strindex(msg, "gave a hornblade to you") && (solo)) {
sendmud("put horn br");
sendmud("say thanks!");
sendmud("smile");
}
else if (strindex(msg, "bag is full") && (solo))
sendmud("drop horn");
/* else if (strindex(msg, "does not exist"))
forward (msg);
*/
else if (strindex(msg, "You failed to escape")) {
hangaround(3);
flee();
}
else if (janitor) {
if (strindex(msg, "### Shutting down in"))
janitor_still_need = 0;
}
else if (strindex(msg, "### Shutting down now") && (solo))
quit_robot(5);
}