private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (timer1.Enabled == true) { FFxiNAV.FindPathToPosi(KeepMovingStartPosi, Posi); if (Character.Navi.DistancetoWaypoint(KeepMovingStartPosi, Posi) > 4) { FFxiNAV.TryGetWaypoints(); } if (FFxiNAV.waypoints.Count > 0) { backgroundWorker1.RunWorkerAsync(); } else { backgroundWorker1.CancelAsync(); } timer.Enabled = false; } else if (Character.Navi.DistancetoWaypoint(KeepMovingStartPosi, Posi) < 4) { Character.Logger.AddDebugText(rtbDebug, string.Format(@"here")); backgroundWorker1.CancelAsync(); } }
private void timer_Tick(object sender, EventArgs e) { string newString = FFxiNAV.GetErrorMessage(); if (oldString != newString) { Character.Logger.AddDebugText(rtbDebug, newString); } oldString = newString; }
/// <summary> /// Loads the nav mesh. /// </summary> public void LoadNavMesh() { try { OpenFileDialog OpenDialog = new OpenFileDialog(); string PATH = (string.Format(Application.StartupPath)); OpenDialog.InitialDirectory = PATH; OpenDialog.FilterIndex = 0; if (OpenDialog.ShowDialog() == DialogResult.OK) { string path = OpenDialog.FileName; FFxiNAV.Load(path); Logger.AddDebugText(Tc.rtbDebug, string.Format(@"NavMesh initialized, File Loaded = {0}", path)); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button5_Click_1(object sender, EventArgs e) { try { var mob = Character.Target.FindBestTarget(); var start = new position_t(); var end = new position_t(); start.X = (float)Character.Api.Player.X; start.Y = (float)Character.Api.Player.Y; start.Z = (float)Character.Api.Player.Z; start.Rotation = 0; start.Moving = 0; end.X = (float)Character.Api.Entity.GetEntity(mob).X; end.Y = (float)Character.Api.Entity.GetEntity(mob).Y; end.Z = (float)Character.Api.Entity.GetEntity(mob).Z; end.Rotation = 0; end.Moving = 0; if (mob != 0) { var i = Character.Api.Entity.GetEntity(mob).Render0000; var i2 = Character.Api.Entity.GetEntity(mob).Render0000 & 0x200; var name = Character.Api.Entity.GetEntity(mob).Name; var dist = Character.Navi.DistanceTo(mob); Character.Logger.AddDebugText(Character.Tc.rtbDebug, string.Format(@"render flags {0} {1}", i.ToString(), i2.ToString())); Character.Logger.AddDebugText(rtbDebug, string.Format("Looking for path to {0} distance {1}y", name, dist.ToString())); FFxiNAV.FindPath(start, end); } if (mob == 0) { Character.Logger.AddDebugText(rtbDebug, "Mob id = 0 so unable to find a path"); } } catch (Exception ex) { Character.Logger.AddDebugText(rtbDebug, ex.ToString()); } }
private void button14_Click(object sender, EventArgs e) { try { OpenFileDialog OpenDialog = new OpenFileDialog(); string PATH = (string.Format(Application.StartupPath)); OpenDialog.InitialDirectory = PATH; OpenDialog.FilterIndex = 0; if (OpenDialog.ShowDialog() == DialogResult.OK) { string path = OpenDialog.FileName; FFxiNAV.Initialize(9999); FFxiNAV.Load(path); Character.Logger.AddDebugText(rtbDebug, string.Format(@"NavMesh initialized, File Loaded = {0}", path)); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void button16_Click(object sender, EventArgs e) { Character.Logger.AddDebugText(rtbDebug, string.Format(@"Points in navmesh path = {0}", FFxiNAV.PathCount().ToString())); }
private void button15_Click(object sender, EventArgs e) { Character.Logger.AddDebugText(rtbDebug, string.Format(@"NavMesh is enabled = {0}", FFxiNAV.IsNavMeshEnabled().ToString())); }
private void backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { FFxiNAV.FindPathToPosi(KeepMovingStartPosi, Posi); FFxiNAV.TryGetWaypoints(); }
private void button6_Click(object sender, EventArgs e) { FFxiNAV.Unload(); }
public unsafe void Test() { FFxiNAV.TryGetWaypoints(); // FFxiNAV.TryGetZWaypoints(); }