Results 1 to 5 of 5

Thread: Question regarding Inc

  1. #1
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default Question regarding Inc

    Okay so I modified Clarity's wells script to make it usable with Mills. Working great so far but I had to remove his inc process (a failsafe for banking) because it constantly inc's the value and doesn't ever reset it.

    Simba Code:
    begin
      if combat.hasTarget() then exit;
      if dialogue.hasDialogue() then
        typeByte(VK_ESCAPE);
      inc(didNotMix);
      if didNotMix > 10 then
      begin
        ClarityDebug('Out of supplies!  Terminating script.');
        terminateScript;
      end;

    Now the above is directly cut from his script not mine but I did try mimicking it and it will run through 4-5 times then close out. This is within a procedure that opens the bank and no it doesn't open the bank up 10 times let alone show a dialogue. This is leading me to believe that the inc (didNotMix) isn't getting reset? If anyone could help explain how inc works and any tips/suggestions on using it correctly?

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Is didNotMix a local variable? If it is it will be reset when the function it's in is exited.

  3. #3
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    inc( ) just increments an integer.

    Simba Code:
    inc(didNotMix);
    didNotMix := didNotMix + 1;
    didNotMix += 1;

    We can't see if anything is reset or not because you seem to be missing half of the code.

  4. #4
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    inc( ) just increments an integer.

    Simba Code:
    inc(didNotMix);
    didNotMix := didNotMix + 1;
    didNotMix += 1;

    We can't see if anything is reset or not because you seem to be missing half of the code.
    Global, which explains why it's not reseting. Thanks all.

  5. #5
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •