Re: DG scripts

From: The Merciless lord of Everything (serces@MUD.DK)
Date: 05/22/98


> Hmm...might be seeing it. Any chance your do_say, do_gen_comm, and do_echo
> aren't working? I asked for help on this about a week ago, and didn't get any
> responses. I have no idea what to do. Only thing I added was MobProgs and
> OasisOLCPlus (w/dg, but already had DGEvents), other than that it's stock
> code...it just won't work. GOSSIP, SAY, EMOTE, ECHO, all broken. (Wiznet does
> work.)
Huh??? I imped DG-Scripting some time ago, and didn't have any
problems with this, sorry for not responding to the question about
mecho/mechoaround, but I've been tied into a little knot lately.. :)

What did annoy me is the fact that WZONEECHO sends to realzone
instead of VNUMzone. E.g. WZONEECHO 12 sends to  Zone Number 12 in
the zonetable, not Zone 1200 (Or whatever it is called) I *ahem*
Altered the send_to_zone a bit, since It's a nice thing to have, and
erh, Very usefull! (I made MZONEECHO, OZONEECHO and ZECHO commands so
that it can be used from MobTriggers, OBJTriggers and IMMS have a
command that echoes through a zone as well..)

Here's the changed part.. Don't want any credits at all, just *HAIL*
DG_SCRIPT and it's author. (Changes sent to author as well)

------------------------ *SNIP* ---------  in dg_comm.c
void send_to_zone(char *messg, int zone)
{
  struct descriptor_data *i;

  if (!messg || !*messg)
    return;

  for (i = descriptor_list; i; i = i->next)
    if (!i->connected && i->character && AWAKE(i->character) &&
        (IN_ROOM(i->character) != NOWHERE) &&
        (zone_table[world[IN_ROOM(i->character)].zone].number ==
        zone))
      SEND_TO_Q(messg, i);
}
-------------------- *SNIPENDS* --------------------------
Oh yeah.. WZONEECHO needs to be changed as well..
-------------------- *SNIP* ----------- in dg_wldcmd.c
WCMD(do_wzoneecho)
{
    int zone, i;
    bool found = FALSE;
    char zone_name[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], *msg;

    msg = any_one_arg(argument, zone_name);
    skip_spaces(&msg);

    if (!*zone_name || !*msg)
     wld_log(room, "wzoneecho called with too few args");

    zone = atoi(zone_name);
    for (i=0;i<=top_of_zone_table;i++)
     if (zone_table[i].number == zone) {
      found = TRUE;
      break;
     }
    if (!found)
     wld_log(room, "wzoneecho called for nonexistant zone");
    else {
        sprintf(buf, "%s\r\n", msg);
        send_to_zone(buf, zone);
    }
}
-------------------- *SNIPENDS* --------------------------

That should do the trick..

Also MECHO needs to be defined before MECHOAROUND in interpreter.c

Hope this helps just a little bit.. :) I'll ship off ZECHO, MZONEECHO
and OZONEECHO (Nothing to do with OZONE) a little later today.. :)

S. P. Skou
Serces - Ancient at the Realm of Chaos - chaos.mud.dk 4000


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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