public override void Run() { CurrentLootable = Lootables.FirstOrDefault() ?? WoWUnit.Invalid; if (CurrentLootable != null && CurrentLootable.IsValid) { if (CurrentLootable.Distance > 4f) { if (!Moving || !Manager.LocalPlayer.IsClickMoving) { Moving = true; _parent.Print("Moving to loot {0}", CurrentLootable.Name); Mover.MoveTo(CurrentLootable.Location); } _parent.FSM.DelayNextPulse(500); } else { Moving = false; CurrentLootable.Interact(); if (Manager.LocalPlayer.IsLooting) { WoWScript.ExecuteNoResults( "local res = GetCVar(\"AutoLootDefault\") if res == \"0\" then for i = GetNumLootItems(), 1, -1 do LootSlot(i) end end CloseLoot()"); } _parent.FSM.DelayNextPulse(2000); } } }
public override void Run() { CurrentLootable = Lootables.FirstOrDefault() ?? WoWUnit.Invalid; if (CurrentLootable != null && CurrentLootable.IsValid) { if (CurrentLootable.Distance > 4f) { if (Mover.Status != MovementStatus.Moving || Mover.Destination != CurrentLootable.Location) { _parent.Print("Moving to loot {0}", CurrentLootable.Name); if (!Mover.PathTo(CurrentLootable.Location)) { _parent.Blacklisted.Add(CurrentLootable.Guid); } } _parent.FSM.DelayNextPulse(500); } else { CurrentLootable.Interact(); if (Manager.LocalPlayer.IsLooting) { WoWScript.ExecuteNoResults( "local res = GetCVar(\"AutoLootDefault\") if res == \"0\" then for i = GetNumLootItems(), 1, -1 do LootSlot(i) end end CloseLoot()"); } _parent.FSM.DelayNextPulse(2000); } } }