Re: [Circle] [Code] ACMD(do_wiznet)

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 10/08/01


On Sun, 7 Oct 2001, Ramsey Stone wrote:

> Greetings CircleMUD Coders,
>
>      Just recently I was working on a revised wiznet. I
> remade the echo so it takes out the colon. Then I also added
> another feature, %, which echos on wiznet. Here are bits and
> pieces of it:

You're going to have to provide the relevant portions of the actual code
you're using.  The stuff you've included isn't even valid (I suspect you
retyped it, possibly from memory?), is disjointed, doesn't include the
case you've mentioned (emoting at the beginning), and gives no impression
of what you've done and where you've done it.

> case '%'
> echo = TRUE;

I take it you have something like

  case '%':
    echo = TRUE;
    break;

?

> else if (emote)
> argument++
> else if (echo)
> argument++

What if statement is this a part of?  Why are you doing this here rather
than in case '%' and case '*'?

  case '%':
    echo = TRUE;
    argument++;
    break;
  case '*':
    emote = TRUE;
    argument++;
    break;

Or, at least, instead of 'if (emote) foo; else if (echo) foo;' do

  if (emote || echo)
    argument++;

which is shorter and more to the point.

> if (echo == TRUE)
> sprintf(buf1, "(Wiznet) %s", argument);
> sprintf(buf2, "(Wiznet) %s", argument);
> else

I take it this is really

  if (echo) {
    sprintf(buf1, "(Wiznet) %s", argument);
    sprintf(buf2, "(Wiznet) %s", argument);
  } else if (emote) {
    /* Write emote stuff to buf1, buf2 */
  } else {
    /* Regular wiznet stuff to buf1, buf2 */
  }

  /* Send buf1 and buf2 to appropriate targets. */

As it stands, the code you've provided won't compile due to a variety of
syntax errors.  It's not clear which (if any) of these are errors in your
reproduction of the code (almost every platform I've seen or used has some
form of cut-and-paste or reading files into the mailer, so you might want
to do that instead) or actual problems with the code that might have some
impact on its buggy behavior.

Thanks for at least _trying_ to include the necessary information to get
help, but I'm afraid if none of the above shots in the dark are of
assistance, you'll have to try again and provide a better demonstration of
what you're doing.

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST