private void SubscribeFoundryActions() { try { foreach(FoundryActionTypes act in Enum.GetValues(typeof(FoundryActionTypes))) { FoundryAction fa = new FoundryAction(); fa.Action = act; switch(fa.Action) { case FoundryActionTypes.None: fa.ActionDelay = 0; break; case FoundryActionTypes.Peace: fa.ActionDelay = 600; break; case FoundryActionTypes.ClearShield: fa.ActionDelay = 300; break; case FoundryActionTypes.EquipWand: fa.ActionDelay = 600; break; case FoundryActionTypes.Magic: fa.ActionDelay = 600; break; case FoundryActionTypes.Portal: fa.ActionDelay = 1000; break; case FoundryActionTypes.UseLandscape: fa.ActionDelay = 1000; break; case FoundryActionTypes.OpenContainer: fa.ActionDelay = 1000; break; case FoundryActionTypes.MoveToPack: fa.ActionDelay = 600; break; case FoundryActionTypes.Read: fa.ActionDelay = 850; break; case FoundryActionTypes.Reveal: fa.ActionDelay = 750; break; case FoundryActionTypes.Desiccate: fa.ActionDelay = 750; break; case FoundryActionTypes.ManaStone: fa.ActionDelay = 750; break; case FoundryActionTypes.OpenUst: fa.ActionDelay = 300; break; case FoundryActionTypes.Salvage: fa.ActionDelay = 300; break; } FoundryActionList.Add(fa); } FoundryMoveIndex = FoundryActionList.FindIndex(x => x.Action == FoundryActionTypes.MoveToPack); Core.CharacterFilter.SpellCast += FoundryActionsSpellCastComplete; Core.CharacterFilter.Logoff += FoundryActionsLogOff; FoundryActionTimer.Interval = 150; FoundryActionTimer.Tick += FoundryActionInitiator; Core.WorldFilter.ChangeObject += FoundryChangeObject; try { if(Core.WorldFilter.GetInventory().Any(x => x.Name.ToLower() == "ust")) { mFoundryToolSet.UstId = Core.WorldFilter.GetInventory().Where(x => x.Name.ToLower() == "ust").First().Id; } if(Core.WorldFilter.GetInventory().Any(x => x.Name.ToLower() == "intricate carving tool")) { mFoundryToolSet.CarvingToolId = Core.WorldFilter.GetInventory().Where(x => x.Name.ToLower() == "intricate carving tool").First().Id; } if(Core.WorldFilter.GetInventory().Any(x => x.Name.ToLower() == "aetheria mana stone")) { mFoundryToolSet.AetheriaManaStoneId = Core.WorldFilter.GetInventory().Where(x => x.Name.ToLower() == "aetheria mana stone").First().Id; } //Refresh on use below.... if(Core.WorldFilter.GetInventory().Any(x => x.Name.ToLower() == "aetheria desiccant")) { mFoundryToolSet.AetheriaDesiccantId = Core.WorldFilter.GetInventory().Where(x => x.Name.ToLower() == "aetheria desiccant").First().Id; } if(Core.WorldFilter.GetInventory().Any(x => x.ObjectClass == ObjectClass.ManaStone && x.Values(LongValueKey.IconOutline) == 0)) { foreach(WorldObject wo in Core.WorldFilter.GetInventory().Where(x => x.ObjectClass == ObjectClass.ManaStone && x.Values(LongValueKey.IconOutline) == 0)) { mFoundryToolSet.EmptyManaStoneIds.Add(wo.Id); } } FoundryFillPackIDs(); }catch(Exception ex){LogError(ex);} }catch(Exception ex){LogError(ex);} }
private void SubscribeFoundryActions() { try { FoundryActionList.Clear(); foreach(FoundryActionTypes act in Enum.GetValues(typeof(FoundryActionTypes))) { FoundryAction fa = new FoundryAction(); fa.Action = act; switch(fa.Action) { case FoundryActionTypes.NetworkDelay1: fa.ActionDelay = Ping() + 100; break; case FoundryActionTypes.NetworkDelay2: fa.ActionDelay = (Ping() + 100) * 2; break; case FoundryActionTypes.LongDelay: fa.ActionDelay = 1500; break; case FoundryActionTypes.Peace: fa.ActionDelay = 600; break; case FoundryActionTypes.ClearShield: fa.ActionDelay = 400; break; case FoundryActionTypes.EquipWand: fa.ActionDelay = 400; break; case FoundryActionTypes.Magic: fa.ActionDelay = 600; break; case FoundryActionTypes.CastSpell: fa.ActionDelay = 1000; break; case FoundryActionTypes.UseLandscape: fa.ActionDelay = 1000; break; case FoundryActionTypes.UseLockPick: fa.ActionDelay = 500; break; case FoundryActionTypes.UseChestKey: fa.ActionDelay = 1000; break; case FoundryActionTypes.OpenContainer: fa.ActionDelay = 1000; break; case FoundryActionTypes.Stack: fa.ActionDelay = 200; break; case FoundryActionTypes.Cram: fa.ActionDelay = 400; break; case FoundryActionTypes.MoveToPack: fa.ActionDelay = 600; break; case FoundryActionTypes.Read: fa.ActionDelay = 850; break; case FoundryActionTypes.Reveal: fa.ActionDelay = 1200; break; case FoundryActionTypes.Desiccate: fa.ActionDelay = 750; break; case FoundryActionTypes.ManaStone: fa.ActionDelay = 750; break; case FoundryActionTypes.CraftCombine: fa.ActionDelay = 750; break; case FoundryActionTypes.CarvingTool: fa.ActionDelay = 750; break; case FoundryActionTypes.RingKey: fa.ActionDelay = 1000; break; case FoundryActionTypes.OpenUst: fa.ActionDelay = 100; break; case FoundryActionTypes.Salvage: fa.ActionDelay = 300; break; case FoundryActionTypes.ValetRemove: fa.ActionDelay = 400; break; case FoundryActionTypes.ValetEquip: fa.ActionDelay = 400; break; case FoundryActionTypes.CompleteBuy: case FoundryActionTypes.CompleteSell: fa.ActionDelay = 300; break; case FoundryActionTypes.BuyTradeNote: fa.ActionDelay = 800; break; case FoundryActionTypes.SellTradeNote: fa.ActionDelay = 800; break; case FoundryActionTypes.PurchaseComponents: fa.ActionDelay = 800; break; case FoundryActionTypes.SellItems: fa.ActionDelay = 800; break; case FoundryActionTypes.AddToStorage: fa.ActionDelay = 1200; break; case FoundryActionTypes.AddToTrade: fa.ActionDelay = 200; break; } FoundryActionList.Add(fa); } FoundryActionTimer.Interval = 100; FoundryActionTimer.Tick += FoundryActionInitiator; Core.CommandLineText += TextCommandReceived; Core.ChatBoxMessage += Foundry_ChatBoxMessage; //New Event Handlers AetherCharacter.CharacterLogOff += FoundryActionsLogOff; AetherObjects.ObjectCreated += FoundryInventoryCreated; AetherObjects.ContainerChanged += FoundryContainerChanged; AetherCharacter.SpellCastAction += SpellCast_Foundry; mCurrentInventory.IdKeyrings(); }catch(Exception ex){LogError(ex);} }