• Visit Rebornbuddy
  • Scripting: OR Operator usage?

    Discussion in 'Community Developer Forum' started by Tinytox, Jan 25, 2015.

    1. Tinytox

      Tinytox Member

      Joined:
      Nov 5, 2014
      Messages:
      370
      Likes Received:
      7
      Trophy Points:
      18
      Trying to tweak a gathering orderbot profile so that Gathering ends when i have >9900 of one item, OR >9900 of another item

      The "OR" operator I have [Stolen from another script] seems to function more like an "AND" operator.

      The line in question in the script is as follows:

      Code:
      <Gather while ="(ItemCount(11) &lt; 9900) or (ItemCount(5) &lt; 9900)">
      The idea is: Gather 9900 shards, or 9900 crystals, one of them will finish first, and we can't predict which... Stop if either of them hit quantity 9900.

      The code above actually seems to, as i said, work as in "and".. it requires both of the items to be at the specified value before it will move on. This is important, because if either of these values hit 9999, at any time during the execution of the script, it will just continuously try to mine them anyhow, and, unfortunately, since the nodes are different, I cannot mine crystals without also mining shards. I have to have a legitimate OR function to make it work. I tried encapsulating IF statements and gather tags, I just got, more or less as i expected, a log spammed full of errors.

      Disclaimer: I'm not trying to be an asshole, I'm not a programmer, but, shouldn't the current OR operator really be called an AND operator, or something? :X
       
    2. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      User error. If either one of those conditionals returns true, it will continue. If you change it to an 'and' you will have your desired behavior, where it will gather as long as both of those conditionals are true.
       
    3. Tinytox

      Tinytox Member

      Joined:
      Nov 5, 2014
      Messages:
      370
      Likes Received:
      7
      Trophy Points:
      18
      Actually, now that I think about it, in the if statement, and read out aloud, it makes perfect sense. Thanks Kagami!
       

    Share This Page