What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Checking Stacks in Crafting Profile

kagepande

Community Developer
Joined
Oct 20, 2014
Messages
289
Heya, is there currently any way to check for stacks of a aura while crafting? Like if I have 5 stacks of inner quiet or if I have 3 stacks of Steady Hand II? Im trying to do this inside of a <If Condition=""> for some of my 3/4 star crafting profiles I am making.
 
Yup.

Code:
Core.Me.GetAuraById(AuraId).Value

Always check that you have the aura first or you might get a reference null exception there.
 
Well I found that by looking into other peoples stuff, but I am trying to do so inside of a .xml profile if that makes any difference.
 
I'm not entirely sure, since I haven't done any xml profiles really, but I believe it should still work. You could try something like:

Code:
<If Condition="Core.Me.HasAura(AuraId)">
  <If Condition="Core.Me.GetAuraById(AuraId).Value == 2">
    <Do Something>
  </If>
</If>

Or whatever the equals symbol is for the XML profiles.
 
Code:
(Core.Player.CharacterAuras As Auras).GetAuraStacksById(ID)
Don't use Neverdyne's code as it will throw a nullpointerexception if you don't have that aura.
 
Could you give me an example, I understand how all of this works in a C# file, but im trying to work with the .xml profiles for orderbot. So its getting me a bit confused.
 
You can slap almost any valid C# code into a profiles XML

Code:
  <If Condition="(Core.Player.CharacterAuras As Auras).GetAuraStacksById(ID) &lt; 5">
    <CraftAction PEWPEW>
  </If>
 
Alright I tried running your code in a simple profile to test it but it errors out and stops the bot, I was using the following profile:
Code:
<Profile>
    <Name>Bacon Bread - 4*</Name>
	<KillRadius>50</KillRadius>
	<GrindAreas> 
	</GrindAreas>
	<Order>
		<While Condition="True">
			<Synthesize RecipeId="30865" />
			<While Condition="CraftingManager.IsCrafting">
				<CraftAction Name="Inner Quiet" ActionId="259" />
				<CraftAction Name="Steady Hand II" ActionId="281" />
				<CraftAction Name="Advanced Touch" ActionId="100112" />
				<If Condition="(Core.Player.CharacterAuras As Auras).GetAuraStacksById(259) &lt; 5">
					<CraftAction Name="Advanced Touch" ActionId="100112" />
				</If>
				<CraftAction Name="Basic Touch" ActionId="100106" />
			</While>
		</While>
	</Order>
</Profile>

And here is the log: View attachment 13192 2015-02-15 22.03.txt

Thanks for the help by the way, really appreciate it.
 
Hrm, try

Code:
((Auras)Core.Player.CharacterAuras).GetAuraStacksById(259)
 
Yea, looks like the python interpreter doesn't like it when you try and typecast, you'll need to use the two part code that Neverdyne in his second post until the next version. I forgot to change the Auras class to return the updated type.
 
Alright I went to his code and put it into the profile and once it got to the point to check if Inner Quiet had 2 stacks it just ignored it and started from the top again.
Code:
<Profile>
    <Name>Bacon Bread - 4*</Name>
	<KillRadius>50</KillRadius>
	<GrindAreas> 
	</GrindAreas>
	<Order>
		<While Condition="True">
			<Synthesize RecipeId="30865" />
			<While Condition="CraftingManager.IsCrafting">
				<CraftAction Name="Inner Quiet" ActionId="259" />
				<CraftAction Name="Steady Hand II" ActionId="281" />
				<CraftAction Name="Advanced Touch" ActionId="100112" />
				<If Condition="Core.Me.HasAura(259)">
					<If Condition="Core.Me.GetAuraById(259).Value == 2">
					<CraftAction Name="Advanced Touch" ActionId="100112" />
					</If>
				</If>
			</While>
		</While>
	</Order>
</Profile>

Heres the log:View attachment 22764 2015-02-15 22.29.txt

Though nothing useful seems to be in it. I can see that the bot stopped because:
Code:
[06:29:59.840 N] Stopping the bot. Reason:[CraftAction] Could not cast Inner Quiet (259), stopping bot!

But it does this after it has cast Advanced Touch once, pretty much skips over the part to check for stacks, and trys to go from the top of the profile again.
 
Heya, just updated RB and tried to do this again, and its giving the same exact errors as yesterday, don't know what to do, using exact same profile, tried all code snippets you provided but same errors as those in the logs.
 
Ofcouse, new code does not require casts.

Code:
Core.Player.CharacterAuras.GetAuraStacksById
 
Thank you very much, it works perfectly :) Thank you for fixing this very quickly and putting up with me! :D
 
Back
Top