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!

CodeChunk Question: More than 1 Actionmanager.DoAction

Munkee

New Member
Joined
Dec 9, 2012
Messages
29
I'm trying make a list of actions in <CodeChunk>, is this doable? I'm making a profile that gathers and crafts but it has to craft 7 items in 1 profile, that uses the same actions. I wanted to simplify it by making 1 set of it and then have the other recipes call the set when it's time to craft it.

This:
Code:
				<While Condition="CraftingManager.IsCrafting">
					<CraftActionByName Name="Great Strides" />
					<CraftActionByName Name="Steady Hand II" />
					<CraftActionByName Name="Innovation" />
					<CraftActionByName Name="Advanced Touch" />
					<CraftActionByName Name="Great Strides" />
					<CraftActionByName Name="Advanced Touch" />
					<CraftActionByName Name="Careful Synthesis II" />
				</While>

Into This: (doable?)
Code:
			<![CDATA[
				SpellData data;
				Actionmanager.DoAction("Great Strides", null);
				await Coroutine.Sleep(250);
				Actionmanager.DoAction("Steady Hands II", null);
				await Coroutine.Sleep(250);
				Actionmanager.DoAction("Innovation", null);
				await Coroutine.Sleep(250);
				Actionmanager.DoAction("Advanced Touch", null);
				await Coroutine.Sleep(250);
				Actionmanager.DoAction("Careful Synthesis II", null);
				await Coroutine.Sleep(250);
							
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);

				await Coroutine.Sleep(250);
			]]>

Currently, it just spams Great Strides over and over :-(
 
Not had a chance to mess with it but I would try something like this...

The await may also need to be increased so that it doesn't skip any skills.

Code:
<![CDATA[
				SpellData data;
if (Actionmanager.CurrentActions.TryGetValue("Great Strides", out data) && Actionmanager.CanCast(data, null))
{
				Actionmanager.DoAction("Great Strides", null);
				await Coroutine.Sleep(250);
}
if (Actionmanager.CurrentActions.TryGetValue("Steady Hands II", out data) && Actionmanager.CanCast(data, null))
{
				Actionmanager.DoAction("Steady Hands II", null);
				await Coroutine.Sleep(250);
}
if (Actionmanager.CurrentActions.TryGetValue("Innovation", out data) && Actionmanager.CanCast(data, null))
{
				Actionmanager.DoAction("Innovation", null);
				await Coroutine.Sleep(250);
}
if (Actionmanager.CurrentActions.TryGetValue("Advanced Touch", out data) && Actionmanager.CanCast(data, null))
{
				Actionmanager.DoAction("Advanced Touch", null);
				await Coroutine.Sleep(250);
}
if (Actionmanager.CurrentActions.TryGetValue("Careful Synthesis II", out data) && Actionmanager.CanCast(data, null))
{
				Actionmanager.DoAction("Careful Synthesis II", null);
				await Coroutine.Sleep(250);
}
							
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);

				await Coroutine.Sleep(250);
			]]>
 
Thx Sycho, but it's doing what my original code is doing. Keeps spamming Great Strides. Going to play with this a bit and see. Thx again.
 
This works:

Code:
			<![CDATA[
				SpellData data;

				Actionmanager.DoAction("Great Strides", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);
				
				Actionmanager.DoAction("Steady Hand II", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);

				Actionmanager.DoAction("Innovation", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);

				Actionmanager.DoAction("Advanced Touch", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);
				
				Actionmanager.DoAction("Great Strides", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);
				
				Actionmanager.DoAction("Advanced Touch", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);
				
				Actionmanager.DoAction("Careful Synthesis II", null);
				await Coroutine.Wait(10000, () => CraftingManager.AnimationLocked);
				await Coroutine.Wait(Timeout.Infinite, () => !CraftingManager.AnimationLocked);
				await Coroutine.Sleep(250);
				
			]]>

You can also do this, but you need to change the value for Sleep(). The above does it right after the animation lock:

Code:
			Actionmanager.DoAction("Great Strides", null);
				await Coroutine.Sleep(2500);

I tried to remove await Coroutine.Sleep(250) from the above big chunk of code and it was crafting super fast, looks bad.. LOL.
 
I do most of my crafting in my private estate so the speed crafting works for me. :)
 
Back
Top