private void uxCharacter_SelectedIndexChanged(object sender, EventArgs e) { fface = null; uxTabs.Visible = false; string s = ""; using (WebClient client = new WebClient()) { s = client.DownloadString("http://www.dazusu.com/soap.php?d=" + CalculateMD5Hash(uxCharacter.SelectedItem.ToString()).ToLower()); } if (s == "0 " || uxCharacter.SelectedItem.ToString() == "Dazusu" || uxCharacter.SelectedItem.ToString() == "Dazuto" || uxCharacter.SelectedItem.ToString() == "Otsureku" || uxCharacter.SelectedItem.ToString() == "Damarijanette") { fface = Hook.HookCharacter(uxCharacter.SelectedItem.ToString()); uxTabs.Visible = true; } else { MessageBox.Show("This character/server combination is not authorized."); } }
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(); }
// Constructor. public FiniteStateEngine(FFACE fface) { Heartbeat.Interval = 100; // Check State list ten times per second. Heartbeat.Tick += Heartbeat_Tick; worker.DoWork += worker_DoWork; worker.WorkerSupportsCancellation = true; this._fface = fface; //Create the states AddState(new RestState(fface)); AddState(new AttackState(fface)); AddState(new TravelState(fface)); AddState(new HealingState(fface)); AddState(new DeadState(fface)); AddState(new PostBattle(fface)); AddState(new TargetInvalid(fface)); foreach (var b in this.Brains) { b.Enabled = true; } }
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 DeadState(FFACE fface) : base(fface) { }
private void AddLine(FFACE.ChatTools.ChatLine line) { var para = new Paragraph(); para = ProcessLine(line, para); if (para != null) { ChatLog.Blocks.Add(para); } }
public Ranger(FFACE instance, Content content) { _content = content; _fface = instance; Melee = true; }
public NavigationTools(FFACE api) { this.api = api; }
public PlayerActions(FFACE fface) { this._fface = fface; }
public new void TranslateText(String Text, ref FFXIWindow window, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { String sFromCode = GetLanguageCode(Text); String Result = String.Empty; if (SettingsModel.getInstance().English) { Result = GetTranslatedText(Text, sFromCode, "en"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().German) { Result = GetTranslatedText(Text, sFromCode, "de"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().French) { Result = GetTranslatedText(Text, sFromCode, "fr"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().Japanese) { Result = GetTranslatedText(Text, sFromCode, "ja"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } if (SettingsModel.getInstance().Spanish) { Result = GetTranslatedText(Text, sFromCode, "es"); ShowMessage(ref window, Text, GetDisplayText(Text, Result), ref cmChatMode, Plugin); } }
public TimerTools(FFACE api) { this.api = api; }
public void ShowMessage(ref FFXIWindow window, String From, String To, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { if (To.Length == 0) return; String EncodedTo = EncodeShiftJIS(To); UpdateTranslationLog(window.process.MainWindowTitle, From, To, Plugin); if (SettingsModel.getInstance().OutEcho) { WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /echo {0}", EncodedTo)); } if (SettingsModel.getInstance().OutLinkshell && (cmChatMode == FFACE.ChatMode.RcvdLinkShell || cmChatMode == FFACE.ChatMode.SentLinkShell)) { WaitForLastSent(); WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /l {0}", ((char)26).ToString() + EncodedTo)); LastSent = DateTime.Now; } if (SettingsModel.getInstance().OutParty && (cmChatMode == FFACE.ChatMode.RcvdParty || cmChatMode == FFACE.ChatMode.SentParty)) { WaitForLastSent(); WindowerHelper.CKHSendString(window.keyboardHandle, String.Format("//input /p {0}", ((char)26).ToString() + EncodedTo)); LastSent = DateTime.Now; } }
public void TranslateText(String Text, ref FFXIWindow window, ref FFACE.ChatMode cmChatMode, XIPlugin Plugin) { }
public bool ParseLine(FFACE.ChatTools.ChatLine line) { Result = Condition.Match(line.Text); return (Completed = Condition.IsMatch(line.Text)); }
public RestState(FFACE fface) : base(fface) { }
public CastingModel(FFACE fface) { this._fface = fface; this._ftools = FarmingTools.GetInstance(fface); }
public TargetInvalid(FFACE fface) : base(fface) { }
public BlueMage(FFACE instance, Content content) { _content = content; _fface = instance; Melee = true; }
public PlayerData(FFACE fface) { this._fface = fface; }
public Paragraph ProcessLine(FFACE.ChatTools.ChatLine chatline, Paragraph para) { if (filters.Contains(chatline.Type) || filters.Count == 0) { TextRange range; TextPointer EndOfPrefix = null; ; para = new Paragraph(); range = new TextRange(para.ContentStart, para.ContentEnd);//log.Document.ContentEnd, log.Document.ContentEnd); range.Text += "("+((int)chatline.Type).ToString("X2") + ")"; range.Text += chatline.Now; // para.Inlines.Add(chatline.Now); range.ApplyPropertyValue(TextElement.ForegroundProperty, System.Windows.Media.Brushes.SteelBlue); range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold); EndOfPrefix = range.End; para.Inlines.Add(chatline.Text); range = new TextRange(EndOfPrefix, para.ContentEnd); range.ApplyPropertyValue(TextElement.ForegroundProperty, chatColorConverter(chatline.Color)); range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold); para.LineHeight = 0.5; return para; } return null; }
public WindowerTools(FFACE api) { this.api = api; }
/// <summary> /// Starts the Ambuscade Process. /// </summary> /// <param name="instance">FFACE Instance.</param> /// <param name="roeTarget">RoE Target Monster</param> /// <param name="ambuscadeTarget">Ambuscade Target NM</param> /// <param name="homePoint">Home Point Menu Item to Click (i.e.: "Cape Teriggan #1.")</param> /// <param name="keyitem">Does the player already possess the KI upon starting?</param> /// <param name="settings">Settings object added as an afterthought to prevent more parameters being added.</param> /// <param name="difficulty">The difficulty string to select when entering ambuscade.</param> public void Start(FFACE instance, Monster roeTarget, Monster ambuscadeTarget, string homePoint, bool keyitem, AmbuscadeSettings settings, string difficulty = "Easy. (Level: 114)") { // Enables looping in the class. _ambuscade = true; // The HP Menu Item String to select when moving to the RoE Zone. _hpMenuItemString = homePoint; // The RoE And Ambuscade Target Monsters. roeTargetMonster = roeTarget; ambuscadeTargetMonster = ambuscadeTarget; // Use new FFACE Movement. fface.Navigator.UseNewMovement = true; fface.Navigator.SetViewMode(ViewMode.ThirdPerson); // Does the player have a key item already upon starting? _initialKeyItem = keyitem; if (_initialKeyItem) { _hasKeyItem = true; } // The Difficulty to select when entering ambuscade. _difficultyMenuString = difficulty; // Assign the job and fface instance to the combat static class. Combat.SetInstance = fface; Combat.SetJob = job; Chat.SetInstance(fface); Chat.SetMatches(events); Chat.FoundMatchHandler += Chat_FoundMatchHandler; Chat.Watch(true); Thread Status = new Thread(DoReportStunStatus); Status.Start(); // Network and Other Settings: _Leader = settings.Leader; _HumanPlayers = settings.PartyCount; fface.Windower.SendString("//lua load enternity"); Thread.Sleep(100); fface.Windower.SendString("//lua load knockblock"); // Connect to Network Socket sock = Sockets.CreateTCPSocket(settings.Server, 6993); //Socket sock = Sockets.CreateTCPSocket("127.0.0.1", 6993); client = new ClientInfo(sock, false); client.Delimiter = "\r\n"; client.OnRead += new ConnectionRead(ReadData); client.OnReady += Client_OnReady; client.BeginReceive(); Thread.Sleep(100); if (_initialKeyItem && !_Leader) { client.Send("KEY"); Thread.Sleep(1000); } if (_Leader) { client.Send($"PARTY {fface.Player.Name} {string.Join(",", GetPartyMembers())}"); taskThread = new Thread(DoTask); taskThread.Start(); } else { client.Send($"JOIN {fface.Player.Name}"); } chatThread = new Thread(DoChat); chatThread.Start(); Thread Safe = new Thread(SafePong); Safe.Start(); }
public NPCTools(FFACE api) { this.api = api; }
public TravelState(FFACE fface) : base(fface) { }
public DarkKnight(FFACE instance, Content content) { _content = content; _fface = instance; Melee = true; }
public BaseState(FFACE fface) { this.fface = fface; this.ftools = FarmingTools.GetInstance(fface); }
public Paragraph ProcessLine(FFACE.ChatTools.ChatLine chatline, Paragraph para) { if (para == null) { throw new ArgumentNullException("para"); } if (!_filters.Contains(chatline.Type) && _filters.Count != 0) { return null; } para = new Paragraph(); var range = new TextRange(para.ContentStart, para.ContentEnd); range.Text += "("+((int)chatline.Type).ToString("X2") + ")"; range.Text += chatline.Now; range.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue); range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold); var endOfPrefix = range.End; para.Inlines.Add(chatline.Text); range = new TextRange(endOfPrefix, para.ContentEnd); range.ApplyPropertyValue(TextElement.ForegroundProperty, ChatColorConverter(chatline.Color)); range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold); para.LineHeight = 0.5; return para; }
public BlackMage(FFACE instance, Content content) { _content = content; _fface = instance; Melee = false; }
public BardForm(FFACE fface) { _fface = fface; InitializeComponent(); }
public PostBattle(FFACE fface) : base(fface) { }
//private RuneFencerForm settingsForm = new RuneFencerForm(); public RuneFencer(FFACE instance, Content content) { _content = content; _fface = instance; }
public AttackState(FFACE fface) : base(fface) { }
public PartyMemberTools(FFACE api, int index) { this.api = api; this.index = index; }
private void addline(FFACE.ChatTools.ChatLine line) { Paragraph para = new Paragraph(); //AuctionHouse.SetProcessMemoryReader(); para = ProcessLine(line, para); if (para != null) chatlog.Blocks.Add(para); }
public PlayerTools(FFACE api) { this.api = api; }
public TargetTools(FFACE api) { this.api = api; }
public Paladin(FFACE instance, Content content) { _content = content; _fface = instance; Melee = true; }
public HealingState(FFACE fface) : base(fface) { }