• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • IgnoreCanRun, looking for a description of its actual function.

    Discussion in 'Honorbuddy Forum' started by Team47, Oct 2, 2012.

    1. Team47

      Team47 New Member

      Joined:
      Mar 2, 2012
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      So I write all my own PB profiles, from shuffling to auctioning. The knowledge I have has come from looking through other profiles and for the most part I've been able to accomplish everything I need.

      I have seen however a recurring item in profiles and that is the IgnoreCanRun condition, seems to be used at the end of If and While statements. Now I've been putting it in all my conditions like the examples I've seen, and my code works as I expect it to, but I'm looking to get a better understanding of how and what the IgnoreCanRun condition actually does.

      Here's a quick code exert to show what I mean.

      <If Condition="Jewelcrafting.Level &gt;= 500 &amp;&amp; Me.FreeBagSlots &gt;= 0" IgnoreCanRun="True">
      <If Condition="InbagCount(72092) &gt; 5" IgnoreCanRun="True">
      <DisenchantAction ActionType="Prospect" ItemTarget="Specific" ItemQuality="Uncommon" ItemId="72092" />
      </If>
      </If>

      Thanks in advance for the input!
       
    2. Dark57

      Dark57 New Member

      Joined:
      Jun 6, 2012
      Messages:
      500
      Likes Received:
      7
      Trophy Points:
      0
      I can't find any documentation about it either, nor have I ever used it. Have you tried including it into your profile and observing the differences?
       
    3. Team47

      Team47 New Member

      Joined:
      Mar 2, 2012
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0

      In-fact I've always included it, perhaps I should exclude it to see if there is any differences.

      There is another flags I'm curious about, the ChildrenCount

      such as . .

      <Professionbuddy ChildrenCount="3"
      <If Condition="Jewelcrafting.Level&gt;499" IgnoreCanRun="True" ChildrenCount="4">


      Note those lines of code aren't mine but from someone elses profile I found here, I'm using them as an example.

      Perhaps is there a reference page for PB flags? Or somewhere else I could look up these things?
       
    4. Dark57

      Dark57 New Member

      Joined:
      Jun 6, 2012
      Messages:
      500
      Likes Received:
      7
      Trophy Points:
      0
      I haven't found one. I have noticed that documentation for profile making is extremely lacking when it comes to explanations and detailing what are allowed arguments.
       
    5. YiZZo17

      YiZZo17 New Member

      Joined:
      Apr 27, 2012
      Messages:
      76
      Likes Received:
      0
      Trophy Points:
      0
      Ditto, I wish there was more documentation. I got some great ideas. I just need to take the time to do them. I'm still not level 90 yet. :( Questing sucks. lol
       
    6. Crowley

      Crowley Member

      Joined:
      Jan 15, 2010
      Messages:
      967
      Likes Received:
      20
      Trophy Points:
      18
      "<Professionbuddy ChildrenCount="3"" Was from the old days of PB. Not needed anymore.

      Ignorecanrun, not too sure about that. But i also include it in all of mine :D
       
    7. Dark57

      Dark57 New Member

      Joined:
      Jun 6, 2012
      Messages:
      500
      Likes Received:
      7
      Trophy Points:
      0
      Hopefully when the bot if finally stable again we can ask them to improve the documentation for HB coding and profile writing.

      So is ProfessionBuddy now a supported HB botbase or is it still being maintained by one person?
       
    8. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      till being maintained by one person.

      and chances are what your looking at is a variable used by the profile maker to make it ignore certain If statements, not really anything all that special.
       
    9. Team47

      Team47 New Member

      Joined:
      Mar 2, 2012
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      That's more or less what I was thinking also. Except I didn't observe any differences from my testings, setting it to true, false, or omitting it. So I started going through PB code. It's only found in IF and WHILE files, and it does appear that you can set it to omit if/while statements. However, in the If() constructor . . .

      public If()
      {
      // ReSharper disable DoNotCallOverridableMethodsInConstructor
      Properties = new PropertyBag();
      Properties["IgnoreCanRun"] = new MetaProp("IgnoreCanRun", typeof (bool),
      new DisplayNameAttribute(
      Professionbuddy.Instance.Strings["FlowControl_If_IgnoreCanRun"
      ]));

      . . .

      Condition = "";
      CompileError = "";
      Properties["CompileError"].Show = false;
      Properties["Condition"].PropertyChanged += Condition_PropertyChanged;
      Properties["CompileError"].PropertyChanged += CompileErrorPropertyChanged;
      IgnoreCanRun = true;
      // ReSharper restore DoNotCallOverridableMethodsInConstructor
      }



      protected override IEnumerable<RunStatus> Execute(object context)
      {
      if (!IsDone && ((_isRunning && IgnoreCanRun) || CanRun(context)))
      {
      . . .
      }
      }

      So I'm guessing that the developer has put the IgnoreCanRun = true in the if constructor so that regardless of what value is specified in the profile, it will be overridden.

      When I get home from work I'll play around with it and see then try to post back since I don't think I'm the only one who has wondered about it.

      47

      :edit: grammar
       
      Last edited: Oct 4, 2012
    10. Hadoop

      Hadoop New Member

      Joined:
      Oct 5, 2012
      Messages:
      1
      Likes Received:
      0
      Trophy Points:
      0
      As far as I can tell this parameter is used in order to make the loop never escape its exectuion even if the initial condition is no longer valid. I first noticed this when my scribe tried to make inks while only having a single pigment in its inventory, allthough the while condition specifically required at least 2. The while loop was entered with more than 2 pigments (condition met) but failed to exit. I'm not 100% sure on this tho.
       
    11. highvoltz

      highvoltz Well-Known Member

      Joined:
      Mar 22, 2010
      Messages:
      1,729
      Likes Received:
      141
      Trophy Points:
      63
      Here is what IgnoreCanRun (same as 'Ignore Condition Until done' in the gui ) does.

      If at any time the Condition becomes false then execution stops executing inside the If/While Condition immediately unless the property 'Ignore Condition Until done' is set to true in which case execution will ignore the Condition until it finishes executing the last action at the bottom of the If/While Condition.

      In other words if the Condition goes from 'true' to 'false and 'Ignore Condition Until done'/IgnoreCanRun is set to true then the remaining actions inside that If/While Condition are still executed until it finishes last action.

      This is useful for example if you have an If Condition checking for new mail and your first action opens the mail which causes the 'new mail' flag to go away. If the 'Ignore Condition Until done'/IgnoreCanRun is set to false then any remaining actions would be skipped.
       
    12. Dark57

      Dark57 New Member

      Joined:
      Jun 6, 2012
      Messages:
      500
      Likes Received:
      7
      Trophy Points:
      0
      Ah, thanks for the clarification HV. Definitely something worth knowing as a profile developer. Is there any PB documentation anywhere?
       
    13. Keldorn

      Keldorn New Member

      Joined:
      Jul 2, 2012
      Messages:
      560
      Likes Received:
      0
      Trophy Points:
      0
      Yes would be nice to know :)

      Did i understand the IgnoreCanRun right?

      PHP:
        <SubRoutine SubRoutineName="GetMail">
          <If 
      Condition="HasNewMail" IgnoreCanRun="True">
            <
      GetMailAction ItemID="0" CheckNewMail="True" GetMailType="AllItems" AutoFindMailBox="True" MinFreeBagSlots="13" />
          </If>
          <
      StackItemsAction />
        </
      SubRoutine
      So IgnoreCanRun="True" means regardless of the HasNewMail Icon disappears after opening the 1 single new mail the SubRoutine will run till its end anyways?
       

    Share This Page