/// <summary> /// Updates item counts for all requested items. /// </summary> private void UpdateRequestedItemCounts() { try { this.currentGatherRequest = null; // reset current gather request, will be set to first valid request below foreach (GatherRequest curRequest in this.requestList) { if (curRequest.CurrentCount != BADITEM) { curRequest.CurrentCount = 0; } else { continue; } if (settings.HqOnly) { curRequest.CurrentCount = ConditionParser.HqItemCount(curRequest.ItemName); } else { curRequest.CurrentCount = ConditionParser.ItemCount(curRequest.ItemName); } } } catch (Exception ex) { this.LogException(ex); } }
/// <summary> /// Flags the specified gather request as unable to complete, allowing the bot to continue to the next request. /// </summary> /// <param name="gatherRequest">The gather requests referring to the trouble item.</param> private void FlagBadItem(GatherRequest gatherRequest) { foreach (GatherRequest curRequest in this.requestList) { if (gatherRequest.ItemName == curRequest.ItemName) { curRequest.CurrentCount = BADITEM; } } }
/// <summary> /// Lists the gathering status of all requested items. Assigns a valid gather request for continuing work. /// </summary> private void ReportGatheringStatus() { try { foreach (GatherRequest curRequest in this.requestList) { Color logColor; if (curRequest.RequestedTotal == BADITEM) { logColor = LogErrorColor; } else if (curRequest.RequestedTotal <= curRequest.CurrentCount) { logColor = LogMinorColor; } else { logColor = LogMajorColor; } this.Log(logColor, string.Format("Item: {0}, Count: {1}, Requested: {2}", curRequest.ItemName, curRequest.CurrentCount, curRequest.RequestedTotal), true); if (this.currentGatherRequest == null && curRequest.CurrentCount < curRequest.RequestedTotal && curRequest.CurrentCount != BADITEM) { this.Log(LogMajorColor, string.Format("Updating gather request to {0}", curRequest.ItemName), true); this.currentGatherRequest = curRequest; } } } catch (Exception ex) { this.LogException(ex); } }