Re: Object Spec_Procs Easy question

From: Alex van Koppen (alexk@odie.et.fnt.hvu.nl)
Date: 04/29/96


Hi !

> I started looking at some of the other spec_procs to see what I did 
> wrong, and the one I was looking at was the bank's balance command.  It 
> returns a 1.  Whenever I try to return a 1 it just seems to hang.(I can 
> type things in and it keeps giving me the > prompt back, but nothing 
> happens)  I even tried disconnecting and reconnecting and it sends me 
> right back into the same loop.

In all special-procs, the return value tells the mud wether the special
did anything with the command given to it, so, if you always return 1
(true) it thinks that the special handled the command, and you will simply
get a prompt. If you always return zero, the mud thinks that the special
could not interpret the command, and executes it itself (that's why you
got 'Sorry, can't do that here.'). So, just test for commands you want to
intercept, and, at the end of each of these pieces of code return a '1', and
return '0' otherwise...

e.g

SPECIAL(stuff)
{
  if (CMD_IS("example") || CMD_IS("another_example"))
  {
     /* code for example here */
     return 1;
  }
  /* more commands here (same way as above) */
  return 0;
}  



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