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 >= 500 && Me.FreeBagSlots >= 0" IgnoreCanRun="True"> <If Condition="InbagCount(72092) > 5" IgnoreCanRun="True"> <DisenchantAction ActionType="Prospect" ItemTarget="Specific" ItemQuality="Uncommon" ItemId="72092" /> </If> </If> Thanks in advance for the input!
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?
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>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?
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.
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
"<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
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?
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.
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
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.
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.
Ah, thanks for the clarification HV. Definitely something worth knowing as a profile developer. Is there any PB documentation anywhere?
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?