• Visit Rebornbuddy
  • PathMagic Path and Challenge related profile tags and conditional statements

    Discussion in 'Plugins' started by Lastmango, Oct 27, 2015.

    1. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      While working on profiles that attempt to complete almost ALL area challenges (Almost, some are impossible to bot) and most Path Missions I've amassed a bit of code and custom profile tags.

      Similar to DD's awesome work on QuestHelper, which I admit to having studied greatly, it needs to be dropped in the plugins directory since there is no "Quest Behaviors" location like in the Honorbuddy product. This is because that location, along with the routines folder, get compiled and built at runtime by the bot.

      So for those of you that want to jump right in, just visit the GIT repository for project and drop it all into a directory named 'PathMagic' under the plugins directory.

      Path Magic Wiki (Work In Progress)

      For those less-hacker-enabled folks I'll write up a step by step on how to do this in the next few posts.

      GIT Repo: https://bitbucket.org/GScottSingleton/pathmagic
      GIT Repo Direct Download Link: PathMagic.0.2.0.Zip


      First, some diagnostics, run these in the PEC to get IDs:

      Buddy.PathConditions.ShowActivePathMission() -- Run to show the active path mission to the buddy console
      Buddy.ChallengeConditions.ShowActiveChallengeId() -- Run to show the active ID of the challenge

      Conditions, which should be self-explanatory by name:

      Code:
      Buddy.ChallengeConditions.CanCompleteChallenge(int challengeId) 
      Buddy.ChallengeConditions.GetChallengeCompeltionCount(int  challengeId)
      Buddy.ChallengeConditions.IsChallengeOnCooldown(int challengeId)
      Buddy.ChallengeConditions.IsChallengeActive(int challengeId)
      
      Buddy.PathConditions.IsPathMissionComplete(int missionId)
      Buddy.PathConditions.IsPathMissionActive(int missionId)
      
      Now for the profile tags, Which Should Also be pretty self-explanatory:

      Code:
      <ActivateChallenge ChallengeId="1234" X="1" Y="1" Z="1" />
      That will move to the given coordinates and activate the challenge

      Code:
      <IfPathExplorer />
      <IfPathScientist />
      <IfPathSoldier />
      <IfPathSettler />
      
      Those are all conditional tags for wrapping around path specific profile tags. Each Support the
      Code:
      Mission
      Attribute where you can pass a missionID for further conditioning.
      The following example uses a combination of conditions and tags, along with some QuestHelper tags to complete the first Soldier mission in Northern Wilds:

      Code:
      <IfPathSoldier Mission="156">
              <MoveTo X="4160.619" Y="-743.9952" Z="-5533.938" MapId="426" />
              <Interact Condition="not Buddy.PathConditions.IsPathMissionActive(156)" CreatureId="12508" MapId="426" X="4157.45459" Y="-744.2102" Z="-5536.04932" RunOnce="true" />
              <DDWhile Condition="not Buddy.PathConditions.IsPathMissionComplete(156)">
                  <Wait Time="5" />
              </DDWhile>
      </IfPathSoldier>
      
      The following example will complete the first challenge in the game, killing Rootbrutes, but only if you haven't completed it before:
      Code:
      <Kill Condition="not Buddy.ChallengeConditions.IsChallengeKnown(105)" Creature="12212" X="4440.36328" Y="-741.4801" Z="-5576.87158" />
      <DDWhile Condition="Buddy.ChallengeConditions.CanCompleteChallenge(105) and (Buddy.ChallengeConditions.GetChallengeCompletionCount(105)==0)">
              <ActivateChallenge ChallengeId="105" X="4440.36328" Y="-741.4801" Z="-5576.87158" />
          <Kill Condition="not Buddy.ChallengeConditions.IsChallengeOnCooldown(105)" Creature="12212" X="4440.36328" Y="-741.4801" Z="-5576.87158" />
      </DDWhile>

      Science Specific Tags:

      <ScienceScanArea /> - Will move to an X,Y,Z Coordinate and scan any 'ScienceScannable' creatures within a specified Radius.
      <ScienceScanSingle /> Needs a CreatureId Attribute and X,Y,Z Coordinates. Will move to a specific creature and scan only it.
      <ScienceScanForce /> Needs a CreatureId Attribute and X,Y,Z Coordinates. Will force a scan on a unit that isn't marked 'Science Scannable'. Certain path missions want you to scan corpses, consoles, etc.


      ChangeLog:
      • 2015/11/4 - Standardized Attributes to match WB's usage. Quest is now QuestId, Step is now QuestObjective. Mission=MissionId and Creature is now either CreatureId (when single) or CreatureIds when tag needs multiple.
       
      Last edited: Nov 25, 2015
      walter and Angully like this.
    2. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      Reserved

      Reserved
       
    3. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      Reserved again
       
    4. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Thanks for the awesome contribution!

      If you have anything you'd like to see in the core bot, just let me know. (I haven't gotten around to properly wrapping this stuff yet)

      My only request is that you try to stay with the conventions used with all the built-in tags. Eg; "Quest" should be "QuestId", and "Step" should be "QuestObjective". It's easier on everyone if there isn't different terminology, or different names to remember.

      "Radius" should be a float. (Very important!) Especially for tools that will eventually automatically dump things using the WorldLocation2 table.
       
      Last edited: Oct 27, 2015
    5. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      what I'd really love right now is code for the profile bot to start, stop, and load profiles (remote url profiles) so I can do the same type of thing done in many honorbuddy plugins that offer a UI in front of profile's and always load latest from a repo :p
       
    6. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      Sorry.. I was getting lazy and following some QuestHelper stuff. Some of the tags I did because I am lazy, and want to reduce long-term profile coding. Hitting that Shift-I for QuestId was a PITA :p

      Good to know on the Radius; will fix that asap.
       
    7. Angully

      Angully Member

      Joined:
      Sep 19, 2010
      Messages:
      764
      Likes Received:
      1
      Trophy Points:
      18
      SERIOUS LOVE LAST MANGO! Thank You
       
    8. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Also, moving this to the plugins forum, since this isn't a profile!

      I'll leave a redirect here however.
       
    9. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      I just pushed an update to support Wildbuddy 1.1.614.4 along with some refactoring to reduce the overall footprint.
       
    10. Lastmango

      Lastmango Member Legendary

      Joined:
      Nov 25, 2014
      Messages:
      173
      Likes Received:
      5
      Trophy Points:
      18
      Update to Version 0.2.0 to Support Wildbudy 1.1.642.

      Changes:
      Centralized Author/Version in Static class
      Version now returns System.Version and not a String
       

    Share This Page