• Visit Rebornbuddy
  • XML tag tips thread

    Discussion in 'Rebornbuddy Profiles' started by teh4x, Mar 11, 2015.

    1. teh4x

      teh4x New Member

      Joined:
      Feb 9, 2015
      Messages:
      15
      Likes Received:
      1
      Trophy Points:
      3
      Post your tips here. I'll start with what I've figured out the hard way. My tips apply to OrderBot.

      Infinite loops
      Wrap everything you want to execute infinitely in a <While Condition="True"> tag. This is more reliable than trusting OrderBot to loop over your (for instance) Gather tags over and over again.


      Arbitrary code execution
      You can execute (some) arbitrary code in the Condition property of the WaitWhile tag. When the code terminates, the ScriptExecutor will assume the Condition was met. For instance, I'm running an infinite loop to check for unspoiled mining nodes in a certain zone, but I only want to check once a minute so I'm not wasting CPU cycles. I accomplish this with the following tag:

      <WaitWhile Condition="Thread.Sleep(60000)" />

      I imagine you could drop a class in a plugin folder and invoke a fully-qualified method this way, but I haven't tried it. It's certainly easier than any other approach to arbitrary code execution that I've found.
       
    2. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      ...why not just use the WaitTimer tag...?
       
    3. kagepande

      kagepande Community Developer

      Joined:
      Oct 20, 2014
      Messages:
      289
      Likes Received:
      11
      Trophy Points:
      18
      I get that you are trying to help people, but honestly you would have just confused a large section of this bots users with what you wrote, not to mention how you are handling a sleep or timer effect is not the best way to do so. Also, your While Condition = True is right, theres a good amount of things that it will 'break' when using it with gathering from my experiences.
       
    4. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Quick clarification. The condition argument actually returns void, which means it wasn't met. WaitWhile continues to run until the condition returns something that evaluates to false. I'm pretty sure the rebornbuddy ui gets suspended if you call sleep on the main thread, meaning you can't even hit stop in the bot window. This is potentially harmful and should be avoided.

      To execute arbitrary c# code, you can use the runcode tag:


      Code:
      <Profile>
          <KillRadius>50</KillRadius>
          <CodeChunks>
              <CodeChunk Name="CastReturn">
      <![CDATA[ 
      ChatManager.SendChat("/generalaction Return");
      ]]>
              </CodeChunk>
          </CodeChunks>
          
          <Order>
              <RunCode Name="CastReturn" />
          </Order>
      </Profile>
       
    5. teh4x

      teh4x New Member

      Joined:
      Feb 9, 2015
      Messages:
      15
      Likes Received:
      1
      Trophy Points:
      3
      Didn't know about it. I haven't been able to find a reference for supported tags.


      WaitWhile seems to continue waiting provided the Condition continues to return True. This is demonstrated in multiple profiles. What I have provided shows that not only will WaitWhile stop waiting if either False or Void is returned. I suspect it will stop waiting if anything other than True is returned.

      I haven't had a problem stopping the bot with this profile running. Works just fine.
       
      Last edited: Mar 12, 2015
    6. Shambo

      Shambo New Member

      Joined:
      Jul 4, 2014
      Messages:
      89
      Likes Received:
      1
      Trophy Points:
      0
      Would be good to get all the different tags listed in a thread though, OrderBot seems to have 100s of features at this point.
       
    7. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Read the documentation, all the tags are in ff14bot.NeoProfiles and ff14bot.NeoProfiles.Tags.
       
    8. Shambo

      Shambo New Member

      Joined:
      Jul 4, 2014
      Messages:
      89
      Likes Received:
      1
      Trophy Points:
      0
      Ahh, cheers for that! :)
       

    Share This Page