public static int GetClosestTarget(Memory.Memory.ObjectInfo[] Objects, String Faction, int IsAlive, int Range, int Type) { double MinRange = 10000; int ClosestTargetIndex = 0; for (int i = 0; i < Objects.Length; i++) { if (WowControl.CheckForBad(Objects[i].GUID) == false) { if ((Objects[i].Type == Type) & (Objects[i].Faction == Faction) & (Objects[i].Health >= IsAlive) & (Objects[i].Level > 1)) { if (CheckPoint(Objects[i].X, Objects[i].Y, Objects[i].Z, Objects[0].X, Objects[0].Y, Objects[0].Z) < MinRange) { ClosestTargetIndex = i; MinRange = CheckPoint(Objects[i].X, Objects[i].Y, Objects[i].Z, Objects[0].X, Objects[0].Y, Objects[0].Z); } } } } if ((ClosestTargetIndex != 0) & (MinRange < Range)) { return(ClosestTargetIndex); } else { return(0); } }
private void button1_Click(object sender, EventArgs e) { if (wow.wow.ProcessId != 0) { if (Running == false) { if (Defender.CheckLicense() == true) { WowControl.UpdateStatus("License key found."); Running = true; button1.Text = "Stop"; WowControl.UpdateStatus("Starting bot."); } else { WowControl.UpdateStatus("Invalid license key."); } } else { wow.GoTo(0, 0, 0, 0, 3);//Stop WowControl.FarmStatus = "Stopped"; Running = false; button1.Text = "Run"; WowControl.UpdateStatus("Stopping bot."); } } else { WowControl.UpdateStatus("Can't run, not found wow process."); } }
private void Loot(int Index) { if (Abilities.AbilityStatus == "Casting") { Status = "Looting"; } else if ((Status == "Looting") & (Abilities.AbilityStatus == "Ready")) { Status = "Ready"; } if (WowControl.CheckPoint(wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z, wow.Objects[Index].X, wow.Objects[Index].Y, wow.Objects[Index].Z) > 10) { if (wow.Objects[0].Z < wow.Objects[Index].Z) { wow.GoTo(wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[Index].Z + 30, wow.Objects[Index].GUID, 4); } else { wow.GoTo(wow.Objects[Index].X, wow.Objects[Index].Y, wow.Objects[Index].Z, wow.Objects[Index].GUID, 4); } } else { if (wow.Objects[Index].Type == 3) { Abilities.Button("Mote xtrtr"); } else { wow.GoTo(wow.Objects[Index].X, wow.Objects[Index].Y, wow.Objects[Index].Z, wow.Objects[Index].GUID, 7); } } }
private void CheckCombat() { if ((wow.Objects[0].IsInCombat == 1) & (wow.IsMounted == 0)) { int Index = FindClosestMob(); if (Index != 0) { WowControl.FarmStatus = "Fighting"; Target = wow.Objects[Index].GUID; WowControl.UpdateStatus("Fighting with \"" + wow.Objects[Index].Name + "\"."); WowControl.UpdateCombatLog("Fighting with \"" + wow.Objects[Index].Name + "\"."); if (wow.Objects[Index].IsInCombat == 1) { switch (WowControl.ClassType) { case 0: //Ranged wow.GoTo(0, 0, 0, wow.Objects[Index].GUID, 1); break; case 1: //Melee wow.GoTo(0, 0, 0, wow.Objects[Index].GUID, 11); break; } } Abilities.UseAbilities(wow); } return; } }
private int FindClosestSkinableMob() { int ClosestIndex = 0; double MinRange = 10000; for (int i = 0; i < wow.Objects.Count; i++) { bool Bad = false; if (WowControl.BadObjects.Count > 0) { for (int c = 0; c < WowControl.BadObjects.Count; c++) { if (WowControl.BadObjects[c] == wow.Objects[i].GUID) { Bad = true; } } } if ((Bad == false) & (wow.Objects[i].Type == 3) & (wow.Objects[i].Level > 1) & (wow.Objects[i].IsLootable == 0)) { if ((WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) & (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < WowControl.SkiningRange)) { ClosestIndex = i; if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { MinRange = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } } } return(ClosestIndex); }
private int GetTarget() { int ClosestIndex = 0; double MinRange = 10000; for (int i = 1; i < wow.Objects.Count; i++) { if (wow.Objects[i].GUID == Target) { if ((wow.Objects[i].Health == 0) & (wow.Objects[i].Name != "")) { WowControl.UpdateStatus("\"" + wow.Objects[i].Name + "\" owned xD."); WowControl.UpdateCombatLog("\"" + wow.Objects[i].Name + "\" owned xD."); } } if (wow.Objects[i].IsInCombat == 1) { double Range = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); if (Range < MinRange) { ClosestIndex = i; if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { MinRange = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } } } return(ClosestIndex); }
private int FindClosestGoods() { int ClosestIndex = 0; double MinRange = 10000; for (int n = 0; n < WowControl.Goods.Count; n++) { for (int i = 0; i < wow.Objects.Count; i++) { bool Bad = false; if (WowControl.BadObjects.Count > 0) { for (int c = 0; c < WowControl.BadObjects.Count; c++) { if (WowControl.BadObjects[c] == wow.Objects[i].GUID) { Bad = true; } } } if ((Bad == false) & (wow.Objects[i].Type != 4) & (wow.Objects[i].Name == WowControl.Goods[n])) { if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { ClosestIndex = i; if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { MinRange = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } } } } return(ClosestIndex); }
private void LoadCfg(String CfgName) { WowControl.LoadCfgFromFile(CfgName); FillListbox(); checkBox8.Checked = WowControl.LoadVariableBool("FarmHonor"); checkBox6.Checked = WowControl.LoadVariableBool("FarmMining"); checkBox5.Checked = WowControl.LoadVariableBool("FarmSkinning"); checkBox7.Checked = WowControl.LoadVariableBool("WPWrite"); checkBox1.Checked = WowControl.LoadVariableBool("Autoreconnect"); comboBox3.SelectedIndex = WowControl.LoadVariableInt("CharNo"); comboBox2.SelectedIndex = WowControl.LoadVariableInt("RealmNo"); comboBox8.SelectedIndex = WowControl.LoadVariableInt("ClassType"); textBox1.Text = WowControl.LoadVariableString("Account"); WowControl.MinPlayersInGroup = WowControl.LoadVariableInt("MinPlayersInGroup"); WowControl.FriendCheckRange = WowControl.LoadVariableInt("CheckRange"); WowControl.EnemyCheckRange = WowControl.LoadVariableInt("EnemyCheckRange"); WowControl.HealDDPriority = WowControl.LoadVariableInt("HealDDPriority"); WowControl.GroupRange = WowControl.LoadVariableInt("GroupRange"); WowControl.RangeFromPlayerToGroup = WowControl.LoadVariableInt("RangeFromPlayerToGroup"); WowControl.StayWithGroup = WowControl.LoadVariableBool("StayWithGroup"); WowControl.LootMobs = WowControl.LoadVariableBool("LootMobs"); WowControl.FarmMount = WowControl.LoadVariableInt("FarmMount"); WowControl.SkiningKillAll = WowControl.LoadVariableBool("SkiningKillAll"); WowControl.SkiningRange = WowControl.LoadVariableInt("SkiningRange"); WowControl.SkinAll = WowControl.LoadVariableBool("SkinAll"); WowControl.UpdateStatus("Config " + comboBox1.Text + " loaded!"); }
private void button10_Click(object sender, EventArgs e) { switch (tabControl2.SelectedIndex) { case 0: WowControl.Command("say " + textBox8.Text); textBox8.Text = ""; break; case 1: if (WhisperChatBox.SelectedIndex != -1) { String Player = GetPlayerNameFromString(WhisperChatBox.Items[WhisperChatBox.SelectedIndex].ToString()); if (Player != "") { WowControl.Command("w " + Player + " " + textBox8.Text); } textBox8.Text = ""; } break; case 2: WowControl.Command(textBox8.Text); textBox8.Text = ""; break; } }
private void Unstuck() { if ((DateTime.Now - LastTry).TotalSeconds > 10) { LastTry = DateTime.Now; if (StuckStarted == false) { StuckTime = DateTime.Now; StuckStarted = true; } Abilities.AbilityStatus = "Ready"; WowControl.GetOnMount(wow, WowControl.FarmMount); WowControl.WaitTime = DateTime.Now.AddSeconds(3); return; } if ((DateTime.Now - StuckTime).TotalSeconds > 60) { StuckTime = DateTime.Now; Move(wow.Objects[0].R + (float)Math.PI / 2, 30); } else { Move(wow.Objects[0].R, 30); } }
private void CheckCombat() { if ((wow.Objects[0].IsInCombat == 1) & (wow.IsMounted == 0)) { int Index = GetTarget(); if (Index != 0) { double Range = WowControl.CheckPoint(wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z, wow.Objects[Index].X, wow.Objects[Index].Y, wow.Objects[Index].Z); wow.SelectTarget(wow.Objects[Index].GUID); WowControl.FarmStatus = "Fighting"; Target = wow.Objects[Index].GUID; WowControl.UpdateStatus("Fighting with \"" + wow.Objects[Index].Name + "\"."); WowControl.UpdateCombatLog("Fighting with \"" + wow.Objects[Index].Name + "\"."); if (WowControl.ClassType == 1) { wow.GoTo(0, 0, 0, wow.Objects[Index].GUID, 11); } else { if (Range > 30) { wow.GoTo(0, 0, 0, wow.Objects[Index].GUID, 11); } else { wow.GoTo(0, 0, 0, 0, 3); WowControl.Sleep(100); wow.GoTo(0, 0, 0, wow.Objects[Index].GUID, 1); } } Abilities.UseAbilities(wow, ""); } return; } }
private void textBox1_TextChanged(object sender, EventArgs e) { try { WowControl.SkiningRange = Convert.ToInt32(textBox1.Text); } catch (Exception E) { WowControl.UpdateStatus(textBox1.Text + ". " + E.Message); } }
private void textBox5_TextChanged(object sender, EventArgs e) { try { WowControl.EnemyCheckRange = Convert.ToInt32(textBox5.Text); } catch (Exception E) { WowControl.UpdateStatus(E.Message); } }
private void textBox4_TextChanged(object sender, EventArgs e) { try { WowControl.MinPlayersInGroup = Convert.ToInt32(textBox4.Text); } catch (Exception E) { WowControl.UpdateStatus(E.Message); } }
public static int LoadBinds(int ConfigStart, int ConfigEnd, String[] Config) { Abilities.Ability Temp = new Abilities.Ability(); Abilities.BindingsList.Clear(); int[] Slashes = new int[11]; bool FoundedAbility = false; int AbilityIndex = 0; for (int i = ConfigStart; i < ConfigEnd; i++) { int Start = 0; int End = 0; int SlashCount = 0; FoundedAbility = false; for (int n = 0; n < Config[i].Length; n++) { String TempStr = Config[i].Substring(n, 1); if (TempStr == "%") { Start = n; FoundedAbility = true; } if (TempStr == ";") { End = n; } if (TempStr == "\\") { Slashes[SlashCount] = n; SlashCount++; } } if (FoundedAbility == true) { try { Temp.AbilityName = Config[i].Substring(0, Start); Temp.AbilityTxt = Config[i].Substring(Start + 1, (Slashes[0] - 1 - Start)); Temp.Key = Convert.ToInt32(Config[i].Substring(Slashes[0] + 1, (Slashes[1] - 1 - Slashes[0]))); Temp.NotEditable = Convert.ToBoolean(Config[i].Substring(Slashes[1] + 1, (Slashes[2] - 1 - Slashes[1]))); Temp.Modifiers = Convert.ToString(Config[i].Substring(Slashes[2] + 1, (Slashes[3] - 1 - Slashes[2]))); Temp.CastTime = (float)Convert.ToDouble(Config[i].Substring(Slashes[3] + 1, (Slashes[4] - 1 - Slashes[3]))); Temp.CoolDown = (float)Convert.ToDouble(Config[i].Substring(Slashes[4] + 1, (Slashes[5] - 1 - Slashes[4]))); Temp.InCombat = Convert.ToInt32(Config[i].Substring(Slashes[5] + 1, (Slashes[6] - 1 - Slashes[5]))); Temp.AbilityType = Convert.ToInt32(Config[i].Substring(Slashes[6] + 1, (End - 1 - Slashes[6]))); } catch (Exception) { WowControl.Log.Add(WowControl.GetTimeStr() + "Got error while loading binds. Maybe old version cfg."); } Abilities.BindingsList.Add(Temp); int OptionsCount = GetOptionsListCount(Config, i, Temp.AbilityName); if (OptionsCount > 0) { LoadOptionsList(Config, i + 1, OptionsCount, AbilityIndex); } AbilityIndex++; } } return(0); }
private int FindClosestMob() { int ClosestIndex = 0; double MinRange = 10000; bool Looted = false; bool Skined = true; for (int i = 0; i < wow.Objects.Count; i++) { bool Bad = false; if (WowControl.BadObjects.Count > 0) { for (int c = 0; c < WowControl.BadObjects.Count; c++) { if (WowControl.BadObjects[c] == wow.Objects[i].GUID) { Bad = true; } } } if ((Bad == false) & (wow.Objects[i].Type == 3) & (wow.Objects[i].Level > 1)) { if ((WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) & (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < WowControl.SkiningRange)) { ClosestIndex = i; if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { MinRange = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } } if (SkinningObject.Guid == wow.Objects[i].GUID) { Skined = false; } if ((LootingObject.Guid == wow.Objects[i].GUID) & (wow.Objects[i].IsLootable == 0)) { Looted = true; } } if ((Skined == true) & (Skining == true)) { Skining = false; TryToSkin = 0; WowControl.Loot.Add(SkinningObject); CurrentWP = GetClosestWP(WowControl.WP); WowControl.UpdateStatus("Skined: \"" + SkinningObject.Name + "\"."); } if ((Looted == true) & (Looting == true) & (Skining == false)) { Looted = false; TryToLoot = 0; CurrentWP = GetClosestWP(WowControl.WP); WowControl.UpdateStatus("Looted : \"" + LootingObject.Name + "\"."); } return(ClosestIndex); }
public void DownloadNewVersion() { try { WebClient WC = new WebClient(); WC.DownloadFile("http://farmhelper.googlecode.com/files/FarmHelper" + AvailableVersion + ".exe", Application.StartupPath + "\\Newversion.exe"); WC.Dispose(); } catch (Exception E) { WowControl.UpdateStatus(E.Message); } }
private void CheckForLootSkin() { if ((DateTime.Now - WowControl.BotStartTime).TotalMinutes > 60) { WowControl.BadObjects.Clear(); WowControl.BotStartTime = DateTime.Now; } for (int i = 0; i < wow.Objects.Count; i++) { bool Looted = true; bool Skined = true; bool Bad = false; if (WowControl.BadObjects.Count > 0) { for (int c = 0; c < WowControl.BadObjects.Count; c++) { if (WowControl.BadObjects[c] == wow.Objects[i].GUID) { Bad = true; } } } if ((wow.Objects[i].GUID != 0) & (Bad == false) & (wow.Objects[i].GUID == LootingObject.Guid)) { if (wow.Objects[i].IsLootable == 0) { Looted = false; } if (wow.Objects[i].Type == 5) { Looted = false; } } if ((Bad == false) & (wow.Objects[i].GUID == SkinningObject.Guid)) { Skined = false; } if ((CheckForBad(SkinningObject.Guid) == false) & (Skined == true) & (Skining == true)) { Skining = false; TryToSkin = 0; CurrentWP = GetClosestWP(WowControl.WP); WowControl.Loot.Add("Skined: \"" + SkinningObject.Name + "\"."); WowControl.UpdateStatus("Skined: \"" + SkinningObject.Name + "\"."); } if ((CheckForBad(LootingObject.Guid) == false) & (Looted == true) & (Looting == true) & (Skining == false)) { Looting = false; TryToLoot = 0; CurrentWP = GetClosestWP(WowControl.WP); WowControl.Loot.Add("Looted : \"" + LootingObject.Name + "\"."); WowControl.UpdateStatus("Looted : \"" + LootingObject.Name + "\"."); } } }
public static void Button(String AbilityName, int Duration) { for (int i = 0; i < BindingsList.Count; i++) { if (BindingsList[i].AbilityName == AbilityName) {//Shift, Control, Alt Ability[] TempArray = BindingsList.ToArray(); TempArray[i].LastUse = DateTime.Now; BindingsList.Clear(); for (int n = 0; n < TempArray.Length; n++) { Abilities.BindingsList.Add(TempArray[n]); } if (BindingsList[i].AbilityType == 0) //Instant { AbilityStatus = "Instant"; } else { AbilityStatus = "Casting"; WowControl.Stop(); } StartCast = DateTime.Now; EndCast = DateTime.Now.AddMilliseconds(BindingsList[i].CastTime * 1000); if (CheckString(BindingsList[i].Modifiers, "Alt") == true) { WowControl.KeyToWnd(0x12, false); } if (CheckString(BindingsList[i].Modifiers, "Control") == true) { WowControl.KeyToWnd(0x11, false); } if (CheckString(BindingsList[i].Modifiers, "Shift") == true) { WowControl.KeyToWnd(0x10, false); } WowControl.KeyToWnd(BindingsList[i].Key, false); WowControl.Sleep(Duration); WowControl.KeyToWnd(BindingsList[i].Key, true); if (CheckString(BindingsList[i].Modifiers, "Alt") == true) { WowControl.KeyToWnd(0x12, true); } if (CheckString(BindingsList[i].Modifiers, "Control") == true) { WowControl.KeyToWnd(0x11, true); } if (CheckString(BindingsList[i].Modifiers, "Shift") == true) { WowControl.KeyToWnd(0x10, true); } } } }
private void button5_Click(object sender, EventArgs e) { if (MessageBox.Show("You are really wanna delete " + comboBox1.Text + ".cfg ?", "Farm helper request.", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { File.Delete(Application.StartupPath + "\\Configs\\" + comboBox1.Text + ".cfg"); WowControl.Sleep(100); WowControl.UpdateStatus("Config " + comboBox1.Text + " deleted!"); comboBox1.Text = ""; ReadConfigs(); } }
private int DetectWPSearchRange() { /*int CourseLenght = 0; * for (int i = 0; i < WowControl.WP.Length; i++) * if (i < WowControl.WP.Length - 1) * CourseLenght += (int)WowControl.CheckPoint(WowControl.WP[i].X, WowControl.WP[i].Y, WowControl.WP[i].Z, WowControl.WP[i + 1].X, WowControl.WP[i + 1].Y, WowControl.WP[i + 1].Z); */ int I = WowControl.WP.Length / 2; int T = (int)WowControl.CheckPoint(WowControl.WP[I].X, WowControl.WP[I].Y, WowControl.WP[I].Z, WowControl.WP[I + 1].X, WowControl.WP[I + 1].Y, WowControl.WP[I + 1].Z); return((int)(T * 1.3)); //Convert.ToInt32(CourseLenght * 1.2 / WowControl.WP.Length); }
private void checkBox7_CheckedChanged(object sender, EventArgs e) { if (checkBox7.Checked == true) { button6.Enabled = true; WowControl.UpdateStatus("Waypoint writing mode enabled."); } else { button6.Enabled = false; WowControl.UpdateStatus("Waypoint writing mode disabled."); } }
private SpellInfo[] GetSpellsByName(String Name) { List <SpellInfo> Result = new List <SpellInfo>(); for (int i = 0; i < WowControl.AllSpells.Length; i++) { if (WowControl.FindTextInString(WowControl.AllSpells[i].ToLower(), Name) == true) { Result.Add(GetSpellFromString(WowControl.AllSpells[i])); } } return(Result.ToArray()); }
private void FollowWaypoints() { if (Abilities.AbilityStatus != "Casting") { if ((Abilities.AbilityStatus == "Ready") & (wow.IsIndoors == 0) & (wow.Objects[0].IsInCombat == 0) & (wow.IsMounted == 0)) { WowControl.GetOnMount(wow, 1); WowControl.Sleep(2000); LastTime = DateTime.Now; } for (int i = 0; i < WowControl.WP.ToArray().Length; i++) { if (WowControl.CheckPoint(wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z, WowControl.WP[i].X, WowControl.WP[i].Y, WowControl.WP[i].Z) < 5) { CurrentWP = WowControl.WP[i].NextWaypoint; WPDetected = true; break; } } if (WPDetected == false) { CurrentWP = GetClosestWP(WowControl.WP); WPDetected = true; } if (CurrentWP >= WowControl.WP.Length) { CurrentWP = 0; } double RangeToLastLoc = WowControl.CheckPoint(wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z, LastLocation.X, LastLocation.Y, LastLocation.Z); LastLocation.X = wow.Objects[0].X; LastLocation.Y = wow.Objects[0].Y; LastLocation.Z = wow.Objects[0].Z; if (RangeToLastLoc > 50) { CurrentWP = GetClosestWP(WowControl.WP); WowControl.UpdateStatus("Changed position, detecting closest waypoint."); } wow.GoTo(WowControl.WP[CurrentWP].X, WowControl.WP[CurrentWP].Y, WowControl.WP[CurrentWP].Z, 0, 4); if ((DateTime.Now - LastTime).TotalMilliseconds > 3000) { LastTime = DateTime.Now; if (wow.IsMounted == 0) { Abilities.Button("Jump"); } } WowControl.UpdateStatus("Going to waypoint № " + CurrentWP + "."); } }
private SpellInfo[] GetSpellsByName(String Name, int Rank) { List <SpellInfo> Result = new List <SpellInfo>(); for (int i = 0; i < WowControl.AllSpells.Length; i++) { SpellInfo temp = GetSpellFromString(WowControl.AllSpells[i]); if ((temp.SpellRank == Rank) & (WowControl.FindTextInString(WowControl.AllSpells[i].ToLower(), Name) == true)) { Result.Add(temp); } } return(Result.ToArray()); }
private void checkBox5_CheckedChanged(object sender, EventArgs e) { if (checkBox5.Checked == true) { button7.Enabled = true; WowControl.UpdateStatus("Killing mob mode enabled."); WowControl.FarmSkinning = true; } else { button7.Enabled = false; WowControl.UpdateStatus("Killing mob mode disabled."); WowControl.FarmSkinning = false; } }
private void checkBox6_CheckedChanged(object sender, EventArgs e) { if (checkBox6.Checked == true) { button8.Enabled = true; WowControl.UpdateStatus("Gathering mode enabled."); WowControl.FarmMining = true; } else { button8.Enabled = false; WowControl.UpdateStatus("Gathering mode disabled."); WowControl.FarmMining = false; } }
private int FindClosestGoods() { int ClosestIndex = 0; double MinRange = 10000; bool Looted = true; for (int n = 0; n < WowControl.Goods.Count; n++) { for (int i = 0; i < wow.Objects.Count; i++) { bool Bad = false; if (WowControl.BadObjects.Count > 0) { for (int c = 0; c < WowControl.BadObjects.Count; c++) { if (WowControl.BadObjects[c] == wow.Objects[i].GUID) { Bad = true; } } } if ((Bad == false) & (wow.Objects[i].Type != 4) & (wow.Objects[i].Name == WowControl.Goods[n])) { if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { ClosestIndex = i; if (WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z) < MinRange) { MinRange = WowControl.CheckPoint(wow.Objects[i].X, wow.Objects[i].Y, wow.Objects[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } } if ((LootingObject.Guid == wow.Objects[i].GUID) & (Bad == false)) { Looted = false; } } } if ((Looted == true) & (Looting == true)) { Looting = false; TryToLoot = 0; WowControl.Loot.Add(LootingObject); CurrentWP = GetClosestWP(WowControl.WP); WowControl.UpdateStatus("Looted: \"" + LootingObject.Name + "\"."); } return(ClosestIndex); }
private int GetClosestWP(int CurrentWP, MainForm.Coords[] WP) { int ClosestIndex = 0; double ClosestRange = 10000; for (int i = 0; i < WP.Length; i++) { double p = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); if (p < ClosestRange) { ClosestIndex = i; ClosestRange = WowControl.CheckPoint(WP[CurrentWP].X, WP[CurrentWP].Y, WP[CurrentWP].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } return(ClosestIndex); }
private int GetClosestWP(MainForm.WayPoints[] WP) { double MinRange = 10000; int ClosestIndex = 0; for (int i = 0; i < WP.Length; i++) { double Range = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); if (Range < MinRange) { ClosestIndex = i; MinRange = WowControl.CheckPoint(WP[i].X, WP[i].Y, WP[i].Z, wow.Objects[0].X, wow.Objects[0].Y, wow.Objects[0].Z); } } return(ClosestIndex); }