public override void Execute() { if (EquipmentUpdateEvent.Run()) { WowInterface.CharacterManager.Equipment.Update(); } if (!NeedToRepair()) { StateMachine.SetState(BotState.Idle); return; } if (IsRepairNpcNear(out WowUnit selectedUnit)) { if (WowInterface.ObjectManager.Player.Position.GetDistance(selectedUnit.Position) > 3.5) { WowInterface.MovementEngine.SetMovementAction(MovementAction.Moving, selectedUnit.Position); if (WowInterface.MovementEngine.PathfindingStatus == PathfindingStatus.PathIncomplete) { ++BlacklistCounter; if (BlacklistCounter > 2) { WowInterface.MovementEngine.StopMovement(); Blacklist.Add(selectedUnit.Guid); BlacklistCounter = 0; return; } } } else if (InteractionEvent.Run() && SpeakToMerchantRoutine.Run(WowInterface, selectedUnit)) { WowInterface.I.MovementEngine.StopMovement(); if (Config.AutoRepair && WowInterface.ObjectManager.Target.IsRepairVendor) { WowInterface.HookManager.LuaRepairAllItems(); } if (Config.AutoSell) { SellItemsRoutine.Run(WowInterface, Config); } } } else { WowInterface.HookManager.LuaClickUiElement("MerchantFrameCloseButton"); StateMachine.SetState(BotState.Idle); } }
private void OnMerchantShow(long timestamp, List <string> args) { if (Config.AutoRepair && WowInterface.Target.IsRepairVendor) { WowInterface.HookManager.LuaRepairAllItems(); } if (Config.AutoSell) { SellItemsRoutine.Run(WowInterface, Config); SellingFinished = DateTime.UtcNow; } }
public override void Execute() { if (InventoryUpdateEvent.Run()) { WowInterface.CharacterManager.Inventory.Update(); } if (!NeedToSell()) { WowInterface.HookManager.LuaClickUiElement("MerchantFrameCloseButton"); StateMachine.SetState(BotState.Idle); return; } if (IsVendorNpcNear(out WowUnit selectedUnit)) { if (WowInterface.ObjectManager.Player.Position.GetDistance(selectedUnit.Position) > 3.0f) { WowInterface.MovementEngine.SetMovementAction(MovementAction.Move, selectedUnit.Position); } else if (InteractionEvent.Run() && SpeakToMerchantRoutine.Run(WowInterface, selectedUnit)) { WowInterface.I.MovementEngine.StopMovement(); if (Config.AutoRepair && WowInterface.ObjectManager.Target.IsRepairVendor) { WowInterface.HookManager.LuaRepairAllItems(); } if (Config.AutoSell) { SellItemsRoutine.Run(WowInterface, Config); } } } }