public void Click(RadarForm form, MouseEventArgs e) { Point cursorPosition = form.PointToClient(Cursor.Position); var cursorRect = new Rectangle(cursorPosition.X, cursorPosition.Y, 5, 5); try { foreach (PGameObject node in ObjectManager.GetGameObject) { if (FindNode.IsHerb(node) || FindNode.IsMine(node)) { float x = form.OffsetX(node.Location.X, ObjectManager.MyPlayer.Location.X); float y = form.OffsetY(node.Location.Y, ObjectManager.MyPlayer.Location.Y); var objRect = new Rectangle((int)y, (int)x, 5, 5); if (Rectangle.Intersect(objRect, cursorRect) != Rectangle.Empty) { if (FlyingBlackList.IsBlacklisted(node)) { FlyingBlackList.Unblacklist(node); } else { Logging.Write("Added the node to the permanent blacklist"); FlyingBlackList.AddBadNode(node); } } } } } catch { } }
internal static bool DismountAndHarvest(PGameObject harvest, Ticker timeOut) { if (!LazySettings.BackgroundMode && !harvest.Location.IsFacing()) { harvest.Location.Face(); } if (Mount.IsMounted() && !ObjectManager.MyPlayer.IsInFlightForm) { Mount.Dismount(); timeOut.Reset(); while (ObjectManager.MyPlayer.IsMoving && !timeOut.IsReady) { Thread.Sleep(100); } Thread.Sleep(500); } Logging.Debug("Going to do harvest now"); harvest.Interact(true); Latency.Sleep(ObjectManager.MyPlayer.UnitRace != "Tauren" ? 750 : 500); if (!ObjectManager.MyPlayer.IsCasting && ObjectManager.MyPlayer.UnitRace != "Tauren") { harvest.Interact(true); Latency.Sleep(750); } if (CheckFight(harvest)) { ToldAboutNode.TellAbout("正在战斗状态", harvest); return(false); } timeOut.Reset(); while (ObjectManager.MyPlayer.IsCasting && !timeOut.IsReady) { if (CheckFight(harvest)) { ToldAboutNode.TellAbout("正在战斗状态", harvest); return(false); } Thread.Sleep(100); } if (CheckFight(harvest)) { ToldAboutNode.TellAbout("正在战斗状态", harvest); return(false); } if (Langs.SkillToLow(ObjectManager.MyPlayer.RedMessage)) { Logging.Write("技能太低"); HelperFunctions.ResetRedMessage(); if (FindNode.IsMine(harvest) || FindNode.IsHerb(harvest)) { SkillToLow.Blacklist(harvest.Name, 240); } return(false); } return(true); }
public void Draw(RadarForm form) { foreach (PGameObject selectNode in ObjectManager.GetGameObject) { if (FindNode.IsHerb(selectNode) || FindNode.IsMine(selectNode)) { if (FlyingBlackList.IsBlacklisted(selectNode)) { form.PrintCircle(_colorBadNodes, form.OffsetY(selectNode.Location.Y, ObjectManager.MyPlayer.Location.Y), form.OffsetX(selectNode.Location.X, ObjectManager.MyPlayer.Location.X), selectNode.Name); } else { form.PrintCircle(_colorObjects, form.OffsetY(selectNode.Location.Y, ObjectManager.MyPlayer.Location.Y), form.OffsetX(selectNode.Location.X, ObjectManager.MyPlayer.Location.X), selectNode.Name); } } } }