public HealingViewModel(FarmingTools farmingTools) : base(farmingTools) { AddHealingCommand = new DelegateCommand(AddHealingItem); DeleteHealingCommand = new DelegateCommand <Object>(DeleteHealing); ClearHealingCommand = new DelegateCommand(ClearHealing); }
public TargetsViewModel(FarmingTools farmingTools) : base(farmingTools) { this.AddCommand = new DelegateCommand(AddTargetCommand); this.DeleteCommand = new DelegateCommand(DeleteTargetCommand); this.ClearCommand = new DelegateCommand(ClearTargetsCommand); }
public BattlesViewModel(FarmingTools farmingTools) : base(farmingTools) { AddActionCommand = new DelegateCommand <Object>(AddAction); DeleteActionCommand = new DelegateCommand <Object>(DeleteAction); ClearActionsCommand = new DelegateCommand(ClearActions); }
public RoutesViewModel(FarmingTools farmingTools) : base(farmingTools) { WaypointRecorder.Tick += new EventHandler(RouteRecorder_Tick); WaypointRecorder.Interval = new TimeSpan(0, 0, 1); ClearRouteCommand = new DelegateCommand(ClearRoute); RecordRouteCommand = new DelegateCommand <Object>(RecordRoute); SaveCommand = new DelegateCommand(SaveRoute); LoadCommand = new DelegateCommand(LoadRoute); }
public MainViewModel(FarmingTools farmingTools) : base(farmingTools) { // Get events from view models to update the status bar's text. App.EventAggregator.GetEvent <StatusBarUpdateEvent>().Subscribe((a) => { StatusBarText = a; }); // Tell the user the program has loaded the player's data App.InformUser("Bot Loaded: " + farmingTools.FFACE.Player.Name); // Create start command handler. StartCommand = new DelegateCommand(Start); }
protected override void OnStartup(StartupEventArgs e) { // Set up the event aggregator for updates to the status bar from // multiple view models. EventAggregator = new EventAggregator(); // Let user select ffxi process frmStartup ProcessSelectionScreen = new frmStartup(); ProcessSelectionScreen.ShowDialog(); // Validate the selection var m_process = ProcessSelectionScreen.POL_Process; // Check if the user made a selection. if (m_process == null) { System.Windows.Forms.MessageBox.Show("No valid process was selected: Exiting now."); Environment.Exit(0); } // Save the selected fface instance. _fface = ProcessSelectionScreen.FFXI_Session; // Set up the game engine if valid. FarmingTools.LoadSettings(); // Set up UnitService to use this mob filter instead of its // default mob filter. FarmingTools.UnitService.MobFilter = UnitFilters.MobFilter(_fface); // Create a new game engine to control our character. GameEngine = new GameEngine(_fface); // new DebugSpellCasting(_fface).Show(); // new DebugCreatures(_fface, FarmingTools.UnitService).Show(); }
public static Func <Unit, bool> MobFilter(FFACE fface) { var ftools = FarmingTools.GetInstance(fface); // Function to use to filter surrounding mobs by. return(new Func <Unit, bool>((Unit x) => { // No fface? Bail. if (fface == null) { return false; } //FIXED: Added null check to avoid certain states // secretly throwing null pointer exceptions. // If the mob is null, bail. if (x == null) { return false; } // Mob not active if (!x.IsActive) { return false; } // INFO: fixes trying to attack dead mob problem. // Mob is dead if (x.IsDead) { return false; } // Allow for mobs with an npc bit of sometimes 4 (colibri) // and ignore mobs that are invisible npcbit = 0 if (x.NPCBit <= 0 || x.NPCBit >= 16) { return false; } // Type is not mob if (!x.NPCType.Equals(NPCType.Mob)) { return false; } // Mob is out of range if (!(x.Distance < ftools.UserSettings.MiscSettings.DetectionDistance)) { return false; } // Mob too high out of reach. if (x.YDifference > ftools.UserSettings.MiscSettings.HeightThreshold) { return false; } // Has aggroed and user doesn't want to kill aggro if (x.HasAggroed && !ftools.UserSettings.FilterInfo.AggroFilter) { return false; } // Party has claim but we don't want to kill party mobs. if (x.PartyClaim && !ftools.UserSettings.FilterInfo.PartyFilter) { return false; } // Mob not claimed but we don't want to kill unclaimed mobs. if (!x.IsClaimed && !ftools.UserSettings.FilterInfo.UnclaimedFilter) { return false; } // If mob is on the ignored list ignore it. if (ftools.UserSettings.FilterInfo.IgnoredMobs.Contains(x.Name)) { return false; } // Not on our targets list. if (!ftools.UserSettings.FilterInfo.TargetedMobs.Contains(x.Name) && ftools.UserSettings.FilterInfo.TargetedMobs.Count > 0) { return false; } //INFO: claimid is broken on the private server so keep id checks off. // The mob is claimed but it is not our claim. //FIX: Temporary fix until player.serverid is fixed. if (x.IsClaimed && x.ClaimedID != fface.PartyMember[0].ServerID) { // and the claim filter is off, invalid. if the filter is on // the program will attack claimed mobs. if (!ftools.UserSettings.FilterInfo.ClaimedFilter) { return false; } } // Mob is valid return true; })); }
public IgnoredViewModel(FarmingTools farmingTools) : base(farmingTools) { AddIgnoredUnitCommand = new DelegateCommand(AddIgnoredUnit); DeleteIgnoredUnitCommand = new DelegateCommand(DeleteIgnoredUnit); ClearIgnoredUnitsCommand = new DelegateCommand(ClearIgnoredUnits); }
public BaseState(FFACE fface) { this.fface = fface; this.ftools = FarmingTools.GetInstance(fface); }
protected override void OnExit(ExitEventArgs e) { FarmingTools.SaveSettings(); }
public CastingModel(FFACE fface) { this._fface = fface; this._ftools = FarmingTools.GetInstance(fface); }
public WeaponsViewModel(FarmingTools farmingTools) : base(farmingTools) { SetCommand = new DelegateCommand(SetWeaponSkill); }
public RestingViewModel(FarmingTools farmingTools) : base(farmingTools) { }
public UnitFilteringViewModel(FarmingTools farmingTools) : base(farmingTools) { RestoreDefaultsCommand = new DelegateCommand(RestoreDefaults); }
protected ViewModelBase(FarmingTools farmingTools) { this.ftools = farmingTools; }