muffin v6.35 with old pdb
This commit is contained in:
parent
ac85599236
commit
b5d2cc6708
31 changed files with 958 additions and 958 deletions
|
|
@ -47,8 +47,8 @@ internal static class DoGather
|
|||
|
||||
public unsafe override ETaskResult Update()
|
||||
{
|
||||
Task task = base.Task;
|
||||
if ((object)task != null && task.RevisitRequired && !task.RevisitTriggered)
|
||||
Task pos = base.Task;
|
||||
if ((object)pos != null && pos.RevisitRequired && !pos.RevisitTriggered)
|
||||
{
|
||||
logger.LogInformation("No revisit");
|
||||
return ETaskResult.TaskComplete;
|
||||
|
|
@ -69,23 +69,23 @@ internal static class DoGather
|
|||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
_wasGathering = true;
|
||||
if (gameGui.TryGetAddonByName<AddonGathering>("Gathering", out var addonPtr2))
|
||||
if (gameGui.TryGetAddonByName<AddonGathering>("Gathering", out var span))
|
||||
{
|
||||
if (gatheringController.HasRequestedItems())
|
||||
{
|
||||
addonPtr2->FireCallbackInt(-1);
|
||||
span->FireCallbackInt(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<SlotInfo> list = ReadSlots(addonPtr2);
|
||||
List<SlotInfo> indexOfPos = ReadSlots(span);
|
||||
if (base.Task.Request.Collectability > 0)
|
||||
{
|
||||
SlotInfo slotInfo = list.Single((SlotInfo x) => x.ItemId == base.Task.Request.ItemId);
|
||||
addonPtr2->FireCallbackInt(slotInfo.Index);
|
||||
SlotInfo slotInfo = indexOfPos.Single((SlotInfo x) => x.ItemId == base.Task.Request.ItemId);
|
||||
span->FireCallbackInt(slotInfo.Index);
|
||||
}
|
||||
else
|
||||
{
|
||||
NodeCondition nodeCondition = new NodeCondition(addonPtr2->AtkValues[110].UInt, addonPtr2->AtkValues[111].UInt);
|
||||
NodeCondition nodeCondition = new NodeCondition(span->AtkValues[110].UInt, span->AtkValues[111].UInt);
|
||||
if (_actionQueue != null && _actionQueue.TryPeek(out var result))
|
||||
{
|
||||
if (gameFunctions.UseAction(result))
|
||||
|
|
@ -95,16 +95,16 @@ internal static class DoGather
|
|||
}
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
_actionQueue = GetNextActions(nodeCondition, list);
|
||||
_actionQueue = GetNextActions(nodeCondition, indexOfPos);
|
||||
if (_actionQueue == null)
|
||||
{
|
||||
logger.LogInformation("Skipping the rest of gathering...");
|
||||
addonPtr2->FireCallbackInt(-1);
|
||||
span->FireCallbackInt(-1);
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
if (_actionQueue.Count == 0)
|
||||
{
|
||||
SlotInfo slotInfo2 = _slotToGather ?? list.SingleOrDefault((SlotInfo x) => x.ItemId == base.Task.Request.ItemId) ?? list.MinBy((SlotInfo x) => x.ItemId);
|
||||
SlotInfo slotInfo2 = _slotToGather ?? indexOfPos.SingleOrDefault((SlotInfo x) => x.ItemId == base.Task.Request.ItemId) ?? indexOfPos.MinBy((SlotInfo x) => x.ItemId);
|
||||
switch (slotInfo2?.ItemId)
|
||||
{
|
||||
case 2u:
|
||||
|
|
@ -133,11 +133,11 @@ internal static class DoGather
|
|||
}
|
||||
if (slotInfo2 != null)
|
||||
{
|
||||
addonPtr2->FireCallbackInt(slotInfo2.Index);
|
||||
span->FireCallbackInt(slotInfo2.Index);
|
||||
}
|
||||
else
|
||||
{
|
||||
addonPtr2->FireCallbackInt(-1);
|
||||
span->FireCallbackInt(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -153,32 +153,32 @@ internal static class DoGather
|
|||
|
||||
private unsafe List<SlotInfo> ReadSlots(AddonGathering* addonGathering)
|
||||
{
|
||||
List<SlotInfo> list = new List<SlotInfo>();
|
||||
for (int i = 0; i < 8; i++)
|
||||
List<SlotInfo> pos = new List<SlotInfo>();
|
||||
for (int matchStart = 0; matchStart < 8; matchStart++)
|
||||
{
|
||||
uint num = addonGathering->ItemIds[i];
|
||||
if (num != 0)
|
||||
uint slice = addonGathering->ItemIds[matchStart];
|
||||
if (slice != 0)
|
||||
{
|
||||
AtkComponentCheckBox* value = addonGathering->GatheredItemComponentCheckbox[i].Value;
|
||||
if (!int.TryParse(value->UldManager.SearchNodeById(10u)->GetAsAtkTextNode()->NodeText.ToString(), out var result))
|
||||
AtkComponentCheckBox* value = addonGathering->GatheredItemComponentCheckbox[matchStart].Value;
|
||||
if (!int.TryParse(value->UldManager.SearchNodeById(10u)->GetAsAtkTextNode()->NodeText.ToString(), out var iteration))
|
||||
{
|
||||
iteration = 0;
|
||||
}
|
||||
if (!int.TryParse(value->UldManager.SearchNodeById(16u)->GetAsAtkTextNode()->NodeText.ToString(), out var result))
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
if (!int.TryParse(value->UldManager.SearchNodeById(16u)->GetAsAtkTextNode()->NodeText.ToString(), out var result2))
|
||||
{
|
||||
result2 = 0;
|
||||
}
|
||||
AtkTextNode* asAtkTextNode = value->UldManager.SearchNodeById(31u)->GetAsAtkComponentNode()->Component->UldManager.SearchNodeById(7u)->GetAsAtkTextNode();
|
||||
if (!asAtkTextNode->IsVisible() || !int.TryParse(asAtkTextNode->NodeText.ToString(), out var result3))
|
||||
if (!asAtkTextNode->IsVisible() || !int.TryParse(asAtkTextNode->NodeText.ToString(), out var result2))
|
||||
{
|
||||
result3 = 1;
|
||||
result2 = 1;
|
||||
}
|
||||
SlotInfo item = new SlotInfo(i, num, result, result2, result3);
|
||||
list.Add(item);
|
||||
SlotInfo item = new SlotInfo(matchStart, slice, iteration, result, result2);
|
||||
pos.Add(item);
|
||||
}
|
||||
}
|
||||
logger.LogTrace("Slots: {Slots}", string.Join(", ", list));
|
||||
return list;
|
||||
logger.LogTrace("Slots: {Slots}", string.Join(", ", pos));
|
||||
return pos;
|
||||
}
|
||||
|
||||
private Queue<EAction>? GetNextActions(NodeCondition nodeCondition, List<SlotInfo> slots)
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@ internal static class DoGatherCollectable
|
|||
|
||||
private Queue<EAction> GetNextActions(NodeCondition nodeCondition)
|
||||
{
|
||||
uint currentGp = clientState.LocalPlayer.CurrentGp;
|
||||
logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", currentGp, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour);
|
||||
uint currentPosition = clientState.LocalPlayer.CurrentGp;
|
||||
logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", currentPosition, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour);
|
||||
Queue<EAction> queue = new Queue<EAction>();
|
||||
uint num = nodeCondition.CollectabilityToGoal(base.Task.Request.Collectability);
|
||||
if (num <= nodeCondition.CollectabilityFromMeticulous)
|
||||
|
|
@ -153,7 +153,7 @@ internal static class DoGatherCollectable
|
|||
queue.Enqueue(PickAction(EAction.ScourMiner, EAction.ScourBotanist));
|
||||
return queue;
|
||||
}
|
||||
if (!nodeCondition.ScrutinyActive && currentGp >= 200)
|
||||
if (!nodeCondition.ScrutinyActive && currentPosition >= 200)
|
||||
{
|
||||
logger.LogTrace("Still missing {NeededCollectability} collectability, scrutiny inactive", num);
|
||||
queue.Enqueue(PickAction(EAction.ScrutinyMiner, EAction.ScrutinyBotanist));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue