• Visit Rebornbuddy
  • [Request] Adamantite Ore

    Discussion in 'Rebornbuddy Profiles' started by becto, Aug 25, 2015.

    1. becto

      becto Member

      Joined:
      Mar 14, 2014
      Messages:
      104
      Likes Received:
      5
      Trophy Points:
      18
      (SOLVED) [Request] Adamantite Ore

      exMatt has done it again, making our dreams come true.

      Follow his post below in post #7 (here) and follow the directions.

      What this does...well, exactly what is described in my original post below.

      Original Post:
       
      Last edited: Aug 27, 2015
    2. tichy

      tichy Member

      Joined:
      Jun 6, 2015
      Messages:
      142
      Likes Received:
      3
      Trophy Points:
      18
      Would it not detect the llive unspoiled node if the hotspot radius is large enough or am I missing something?
       
    3. tishat

      tishat Member

      Joined:
      May 29, 2015
      Messages:
      735
      Likes Received:
      7
      Trophy Points:
      18
      He would like it to land at the safespots, and not just beeline to the node (and probably have a 100% probability of death at 1 and 3) :)
       
    4. tichy

      tichy Member

      Joined:
      Jun 6, 2015
      Messages:
      142
      Likes Received:
      3
      Trophy Points:
      18
      ahhh right!

      RB itself has code which detects which nodes are active (I don't have the slightest clue about programming so please choose to disregard everything in this message if it sounds el stupido) and I'm guessing it's embedded in the code behind gathertag somewhere. I just don't think this is 'exposed' for playing around with with orderbot and would probably be the province of a plugin....but hoping not!
       
    5. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      Maybe you can build something using this code example

      Here is my attempt at some things that should help.

      Code:
      
      var node =
      	GameObjectManager.GetObjectsOfType<GatheringPointObject>()
      		// Dont need this line.. only one node .OrderBy(gpo => gpo.Distance2D(Core.Me.Location))
      		.FirstOrDefault(
      			gpo =>
      			gpo.EnglishName == "Unspoiled Mineral Deposit"
      			&& gpo.IsVisible && gpo.IsValid);
      			
      if (node != null)
      {
      	MovementManager.SetFacing(node.Location);
      	var safeSpot = GetSafeSpot(Core.Player.Heading);
      	
      	//FlyTo LocalSafeSpot
      	//Stealth
      	Poi.Current = new Poi(node, PoiType.Gather);
      	Poi.Current.Unit.Interact();
      	
      	// Kings yield 2
      	Actionmanager.DoAction(241, Core.Player);
      	// Sharp vision
      	Actionmanager.DoAction(235, Core.Player);
      	while (GatheringManager.SwingsRemaining > 0)
      	{
      		GatheringManager.GetGatheringItemByIndex(5).GatherItem();
      	}
              Poi.Clear();
      	//MoveTo LocalSafeSpot
      	//FlyTo MainSafeSpot
      }
      
      // Determines the safe spot based off the direction you are facing (towards the node that spawned).
      public Vector3 GetSafeSpot(float heading)
      {
      	if (heading >= 0 && heading < 2)
      	{
      		return new new Vector3(1,2,3);
      	}
      	else if (heading >= 2 && heading < 4)
      	{
      		return new new Vector3(4,5,6);
      	}
      	
      	return new Vector3(7,8,9);
      }
      
      If you were collecting instead of gathering, you would use....
      
      
                  await castSpell("Impulsive Appraisal");
                  if (Core.Player.HasAura("Discerning Eye")) await castSpell("Single Mind");
                  else await castSpell("Discerning Eye");
                  await castSpell("Impulsive Appraisal");
                  if (Core.Player.HasAura("Discerning Eye")) await castSpell("Single Mind");
                  else await castSpell("Discerning Eye");
                  await castSpell("Methodical Appraisal");
      while(GatheringManager.SwingsRemaining > 0)
      {
                  await Coroutine.Sleep(500);
                  RaptureAtkUnitManager.Update();
      
                  await Coroutine.Wait(5000, () => RaptureAtkUnitManager.GetWindowByName("GatheringMasterpiece") != null);
                  while (!ff14bot.RemoteWindows.SelectYesNoItem.IsOpen)
                  {
                      RaptureAtkUnitManager.GetWindowByName("GatheringMasterpiece").SendAction(1, 1, 0);
                      await Coroutine.Wait(500, () => ff14bot.RemoteWindows.SelectYesNoItem.IsOpen);
                  }
      
                  ff14bot.RemoteWindows.SelectYesNoItem.Yes();
                  await Coroutine.Wait(5000, () => !ff14bot.RemoteWindows.SelectYesNoItem.IsOpen);
                  await Coroutine.Sleep(500);
      }
      
      
       
      Last edited: Aug 26, 2015
    6. goldenlion

      goldenlion New Member

      Joined:
      Oct 20, 2013
      Messages:
      106
      Likes Received:
      0
      Trophy Points:
      0
    7. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      Adamantite... try this

      Instructions...

      If you already have FlightPathTo, you can disregard that file.

      Move FlightPathTo into RBDirectory\Plugins\OrderBotTags (suggested location)

      Move the xml profile anywhere you like, and then create a directory called Custom in the same location and place the SafeCollectAdamantite.cs inside that directory.



      Feedback would be excellent.



      There seems to be a mistake in the SafeCollect code..

      if (heading >= 5.7 && heading < 1.5)

      should be

      if (heading >= 5.7 || heading < 1.5)

      Sorry, I am in the middle of some refactoring to make this code work more generically so I am not going to repost the files yet.
       

      Attached Files:

      Last edited: Aug 27, 2015
      schopenhauer and becto like this.
    8. tichy

      tichy Member

      Joined:
      Jun 6, 2015
      Messages:
      142
      Likes Received:
      3
      Trophy Points:
      18
      Looking forward to getting home and trying this!!
       
    9. SinisterJoint

      SinisterJoint Member

      Joined:
      Feb 13, 2015
      Messages:
      81
      Likes Received:
      2
      Trophy Points:
      8
      this....is....amazing

      The possibilty with this is crazy good.
       
    10. becto

      becto Member

      Joined:
      Mar 14, 2014
      Messages:
      104
      Likes Received:
      5
      Trophy Points:
      18
      Thank you exMatt! This really is better than what I had expected that could be accomplished with RB. You sir, are amazing! I am testing this now, I have not seen all the nodes but am going to continue and let you know if anything comes up that doesn't look right. So far, I am very impressed.
       
    11. Mooncloud

      Mooncloud Member

      Joined:
      Aug 19, 2015
      Messages:
      120
      Likes Received:
      2
      Trophy Points:
      18
      Ran into the following:

      [15:42:18.654 D] Buddy.Coroutines.CoroutineUnhandledException: Exception was thrown by coroutine ---> System.NullReferenceException: Object reference not set to an instance of an object.
      at ExBuddy.OrderBotTags.Gather.SafeCollectAdamantite.<Gather>d__1d.MoveNext() in c:\RB\OrderBot\Gathering\Mining\Adamantite - Experimental\Custom\SafeCollectAdamantite.cs:line 126
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at TreeSharp.ActionRunCoroutine....()
      --- End of inner exception stack trace ---
      at Buddy.Coroutines.Coroutine.CheckPostConditions(Boolean shouldBeCanceled)
      at Buddy.Coroutines.Coroutine.Resume(Boolean forStop)
      at Buddy.Coroutines.Coroutine.Resume()
      at TreeSharp.ActionRunCoroutine.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.Behavior.HookExecutor.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.Behavior.HookExecutor.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.Decorator.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.TreeRoot.() --> System.NullReferenceException: Object reference not set to an instance of an object.
      at ExBuddy.OrderBotTags.Gather.SafeCollectAdamantite.<Gather>d__1d.MoveNext() in c:\RB\OrderBot\Gathering\Mining\Adamantite - Experimental\Custom\SafeCollectAdamantite.cs:line 126
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at TreeSharp.ActionRunCoroutine....()
       
    12. SinisterJoint

      SinisterJoint Member

      Joined:
      Feb 13, 2015
      Messages:
      81
      Likes Received:
      2
      Trophy Points:
      8
      Did you change anything in the .cs?


      EDIT: I have managed to generate the same Error as you

      [16:17:19.738 D] Buddy.Coroutines.CoroutineUnhandledException: Exception was thrown by coroutine ---> System.NullReferenceException: Object reference not set to an instance of an object.
      at ExBuddy.OrderBotTags.Gather.SafeCollectAdamantite.<Gather>d__1d.MoveNext() in c:\Users\TommyBoy\Desktop\Buddy\Profiles\Gathering\Custom\SafeCollectAdamantite.cs:line 126
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at TreeSharp.ActionRunCoroutine....()
      --- End of inner exception stack trace ---
      at Buddy.Coroutines.Coroutine.CheckPostConditions(Boolean shouldBeCanceled)
      at Buddy.Coroutines.Coroutine.Resume(Boolean forStop)
      at Buddy.Coroutines.Coroutine.Resume()
      at TreeSharp.ActionRunCoroutine.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.Behavior.HookExecutor.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.Behavior.HookExecutor.Run(Object context)
      at TreeSharp.Action.RunAction(Object context)
      at TreeSharp.Action.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.Decorator.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at TreeSharp.PrioritySelector.<Execute>d__0.MoveNext()
      at TreeSharp.Composite.Tick(Object context)
      at ff14bot.TreeRoot.() --> System.NullReferenceException: Object reference not set to an instance of an object.
      at ExBuddy.OrderBotTags.Gather.SafeCollectAdamantite.<Gather>d__1d.MoveNext() in c:\Users\TommyBoy\Desktop\Buddy\Profiles\Gathering\Custom\SafeCollectAdamantite.cs:line 126
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at TreeSharp.ActionRunCoroutine....()



      The only thing I changed was where it initially lands when the node pops.
       
      Last edited: Aug 27, 2015
    13. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38

      Did you happen to notice if the gathering window was open or not?
       
    14. Mooncloud

      Mooncloud Member

      Joined:
      Aug 19, 2015
      Messages:
      120
      Likes Received:
      2
      Trophy Points:
      18

      Just re-ran for the latest node, watched it and it performed just fine. That said though, I had it run a few times without any issue before, came back later to check it errored out. I'll keep watching it and let you know.
       
    15. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      I think what is happening is I did all my testing when there wasn't 100 people hitting the node... I think the Gathering window is taking longer to open...even though I am giving it up to 5 seconds. I have seen the same error and noticed the gather window was not open. So it is either the time, or just a distance issue.
       
    16. Mooncloud

      Mooncloud Member

      Joined:
      Aug 19, 2015
      Messages:
      120
      Likes Received:
      2
      Trophy Points:
      18
      Great, thanks ExMatt. Don't mind anyone using what you've done and extending it for Cuprite and other nodes do you?
       
    17. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      I already have a fully functional generic one for both Botany and Mining. I am not releasing it yet, because I am having major issues with CWH Flight paths. Also, I am attempting to build an extendable way of doing the rotations. If I don't pass out soon, I might have it done in a few hours.

      Oh... and here is a teaser.



      Code:
      
      <?xml version="1.0" encoding="utf-8"?>
      <Profile>
      	<Name>Collectable: Adamantite Ore + Chysahl Greens</Name>
      	<KillRadius>50</KillRadius>
      	<BehaviorDirectory>./Custom</BehaviorDirectory>
      	<CodeChunks>
      		<CodeChunk name="MIN">
      			<![CDATA[
      				ff14bot.Managers.ChatManager.SendChat("/gs change 21");
      				await Buddy.Coroutines.Coroutine.Sleep(2000);
      			]]>
      		</CodeChunk>
      		<CodeChunk name="BTN">
      			<![CDATA[
      				ff14bot.Managers.ChatManager.SendChat("/gs change 20");
      				await Buddy.Coroutines.Coroutine.Sleep(2000);
      			]]>
      		</CodeChunk>
      		<CodeChunk name="ToM">
      			<![CDATA[
      				if(!Core.Player.HasAura(222))
      				{
      					var result = true;
      
      					if (MovementManager.IsFlying)
      					{
      						result = await CommonTasks.Land();
      					}
      					
      					if (result && Core.Player.IsMounted)
      					{
      						Actionmanager.Dismount();
      						await Buddy.Coroutines.Coroutine.Sleep(1000);
      					}
      					
      					ff14bot.Managers.Actionmanager.DoAction(238, Core.Player);
      					await Buddy.Coroutines.Coroutine.Sleep(2000);
      				}
      			]]>
      		</CodeChunk>
      		<CodeChunk name="ToF">
      			<![CDATA[
      				if(!Core.Player.HasAura(221))
      				{
      					var result = true;
      
      					if (MovementManager.IsFlying)
      					{
      						result = await CommonTasks.Land();
      					}
      					
      					if (result && Core.Player.IsMounted)
      					{
      						Actionmanager.Dismount();
      						await Buddy.Coroutines.Coroutine.Sleep(1000);
      					}
      					
      					ff14bot.Managers.Actionmanager.DoAction(221, Core.Player);
      					await Buddy.Coroutines.Coroutine.Sleep(2000);
      				}
      			]]>
      		</CodeChunk>
      	</CodeChunks>
      	<Order>
      		<While condition="True">
      			<If condition="IsTimeBetween(8,10) or IsTimeBetween(20,22)">
      			<!-- TODO: Be less lazy and go to tailfeather? -->
      				<If condition="not IsOnMap(397)">
      					<TeleportTo name="Falcon's Nest" aetheryteId="71" />
      					<MoveTo XYZ="467.8192, 212.5399, 699.0173"/>
      				</If>
      				<RunCode name="BTN"/>
      				<RunCode name="ToF"/>
      				<FlightPathTo XYZ="-684.4172, 105.6977, -600.1046" Radius="3.0" Smoothing="0.2" MountId="1" DismountAtDestination="false" />
      				<GatherCollectable>
      					<GatherSpots>
      						<StealthApproachGatherSpot 
      							stealthLocation="-672.4095, 99.7216, -595.6871"
      							condition="(Core.Player.Heading &gt; 0.4 or Core.Player.Heading == 0.4) and Core.Player.Heading &lt; 2.5"/>
      						<StealthApproachGatherSpot
      							stealthLocation="-708.3837, 103.3308, -626.0507"
      							condition="(Core.Player.Heading &gt; 2.5 or Core.Player.Heading == 2.5) and Core.Player.Heading &lt; 4.8"/>
      						<StealthApproachGatherSpot
      							stealthLocation="-686.4322, 99.76853, -591.241"/>
      					</GatherSpots>
      				</GatherCollectable>
      				<FlightPathTo XYZ="-684.4172, 105.6977, -600.1046" Radius="3.0" Smoothing="0.2" MountId="1" NavHeight="0.5" DismountAtDestination="false" />
      				<LogMessage message="Waiting for now...until we find something better to do."/>
      				<WaitWhile condition ="IsTimeBetween(8,10) or IsTimeBetween(20,22)" />
      			</If>
      			<!-- TODO: have to use cordial or wait for gp... -->
      			<If condition="IsTimeBetween(10,12) or IsTimeBetween(22,24)">
      				<If condition="not IsOnMap(402)">
      					<TeleportTo name="Helix" aetheryteId="74" />
      					<MoveTo XYZ="-716.7953, -186.9606, -599.0761"/>
      				</If>
      				<RunCode name="MIN"/>
      				<RunCode name="ToM"/>
      				<FlightPathTo XYZ="57.50256, 21.00859, -835.1724" Radius="3.0" Smoothing="0.2" MountId="1" DismountAtDestination="false" />
      				<GatherCollectable>
      					<GatherSpots>
      						<StealthApproachGatherSpot 
      							stealthLocation="70.86564, -0.4920825, -858.0936"
      							nodeLocation="71.80842, -0.29418, -856.2421"
      							condition="(Core.Player.Heading &gt; 1.5 or Core.Player.Heading == 1.5) and Core.Player.Heading &lt; 3.6"/>
      						<StealthApproachGatherSpot
      							stealthLocation="20.53567, -1.213719, -827.198"
      							nodeLocation="24.25113, -0.01400313, -832.7057"
      							condition="(Core.Player.Heading &gt; 3.6 or Core.Player.Heading == 3.6) and Core.Player.Heading &lt; 5.7"/>
      						<StealthApproachGatherSpot
      							stealthLocation="89.52304, -1.827069, -791.0764"
      							nodeLocation="79.85004, -0.2340581, -805.6276"/>
      					</GatherSpots>
      				</GatherCollectable>
      				<FlightPathTo XYZ="57.50256, 21.00859, -835.1724" Radius="3.0" Smoothing="0.2" MountId="1" NavHeight="0.5" DismountAtDestination="false" />
      				<LogMessage message="Waiting for now...until we find something better to do."/>
      				<WaitWhile condition ="IsTimeBetween(10,12) or IsTimeBetween(22,24)" />
      			</If>
      			<If condition="IsTimeBetween(0,8) or IsTimeBetween(12,20)">
      				<LogMessage message="Stop being so lazy!"/>
      				<WaitWhile condition="IsTimeBetween(0,8) or IsTimeBetween(12,20)"/>
      			</If>
      		</While>
      	</Order>
      </Profile>
      
      
       
    18. becto

      becto Member

      Joined:
      Mar 14, 2014
      Messages:
      104
      Likes Received:
      5
      Trophy Points:
      18
      Looking forward to the update exMatt!

      I went through your code and changed it so I can turn on/off the collectible portion so if I want to use it for gathering, I could. Hope that is ok.

      View attachment SafeCollectAdamantite.cs

      In the profile only this line needs to be changed:
      Code:
      <SafeCollectAdamantite CollectScrips="false" />
      
      If you want to collect for scrips, change it to true.

      Please list where I can donate to you, I at least owe you a drink for this!
       
    19. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      For now, I just have a link on my fishing thread

      https://www.thebuddyforum.com/rebor...plugin-fish-v3-0-profiles-support-thread.html

      I guess I can start adding things to my sig, seems like the thing to do when you make useful things.


      Good job on those edits, they should work fine. I am really excited about finishing this tag. I haven't had any errors in a few hours since my last change and I guess I will have to figure out CWH flying issues some other time.
       
      Last edited: Aug 27, 2015
    20. Mooncloud

      Mooncloud Member

      Joined:
      Aug 19, 2015
      Messages:
      120
      Likes Received:
      2
      Trophy Points:
      18
      Had the error happen again. It appears the bot is going to where it thinks the node is, not where it actually is. If we're using Becto's image from the beginning of the post, the node spawned at location 3. The bot went to location 1, did not find a node, and subsequently crashed.
       

    Share This Page