Welcome to the Builder Academy

Question Where guard

More
25 Dec 2024 10:10 - 25 Dec 2024 20:55 #10489 by JTP
Where guard was created by JTP
hi

If you do a where guard or where sword og something else that there are a lot of, then it makes an overflow.

How could a code change make a pause for every X amount of results ?

It also gives overflow on tbamud.com:9091
Last edit: 25 Dec 2024 20:55 by JTP.

Please Log in or Create an account to join the conversation.

More
26 Dec 2024 21:19 #10490 by cunning
Replied by cunning on topic Where guard
did you make any attempt to find and trace **OVERFLOW**?

Please Log in or Create an account to join the conversation.

More
29 Dec 2024 19:40 - 29 Dec 2024 19:50 #10497 by JTP
Replied by JTP on topic Where guard
I don't have cpu time nor memory to run it other then if a crash and make a core file

But it's ot crashing. But being this is also a TBAmud problem then it would be nice to fix for future update

And also be nice to have fixed in general instead of getting 200 results scolling by
Last edit: 29 Dec 2024 19:50 by JTP.

Please Log in or Create an account to join the conversation.

More
30 Dec 2024 11:18 #10499 by thomas
Replied by thomas on topic Where guard
This sounds like something we should address, yes - it's easily testable :)
We are a little limited by the way paging is handled, but I think we should be able to do something about it.

Please Log in or Create an account to join the conversation.

More
30 Dec 2024 17:11 #10501 by thomas
Replied by thomas on topic Where guard
I made a quick fix in github.com/tbamud/tbamud/commit/5e596c53...037b543588847d5647f6 - and amended it a bit with github.com/tbamud/tbamud/pull/142/files where I added at preference for toggling if you want the rooms of mobs you see carrying/wearing items as well.

Please Log in or Create an account to join the conversation.

More
08 Jan 2025 20:58 - 08 Jan 2025 21:23 #10511 by JTP
Replied by JTP on topic Where guard
Ok I tried to enter your version with verbose...

Don't have this line in prefedit.c so I can't change it, so what do I do ?:

send_to_char(d->character, "%s7%s) Zone Resets  %s[%s%3s%s]\r\n",


in act.informative.c I'm getting this error:

act.informative.c: In function ‘do_toggle’:
act.informative.c:2343: error: expected expression before ‘}’ token
act.informative.c:2343: warning: format ‘%-3s’ expects type ‘char *’, but argument 3 has type ‘int’
act.informative.c:2343: error: expected ‘;’ before ‘}’ token





        ONOFF(PRF_FLAGGED(ch, PRF_BUILDWALK)),
        ONOFF(PRF_FLAGGED(ch, PRF_NOWIZ)),
        ONOFF(PRF_FLAGGED(ch, PRF_CLS)),
        ONOFF(PRF_FLAGGED(ch, PRF_NOHASSLE)),
        ONOFF(PRF_FLAGGED(ch, PRF_HOLYLIGHT)),
        ONOFF(PRF_FLAGGED(ch, PRF_SHOWVNUMS)), 
        types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)],
        ONOFF(PRF_FLAGGED(ch, PRF_VERBOSE)),  << this is line 2343
  }
And I don't have this line  after from your file: GET_LEVEL(ch) == LVL_IMPL ? "" : "\r\n");

..
this is the only other change that I had to make on my own as ive made in prefedit.c to v/V as I already had a case '7':

      case 'v':
      case 'V':
        if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
        {
        send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
        prefedit_disp_main_menu(d);
        }
        else
        {
        TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_VERBOSE);
        }
        break;



This is my do_toggle:

ACMD(do_toggle)
{
  char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
  int toggle, tp, wimp_lev, result = 0, len = 0, i;
  const char *types[] = { "off", "brief", "normal", "on", "\n" };

    const struct {
    char *command;
    bitvector_t toggle; /* this needs changing once hashmaps are implemented */
    char min_level;
    char *disable_msg;
    char *enable_msg;
  } tog_messages[] = {
    {"summonable", PRF_SUMMONABLE, 0,
    "You are now safe from summoning by other players.\r\n",
    "You may now be summoned by other players.\r\n"},
    {"nohassle", PRF_NOHASSLE, LVL_IMMORT,
    "Nohassle disabled.\r\n",
    "Nohassle enabled.\r\n"},
    {"brief", PRF_BRIEF, 0,
    "Brief mode off.\r\n",
    "Brief mode on.\r\n"},
    {"compact", PRF_COMPACT, 0,
    "Compact mode off.\r\n",
    "Compact mode on.\r\n"},
    {"notell", PRF_NOTELL, 0,
    "You can now hear tells.\r\n",
    "You are now deaf to tells.\r\n"},
    {"noauction", PRF_NOAUCT, 0,
    "You can now hear auctions.\r\n",
    "You are now deaf to auctions.\r\n"},
    {"noshout", PRF_NOSHOUT, 0,
    "You can now hear shouts.\r\n",
    "You are now deaf to shouts.\r\n"},
    {"nogossip", PRF_NOGOSS, 0,
    "You can now hear gossip.\r\n",
    "You are now deaf to gossip.\r\n"},
    {"nograts", PRF_NOGRATZ, 0,
    "You can now hear gratz.\r\n",
    "You are now deaf to gratz.\r\n"},
    {"nowiz", PRF_NOWIZ, LVL_IMMORT,
    "You can now hear the Wiz-channel.\r\n",
    "You are now deaf to the Wiz-channel.\r\n"},
    {"quest", PRF_QUEST, 0,
    "You are no longer part of the Quest.\r\n",
    "Okay, you are part of the Quest.\r\n"},
    {"showvnums", PRF_SHOWVNUMS, LVL_IMMORT,
    "You will no longer see the vnums.\r\n",
    "You will now see the vnums.\r\n"},
    {"norepeat", PRF_NOREPEAT, 0,
    "You will now have your communication repeated.\r\n",
    "You will no longer have your communication repeated.\r\n"},
    {"holylight", PRF_HOLYLIGHT, LVL_IMMORT,
    "HolyLight mode off.\r\n",
    "HolyLight mode on.\r\n"},
    {"slownameserver", 0, LVL_IMPL,
    "Nameserver_is_slow changed to OFF; IP addresses will now be resolved.\r\n",
    "Nameserver_is_slow changed to ON; sitenames will no longer be resolved.\r\n"},
    {"autoexits", PRF_AUTOEXIT, 0,
    "Autoexits disabled.\r\n",
    "Autoexits enabled.\r\n"},
    {"trackthru", 0, LVL_IMPL,
    "Players can no longer track through doors.\r\n",
    "Players can now track through doors.\r\n"},
    {"clsolc", PRF_CLS, LVL_BUILDER,
    "You will no longer clear screen in OLC.\r\n",
    "You will now clear screen in OLC.\r\n"},
    {"buildwalk", PRF_BUILDWALK, LVL_BUILDER,
    "Buildwalk is now Off.\r\n",
    "Buildwalk is now On.\r\n"},
    {"afk", PRF_AFK, 0,
    "AFK is now Off.\r\n",
    "AFK is now On.\r\n"},
    {"autoloot", PRF_AUTOLOOT, 0,
    "Autoloot disabled.\r\n",
    "Autoloot enabled.\r\n"},
    {"autogold", PRF_AUTOGOLD, 0,
    "Autogold disabled.\r\n",
    "Autogold enabled.\r\n"},
    {"autosplit", PRF_AUTOSPLIT, 0,
    "Autosplit disabled.\r\n",
    "Autosplit enabled.\r\n"},
    {"autosac", PRF_AUTOSAC, 0,
    "Autosac disabled.\r\n",
    "Autosac enabled.\r\n"},
    {"autoassist", PRF_AUTOASSIST, 0,
    "Autoassist disabled.\r\n",
    "Autoassist enabled.\r\n"},
    {"automap", PRF_AUTOMAP, 1,
    "You will no longer see the mini-map.\r\n",
    "You will now see a mini-map at the side of room descriptions.\r\n"},
    {"autokey", PRF_AUTOKEY, 0,
    "You will now have to unlock doors manually before opening.\r\n",
    "You will now automatically unlock doors when opening them (if you have the key).\r\n"},
    {"autodoor", PRF_AUTODOOR, 0,
    "You will now need to specify a door direction when opening, closing and unlocking.\r\n",
    "You will now find the next available door when opening, closing or unlocking.\r\n"},
    {"color", 0, 0, "\n", "\n"},
    {"verbose", PRF_VERBOSE, LVL_IMMORT,
    "You will no longer see verbose output in listings.\r\n",
    "You will now see verbose listings.\r\n"},
    {"syslog", 0, LVL_IMMORT, "\n", "\r\n"},
    {"wimpy", 0, 0, "\n", "\n"},
    {"pagelength", 0, 0, "\n", "\n"},
    {"screenwidth", 0, 0, "\n", "\n"},
    {"\n", 0, -1, "\n", "\n"} /* must be last */
  };

  if (IS_NPC(ch))
    return;

  argument = one_argument(argument, arg);
  any_one_arg(argument, arg2); /* so that we don't skip 'on' */

  if (!*arg) {
    if (!GET_WIMP_LEV(ch))
      strcpy(buf2, "OFF");        /* strcpy: OK */
    else
      sprintf(buf2, "%-3.3d", GET_WIMP_LEV(ch));  /* sprintf: OK */

if (GET_LEVEL(ch) == LVL_IMPL) {
      send_to_char(ch,
        " SlowNameserver: %-3s  "
"                        "
" Trackthru Doors: %-3s\r\n",

ONOFF(CONFIG_NS_IS_SLOW),
ONOFF(CONFIG_TRACK_T_DOORS));
    }

    if (GET_LEVEL(ch) >= LVL_IMMORT) {
      send_to_char(ch,
        "      Buildwalk: %-3s    "
        "          NoWiz: %-3s    "
        "        ClsOLC: %-3s\r\n"
        "      NoHassle: %-3s    "
        "      Holylight: %-3s    "
        "      ShowVnums: %-3s\r\n"
        "        Syslog: %-3s    "
        "        Verbose: %-3s%s  ",

        ONOFF(PRF_FLAGGED(ch, PRF_BUILDWALK)),
        ONOFF(PRF_FLAGGED(ch, PRF_NOWIZ)),
        ONOFF(PRF_FLAGGED(ch, PRF_CLS)),
        ONOFF(PRF_FLAGGED(ch, PRF_NOHASSLE)),
        ONOFF(PRF_FLAGGED(ch, PRF_HOLYLIGHT)),
        ONOFF(PRF_FLAGGED(ch, PRF_SHOWVNUMS)),
        types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)],
ONOFF(PRF_FLAGGED(ch, PRF_VERBOSE)),
    }

  send_to_char(ch,
    "Hit Pnt Display: %-3s    "
    "          Brief: %-3s    "
    "    Summonable: %-3s\r\n"

    "  Move Display: %-3s    "
    "        Compact: %-3s    "
    "          Quest: %-3s\r\n"

    "  Mana Display: %-3s    "
    "        NoTell: %-3s    "
    "      NoRepeat: %-3s\r\n"

    "      AutoExits: %-3s    "
    "        NoShout: %-3s    "
    "          Wimpy: %-3s\r\n"

    "      NoGossip: %-3s    "
    "      NoAuction: %-3s    "
    "        NoGrats: %-3s\r\n"

    "      AutoLoot: %-3s    "
    "      AutoGold: %-3s    "
    "      AutoSplit: %-3s\r\n"

    "        AutoSac: %-3s    "
    "    AutoAssist: %-3s    "
    "        AutoMap: %-3s\r\n"

    "    Pagelength: %-3d    "
    "    Screenwidth: %-3d    "
    "            AFK: %-3s\r\n"

    "        Autokey: %-3s    "
    "      Autodoor: %-3s    "
    "          Color: %s    \r\n ",

    ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)),
    ONOFF(PRF_FLAGGED(ch, PRF_BRIEF)),
    ONOFF(PRF_FLAGGED(ch, PRF_SUMMONABLE)),

    ONOFF(PRF_FLAGGED(ch, PRF_DISPMOVE)),
    ONOFF(PRF_FLAGGED(ch, PRF_COMPACT)),
    ONOFF(PRF_FLAGGED(ch, PRF_QUEST)),

    ONOFF(PRF_FLAGGED(ch, PRF_DISPMANA)),
    ONOFF(PRF_FLAGGED(ch, PRF_NOTELL)),
    ONOFF(PRF_FLAGGED(ch, PRF_NOREPEAT)),

    ONOFF(PRF_FLAGGED(ch, PRF_AUTOEXIT)),
    ONOFF(PRF_FLAGGED(ch, PRF_NOSHOUT)),
    buf2,

    ONOFF(PRF_FLAGGED(ch, PRF_NOGOSS)),
    ONOFF(PRF_FLAGGED(ch, PRF_NOAUCT)),
    ONOFF(PRF_FLAGGED(ch, PRF_NOGRATZ)),

    ONOFF(PRF_FLAGGED(ch, PRF_AUTOLOOT)),
    ONOFF(PRF_FLAGGED(ch, PRF_AUTOGOLD)),
    ONOFF(PRF_FLAGGED(ch, PRF_AUTOSPLIT)),

    ONOFF(PRF_FLAGGED(ch, PRF_AUTOSAC)),
    ONOFF(PRF_FLAGGED(ch, PRF_AUTOASSIST)),
    ONOFF(PRF_FLAGGED(ch, PRF_AUTOMAP)),

    GET_PAGE_LENGTH(ch),
    GET_SCREEN_WIDTH(ch),
    ONOFF(PRF_FLAGGED(ch, PRF_AFK)),

    ONOFF(PRF_FLAGGED(ch, PRF_AUTOKEY)),
    ONOFF(PRF_FLAGGED(ch, PRF_AUTODOOR)),
    types[COLOR_LEV(ch)]);
    return;
  }

I'm not a programmer. I'm just a teacher trying to make some young guys with ADHD have fun.
Last edit: 08 Jan 2025 21:23 by JTP.

Please Log in or Create an account to join the conversation.

Time to create page: 0.205 seconds