• Visit Rebornbuddy
  • Classy - Adds a tag to OrderBot to allow Job changing.

    Discussion in 'Plugins' started by Yasuko, Nov 9, 2014.

    1. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Yeah, I just had the thought that with the way you had it set up before (setting _done within one decorator), if the ChangeJob tag was called and the player was already the correct class, the tag would never exit because _done would never be set to true. With the way you have it set up now, if the ChangeJob tag is called and the player is already the right class, it'll set _done to true instantly and move on to the next thing in the profile. I think that's way better behavior.
       
      Zamphire likes this.
    2. Sodimm

      Sodimm Member

      Joined:
      Nov 8, 2014
      Messages:
      383
      Likes Received:
      7
      Trophy Points:
      18
      In saying that, I think that might trip mine up too, because it'll go back to the initial <MoveTo> tag after switching in the middle of a hotspot, and running back to the first location as miner or botanist unstealthed. So I added a few lines of code to check wether i'm miner or botanist, and applying stealth immediately. Thanks.
       
    3. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Thanks for the help here. Kagamihiiragi, you've always helped me a lot and I greatly appreciate all the effort you put into this community.

      That being said, any other ways around this? I could do as you suggested but there's a few problems with that. 1.) that doesn't allow for three nodes or more in a two hour window, so I would have to choose which nodes to gather. Not too big of a problem but my goal was to make a profile to gather all the nodes. 2.) It will still probably cause loops. It doesn't take a full hour to do each gather. So if the first tags gets done any time before 22 it's going to go try to gather the first one again. Looks kind of suspicious and a waste.

      Is there a way I could set a variable to check if that node has been farmed? Like TrilliumBulb = 1 if it's been mined and 0 if it hasn't. Could I set it at the end of the gather and then reset all of them at the begining of a new day? And is there a way the profile will check the variable?
       
    4. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Let me tackle these questions in order:

      Are there other ways around this? I'm not sure, to be honest. I always thought that for non-combat classes you didn't need to stop and start the bot. Are we sure that the TreeRoot.Stop() and TreeRoot.Start() are necessary? Trying the tag without the stop/start would be my first idea.

      So if the first tags gets done any time before 22 it's going to go try to gather the first one again. Add all the gather tags for a timeslot into one block and add a <WaitWhile Condition="IsTimeBetween(20,22) /> at the end. This will stop the bot from trying to go back to the first gather area for that block. I edited the sample code you gave on the previous page:

      Code:
      <If Condition="IsTimeBetween(21,23)">
      	<!-- Botany: East Shroud - Kidragora, Trillium Bulb -->
      	<If Condition="Core.Me.CurrentJob != ClassJobType.Botanist">
      		<ChangeJob Type="Botanist" />
      	</If>
      	<If Condition="not IsOnMap(152)">
      		<TeleportTo Force="true" Name="Hawthorne Hut" AetheryteId="4" />
      	</If>
      	<Gather Loops="1">
      		<GatherObject>Unspoiled Lush Vegetation Patch</GatherObject>
      		<HotSpots>
      			<Hotspot Z="131.2229" Y="1.075165" X="-380.9028" Radius="500"/>
      		</HotSpots>
      		<Slot>7</Slot> <!-- 6=Kidragora, 7=Trillium Bulb -->
      		<GatheringSkillOrder>
      		</GatheringSkillOrder>
      	</Gather>
      	<TeleportTo Name="Camp Dragonhead" AetheryteId="23" />
      	<!-- Mining: Coerthas Central Highlands - Astral Rock -->
      	<If Condition="Core.Me.CurrentJob != ClassJobType.Miner">
      		<ChangeJob Type="Miner" />
      	</If>
      	<If Condition="not IsOnMap(155)">
      		<TeleportTo Name="Camp Dragonhead" AetheryteId="23" />
      	</If>
      	<Gather Loops="1">
      		<GatherObject>Unspoiled Rocky Outcrop</GatherObject>
      		<HotSpots>
      			<Hotspot Z="155.2625" Y="284.1149" X="125.8191" Radius="500"/>
      		</HotSpots>
      		<Slot>6</Slot> <!-- Astral Rock -->
      		<GatheringSkillOrder>
      		</GatheringSkillOrder>
      	</Gather>
      	<TeleportTo Name="Revenant's Toll" AetheryteId="24" />
      	<!-- Botany: Mor Dhona - Grade 4 Carbonized Matter and Elemental Clusters -->
      	<If Condition="Core.Me.CurrentJob != ClassJobType.Botanist">
      		<ChangeJob Type="Botanist" />
      	</If>
      	<If Condition="not IsOnMap(154)">
      		<TeleportTo Name="Revenant's Toll" AetheryteId="24" />
      	</If>
      	<Gather Loops="1">
      		<GatherObject>Unspoiled Rocky Outcrop</GatherObject>
      		<HotSpots>
      			<Hotspot Z="-484.7234" Y="-6.061276" X="3337.9405" Radius="500"/>
      		</HotSpots>
      		<!--
      			Slot 0 = Grade 4 Carbonized Matter
      			Slot 1 = Lightning Cluster
      			Slot 2 = Fire Cluster
      			Slot 3 = Wind Cluster
      			Slot 4 = Water Cluster
      			Slot 5 = Ice Cluster
      			Slot 6 = Earth Cluster
      		-->
      		<Slot>5</Slot>
      		<GatheringSkillOrder>
      		</GatheringSkillOrder>
      	</Gather>
      	<If Condition="Core.Me.CurrentJob != ClassJobType.Botanist">
      		<ChangeJob Type="Botanist" />
      	</If>
      	<WaitWhile Condition="IsTimeBetween(21,23)" />
      </If>
      Is there a way I could set a variable to check if that node has been farmed? There's really no good way to store a variable in a profile between bot sessions. Theoretically you could write a plugin for that but I think it would be a massive waste of time. Ideally, we get the tag working without needing to stop/start the bot, and then this isn't necessary anymore.

      - kagami
       
    5. Sodimm

      Sodimm Member

      Joined:
      Nov 8, 2014
      Messages:
      383
      Likes Received:
      7
      Trophy Points:
      18
      Would be interesting to find out, as it is, I have to add a whole lot of different variables to the profile to deal with the bot starting and stopping. Right now i'm tackling how to tell the bot to "dismount only when i'm mounted". As it stands, it's switching only to get stuck on the dismount runcode.
       
    6. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Add a check for IsMounted.

      Code:
      <If Condition="Core.Player.IsMounted">
          <RunCode Name="Dismount" />
      </If>
      I really recommend downloading Visual Studio Express, you can search through the RB API, you can see all members of a class very easily using the Object Browser.
       
    7. Sodimm

      Sodimm Member

      Joined:
      Nov 8, 2014
      Messages:
      383
      Likes Received:
      7
      Trophy Points:
      18
      Grrr, I had it as Core.Me.IsMounted. I Suck. Thanks Kagamihiiragi. I am downloading it now. Hope it helps. And sorry for all the questions.
       
      Last edited: Dec 4, 2014
    8. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      I did have several of them like this, but I separated them so it wouldn't go there if the window had already closed. Like say if someone started the bot at 22:14, it would have time to get the first one done, but by time it gathered the first one, the 21-23 window would have closed. Separating them keeps it from going there if the window is already closed.

      That being said, i think I'll do what you suggested and just wait it out to see if we can get this plugin working without the treestart and stop. I might actually go try deleting those and see if it works.
       
    9. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Alright, so all I did was remove the TreeStart and TreeStop from his decorator that he made (he commented it well enough to find easily). Now it's doing the same thing that it did before

      Code:
      [16:11:16.163 N] Done building Actioncache
      [16:11:16.164 D] [RoutineManager] Routines have been reloaded. Current class-specific list:
      [16:11:16.176 N] [Classy] - OnDone() Called
      [16:11:16.176 D] [POI Set] Type: None
      [16:11:16.176 N] [Classy] - Current POI should be set
      [16:11:16.176 D] Added new hook [PoiAction] a17deac1-9b25-42f9-b07f-802a442f7d45
      [16:11:16.177 V] [Poi.Clear] Reason: Current behavior changed to GatherTag.
      [16:11:16.177 D] Replaced hook [ProfileOrderBehavior_Hook] f8044df0-13ce-48d9-bc02-e004c81e0ff4
      
       
    10. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Whole log and whole profile please.
       
    11. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Sending in a PM
       
    12. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      I did notice that it will restart the entire profile after calling stop then start again.. but that was the only way i could get RB to see the job change.. Since the bot just stands still after changing the class without using the stop/start. I thought the POI would have been something RB would pick up from the profile, even after it is cleared due to class changing.. is this something that I need to set manually?
       
    13. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      When switching from a combat class to a gathering class, I notice:
      Code:
      [18:59:33.901 D] Added new hook [PoiAction] 450e9004-2f16-4e65-8a02-9b0df867b9dd
      [18:59:33.905 V] [Poi.Clear] Reason: Current behavior changed to GatherTag.
      pops up (without using stop/start) and it continues to just sit. So this leaves me to believe that clearing the poi on class change (rb is doing automatically) is causing the issue.. I'll go look through the api documentation to figure out if i can set that poi manually.. i know that you can set the poi.current but i believe the way I am doing it is incorrect. I'll continue to mess with it since I am working from home today and have access to the bot/game to test with.. Again, I apologize for the issues this is causing for some people.
       
    14. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      No need to appologize Yasuko. We're just happy to have someone working on this
       
    15. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      Turns out that I was correct in assuming the POI is cleared completely when changing from a DoL/DoH to a DoW/DoM which is causing a Null Reference currently.. When trying to set the POI normally, it does set but once it meets that condition, it wont go back to being null, but it completely stops generating a path to the hotspot listed in the profile.. as if it completely stops reading the profile...

      Code:
      [22:21:04.286 V] [Poi.Clear] Reason: Current behavior changed to GrindTag: GrindRef: Raptor_Skins, WhileCondition: ItemCount(5310) < 1, IsDone: False, InCombat: False, QuestId: 0, StepId: 0, PostCombatDelay: 0, QuestName: null, IsDoneCache: False, Behavior: ff14bot.Behavior.HookExecutor, .
      [22:21:04.286 D] Replaced hook [ProfileOrderBehavior_Hook] 6b74a7e3-cdf2-4177-95c6-5d8f12b329a8
      [22:21:04.291 D] [POI Set] Type: Hotspot
      [22:21:04.372 D] System.NullReferenceException: Object reference not set to an instance of an object.
         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.()
      
      Guess I'm going to hop over to the dev section and see if Mastahg has any suggestion.
       
    16. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Have you tried playing around with any of these and see if you can trigger the same functionality as stop/start?

      ff14bot.Managers.RoutineManager.Reload()
      ff14bot.Managers.RoutineManager.ReloadRoutineAssemblies()
      ff14bot.Managers.RoutineManager.SetCurrentCombatRoutine()
       
    17. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      I would be shocked if those affected profiles.

      You could try getting the currect profile location from profilemanager and reloading it after the job change.
       
    18. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      https://www.thebuddyforum.com/rebor...s-dol-doh-dow-dom-poi-completely-cleared.html
      has full details on what is happening, I dont think its anything to do with routines.. its about RB not reading the rest of the profile after it clears the poi when the behaviour changes.. I have said in the above link that when switching from a dom/dow to a dom/dow class it works as it should.. the issue occurs only when switching from dom/dow to dol/doh .. and vice verse.

      Ive thought about getting the correct position via profilemanager, but I really wouldnt know which hotspots they have visited, which they havent, for such a simple plugin it is sure confusing me as to why its not refreshing the poi when changing a class in that order.
       
    19. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Why do you think the problem is 'RB not reading the rest of the profile' when it works just fine switching DoW/DoM to DoW/DoM? It's not like your code changes when you're changing from DoW/DoM to DoL/DoH or vice versa.
       
    20. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      Because when switching from DoL/DoH to DoW/DoM it clears POI for behaviour, then the POI is empty and not being refreshed with the info from the profile.. No hotspot location, no poitype, nothing in the POI when switching between the different Disciples. But when switching between Disciples of the same type, they behaviour doesnt change, and the profile will continue as normal.. I am assuming its something to do with RB in that instance since it clears POI when changing behaviour.. and I am not sure how to change it back to whatever it needs to be for specific order.
       

    Share This Page