• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • OrderBot - BuyItem tag within If statement

    Discussion in 'Community Developer Forum' started by Yasuko, Jan 8, 2015.

    1. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      im currently using the following code to test out the buyitem tag:

      Code:
       		<If Condition="(ItemCount(2653) &lt;=  5)">
      			<BuyItem ItemIds="2653" ItemCounts="5" InteractDistance="3.0"  NpcId="1001965" XYZ="124.9656, 4, -60.49659" DialogOption="0" />
      			</If>
      
      When the bot makes it to the vendor it will open dialog just fine and purchase the item, but after it purchases the item one time, it will close out of the entire window.. and retarget the npc and continue till the count is successfull.. I know this is most likely happening because it is within an IF statement since RB log says that its interacting with the vendor and purchasing 5 items.. every time it opens the window..

      My question is.. what is the correct way to to use the BuyItem tag in an orderbot profile without it constantly closing the NPC window after it buys one item.. then opens again to buy that same item again till the number count has been reached? Ive found that this takes alot longer to do this way.. lol.

      Thank you,
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Has nothing todo with the If. I'll look in to it. (You could have easily tested it without the if)
       
    3. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      I just tried testing it without the if statement as you were writing that.

      It does the same thing

      <BuyItem ItemIds="2653" ItemCounts="5" InteractDistance="3.0" NpcId="1001965" XYZ="124.9656, 4, -60.49659" DialogOption="0" />

      but it will open the window, buy 1.. then close, and continue with profile.. since that is the only thing in the order section.. the bot just stops since profile is completed
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Yea, if tags are kinda weird. Im changing buytag so to better handle items that you can only buy one of at a time.
       
    5. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      OH, so that tag was supposed to be used for buying items that allow you to buy in stacks? That makes more sense.. I didnt even consider that
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      No your usage was correct, i just never thought anyone would want todo it. I've already gone and fixed it for the next version.
       
    7. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      Automated Tier 1 SB profile since people are stupid and buying tier 1 materia at retarded prices <3 ty for looking at it.
       
    8. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Can you provide your entire profile. I tried to replicate the issue of the if statement being executed more then once but couldn't.
       
    9. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      Sorry for late reply:

      I had deleted it and resaved it a few different times since then.. my last save on it was testing the buyitem tag all by itself.. but basically what I had was:
      Code:
         <Order>
         <While Condition="True">
      		<If Condition="ItemCount(4422) &lt; 1">
      			<BuyItem ItemIds="4422" ItemCounts="5" InteractDistance="3.0"  NpcId="1001964" XYZ="119.3314, 4.009998, -69.85821" DialogOption="0"/>
      		</If>
      	</While>
         </Order>
      
      *edited: was able to undo everything since notepad++ had been open the entire time.. removed all the other if conditions as well.
      Also : I have tried it without the while condition being true, and it would do the same thing.. but it would only run the if statement once (obviously).. but the buyitem tag would still only buy one item before moving to the next, would not buy all 5


      I had that for a full set of gear.. each piece in their different if statements.. what it would do is cycle through the if statements one by one, buying one of each item and do so till each item has been bought the number of times in the if statement, even if i had the count set to 5 in the buytag... Was using while condition = true so that it would automatically go back and buy more once it sb'ed them.

      I have noticed that when using the "while true" that once it bought the number of items, ffxiv would totally freeze up and crash.. im sure that is something I am doing wrong within the profile, since im not that familiar with orderbot profile writing yet.. just thought I would throw that out there.
       
      Last edited: Jan 9, 2015
    10. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      This is expected, you didn't tell me you had it wrapped in a while tag, so I was trying to figure out why if statement was getting called over and over.
       
    11. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      No, I knew why the if statement was getting called over and over, it was because it was in a while tag and the buyitem tag was only buying one item at a time.. that makes sense to me, the entire question was regarding if i was using the buyitem tag correctly since it was only buying 1 item at a time even though i had it set to buy 5 at a time.
       

    Share This Page