private static void GetIndexesOfCrStashTabs() { if (hasInitializedIndexes == false) { hasInitializedIndexes = true; foreach (var str in chaosRecipeStashTabNamesList) { chaosRecipeStashTabIndexes.Add(StashBehavior.GetIndexOfStashTabWithName(str)); } } }
public static Composite GrabItem(ItemToGrabFromStashDelegate itemToGrabFromStashDelegate) { return(new Sequence( TownBehavior.OpenStash(), StashBehavior.SwitchToTab(x => itemToGrabFromStashDelegate(x).stashIndex), MoveItemFromStashToInventory(itemToGrabFromStashDelegate), new Action(delegate { Thread.Sleep(100); currentItemToGrab = null; return RunStatus.Success; }) )); }
public static Composite DoChaosRecipeStashesInit() { return(new Decorator(delegate { GetIndexesOfCrStashTabs(); if (hasOpenedCrStashTabs == false) { return true; } return false; }, new Sequence( TownBehavior.OpenStash(), StashBehavior.SwitchToTab(x => chaosRecipeStashTabIndexes[0]), StashBehavior.SwitchToTab(x => chaosRecipeStashTabIndexes[1]), StashBehavior.SwitchToTab(x => chaosRecipeStashTabIndexes[2]), StashBehavior.SwitchToTab(x => chaosRecipeStashTabIndexes[3]), new Action(delegate { hasOpenedCrStashTabs = true; return RunStatus.Success; }) ) )); }