Hi,
Really enjoying this bot you made. I hope you don't mind but I've been checking out how it functions on the hood (Unsure how to learn what methods/functions do with out seeing how other implemented them).
There is an odd bug i've ran across. When you specify how the amount in your Orders.yaml it seems that amount is being tied to two things.
First: When it is getting ready to do an order it is treating the "amount" as follows:
I want to craft Fishmeals 10 times which requres 3 anchovy per craft. So like your bot is suppose to it make sure i have at least 30 anchovy.
When it reaches the end of the craft I really produce 12 FishMeals with 1 craft but the bot takes the "12" produce to equal the "10" Amount. So it think the 12 FishMeals > 10 Orders so the bot assumes it is done.
Well okay so I assume that perhaps the Amount specified in the yaml is how much is produce so i say i want to produce 30 which should equate to 3 orders. Your both does it the approapriate thing as see, Hey 30*3 = 90 and you don't have 90!
Basically what it comes down to is Amount is being used as how many times I will use Synthesize then after each synthesize the Amount is being compared to how much was produced. Since not all synthesize are 1:1 it does turn out well.
To get around the bug i just copy/past the same Order in .yaml 5 times with the amount set to 1 to get the proper amounts of synthesize out. I think this only happens when a craft is a 1:many relationship which is probably only a Culinarrian issue.
I've tried to look through you code to narrow down but I'm tired and you'll probably find it faster then I could.
After looking at it closer I did find where the issue is. It is in your Order class. You take your current amount that was just crafted and compare it to the total amount that needs to be crafted.
Code:
public bool IsFinished
{
get { return Amount == 0 || isCancelled || (isInitiated && CurrentAmount >= totalAmount); }
}
.
.
.
.
private int CurrentAmount
{
get
{
return hq ? Inventory.GetHqItemAmount(itemId)
: Inventory.GetItemAmount(itemId);
}
}
.
.
.
.
totalAmount = CurrentAmount + Amount;
currentamount is how much just got craft and amount is original how many orders were placed.
I suggest that CurrentAmount property should should be divided by how much is expected to result from synethsis before returning the current amount.
If you rather me didn't link or reference your code and pm you instead please let me know and i'll edit this. Also let me know if this make any sense it is late but I enjoy reading/learning code logic.