Is it possible to have compound ["condition"] and ["complete"] blocks? - Printable Version +- MMOMinion (https://www.mmominion.com) +-- Forum: FFXIVMinion (https://www.mmominion.com/forumdisplay.php?fid=87) +--- Forum: Support - English, Deutsch, 中文 (https://www.mmominion.com/forumdisplay.php?fid=92) +---- Forum: English Support & Questions (https://www.mmominion.com/forumdisplay.php?fid=93) +---- Thread: Is it possible to have compound ["condition"] and ["complete"] blocks? (/showthread.php?tid=14148) |
Is it possible to have compound ["condition"] and ["complete"] blocks? - tadeus - 10-15-2015 Hey guys, I'm trying to maximize my crystal and shard gathering. One issue that I see is if you're gathering shards/crystals at the lvl 30 nodes and you have condition set to ItemCount(x) < 9999, if you have 9998 in your inv when you start gathering a node it gets 1 shard and is capped, then it keeps trying to hit the same item, basically trapped in an infinite loop. What I've done is changed the condition to < 9990 which works rather well, but I can foresee a slight chance of the loop again if a big bonus happens. I can always lower the condition more it that happens. Another issue is if I'm gathering both shards and crystals and if the crystals get capped then infinite loop again. So, I was thinking if I could check the ItemCount of both shards and crystals in one condition, I could overcome this issue. But I'm not sure if it can be done, or how to do it. We'll use Fire Shards/Crystals as an example: Pseudo code: Task 1 (Gather Shards and Crystals until 9990 Shards or Crystals) Condition: Fire Shards < 9990 and Fire Crystals < 9990 Complete: Fire Shards >= 9990 or Fire Crystals >= 9990 Task 2 (Gather Shards until 9990, in case Task 1 filled up Crystals) Condition: Fire Shards < 9990 Complete: Fire Shards >= 9990 This is what I came up with, didn't try it, will it work? Code: local obj1 = { RE: Is it possible to have compound ["condition"] and ["complete"] blocks? - Picklet - 10-15-2015 That should work; though, I took Sebb's advice and capped at 9950. Works beautifully. RE: Is it possible to have compound ["condition"] and ["complete"] blocks? - sebbs - 10-15-2015 you actually only need a condition in that case. if you have more than 9990 shards it wont be a valid task and wont do it. ["condition"] = { ["(ItemCount(x) < 9980) and (ItemCount(y) < 9980)"] = true; Alternatly ["condition"] = { ["ItemCount(x) < 9990"] = true; ["ItemCount(y) < 9990"] = true; }; RE: Is it possible to have compound ["condition"] and ["complete"]... - tadeus - 10-15-2015 (10-15-2015, 01:39 PM)sebbs Wrote: ["condition"] = { The parentheses you added are requred? (10-15-2015, 01:39 PM)sebbs Wrote: ["condition"] = { Having multiple conditions will "AND" them? is the profile evaluated before every node? If that's the case, then gathering never requires a ["complete"] block. So here is my logic: Assume limits are set to 9950 Code: Scenario 1 I'm gonna give it a go. I'll let you know how it goes. I'll post my profile if it works. RE: Is it possible to have compound ["condition"] and ["complete"] blocks? - sebbs - 10-15-2015 ["condition"] = { ["ItemCount(x) < 9990"] = true; ["ItemCount(y) < 9990"] = true; }; all conditions need to be true or it wont work so if 9920 shards = true 9998 crystals = false not valid. ["(ItemCount(x) < 9980) and (ItemCount(y) < 9980)"] = true; both need to be true but its just the one line 9920 shards and 9998 crystals = false not valid RE: Is it possible to have compound ["condition"] and ["complete"] blocks? - Ace - 10-16-2015 As is eluded to here, a few things to note: No special parenthesis requirement, the strings are evaluated as normal lua, so they are only necessary if they are necessary for the block to make sense programmatically. Multiple lines are evaluated as "and". "condition" is evaluated only entering the task, once the task is begun, even if the condition becomes untrue, it no longer matters. "complete" is evaluated only to exit the task, if no complete is used then the normal rules for exiting apply, like maxtime or a higher priority task is found. |