using System.Windows.Forms; using robotManager.Helpful; using robotManager.Products; using wManager.Wow.Helpers; using System.Linq; using System.Collections.Generic; using wManager.Wow.ObjectManager; using System; using System.Configuration; using System.ComponentModel; using System.IO; using System.Threading; using wManager.Plugin; using wManager.Wow.Bot.Tasks; public class Main : wManager.Plugin.IPlugin { public bool _launched; public void Initialize() { _launched = true; CombatLooterSettings.Load(); Logging.Write("[CombatLooter] Started."); while (_launched) { try { Pulse(); } catch (Exception ex) { wManager.Wow.ObjectManager.ObjectManager.Me.ForceIsCast = false; Logging.WriteError("Combatlooter.Pulse(): " + (object) ex, true); } System.Threading.Thread.Sleep(400); } } public void Dispose() { _launched = false; Logging.Write("[CombatLooter] Stopped."); } public void Settings() { CombatLooterSettings.Load(); CombatLooterSettings.CurrentSetting.ToForm(); CombatLooterSettings.CurrentSetting.Save(); Logging.Write("[MultiPull] Settings saved."); } public void Pulse() { try { if (!robotManager.Products.Products.InPause && wManager.Wow.ObjectManager.ObjectManager.Me.IsAlive && !ObjectManager.Me.HaveBuff("Food") && !ObjectManager.Me.HaveBuff("Drink")) { try { WoWUnit woWunit = wManager.Wow.ObjectManager.ObjectManager.GetWoWUnitLootable().Where((Func) (p => { if (p.IsLootable) return (double) p.GetDistance2D <= 10.0; return false; })).OrderBy((Func) (p => p.GetDistance2D)).FirstOrDefault(); if (woWunit != null) Interact.InteractGameObjectAutoLoot(woWunit.GetBaseAddress); } catch { } } System.Threading.Thread.Sleep(CombatLooterSettings.CurrentSetting.TimeInterval); } catch (Exception ex) { wManager.Wow.ObjectManager.ObjectManager.Me.ForceIsCast = false; Logging.WriteError("Combatlooter.Routine.Pulse(): " + (object) ex, true); } } } public class CombatLooterSettings : Settings { public CombatLooterSettings() { TimeInterval = 10000; } public static CombatLooterSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("CombatLooter", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("CombatLooter > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CombatLooter", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load(AdviserFilePathAndName("CombatLooter", ObjectManager.Me.Name + "." + Usefuls.RealmName)); return true; } CurrentSetting = new CombatLooterSettings(); } catch (Exception e) { Logging.WriteError("CombatLooterSettings > Load(): " + e); } return false; } [Setting] [Category("Settings")] [DisplayName("Time Interval")] [Description("Amount of time between scanning for loot.")] public int TimeInterval { get; set; } }