Exemplo n.º 1
0
        public static void ClickSend()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("SendMailMailButton");

            Functions.Click(btn, false);
            Thread.Sleep(200);
        }
Exemplo n.º 2
0
        public void OpenBag(int nr)
        {
            if (nr == CurrentOpenBag)
            {
                // verify it is open
                GInterfaceObject CurBag = GContext.Main.Interface.GetByName(BagButtonNames[nr]);
                if (CurBag == null || !CurBag.IsFiring)
                {
                    PPather.WriteLine(LOG_CATEGORY.INFORMATION, "BagManager: Something is very fishy with the bags. Close them all and try again");
                    CloseAllBags();
                    CurrentOpenBag = -1;
                    Thread.Sleep(250); // allow a short wait after closing the bag and opening the new one.
                }
            }

            if (nr != CurrentOpenBag)
            {
                CloseAllBags();
                Thread.Sleep(250);

                GInterfaceObject CurBag = GContext.Main.Interface.GetByName(BagButtonNames[nr]);
                if (CurBag != null)
                {
                    Functions.Click(CurBag, false);
                    //Thread.Sleep(300);
                    CurrentOpenBag = nr;
                    Thread.Sleep(125);
                    //PPather.WriteLine("BagManager: Open bag " + BagButtonNames[nr]);
                }
            }
        }
Exemplo n.º 3
0
        public static void TypeTo(string toName)
        {
            GInterfaceObject name = GContext.Main.Interface.GetByName("SendMailNameEditBox");

            Functions.Click(name, false);
            GContext.Main.Interface.SendString(toName);
        }
Exemplo n.º 4
0
        public void OpenBag(int nr)
        {
            if (nr == CurrentOpenBag)
            {
                // verify it is open
                GInterfaceObject CurBag = GContext.Main.Interface.GetByName(BagButtonNames[nr]);
                if (CurBag == null || !CurBag.IsFiring)
                {
                    PPather.WriteLine("BagManager: Something is very fishy with the bags. Close them all and try again");
                    CloseAllBags();
                }
            }

            if (nr != CurrentOpenBag)
            {
                CloseAllBags();

                GInterfaceObject CurBag = GContext.Main.Interface.GetByName(BagButtonNames[nr]);
                if (CurBag != null)
                {
                    Functions.Click(CurBag, false);
                    //Thread.Sleep(300);
                    CurrentOpenBag = nr;
                    //PPather.WriteLine("BagManager: Open bag " + BagButtonNames[nr]);
                }
            }
        }
Exemplo n.º 5
0
        public static List <string> GetTooltipOnOpenBags(GItem item)
        {
            List <string>    text    = new List <string>();
            GInterfaceObject ItemObj = bm.GetItem(item);

            if (ItemObj != null)
            {
                GContext.Main.EnableCursorHook();
                ItemObj.Hover();
                Thread.Sleep(50);
                GInterfaceObject ToolTip = GContext.Main.Interface.GetByName("GameTooltip");
                if (ToolTip != null)
                {
                    foreach (GInterfaceObject child in ToolTip.Children)
                    {
                        if (child.ToString().Contains("GameTooltipText"))
                        {
                            text.Add(child.LabelText);
                        }
                    }
                }
                GContext.Main.DisableCursorHook();
            }
            return(text);
        }
Exemplo n.º 6
0
        public static List <string> GetTooltip(string slot)
        {
            text.Clear();
            GInterfaceObject SlotObj = GContext.Main.Interface.GetByName(cSLOT + slot);

            if (SlotObj != null)
            {
                GContext.Main.EnableCursorHook();
                SlotObj.Hover();
                Thread.Sleep(100);
                GInterfaceObject ToolTip = GContext.Main.Interface.GetByName("GameTooltip");
                if (ToolTip != null)
                //    RecursiveToolTip(ToolTip);
                {
                    foreach (GInterfaceObject child in ToolTip.Children)
                    {
                        if (child.ToString().Contains("GameTooltipText"))
                        {
                            text.Add(child.LabelText);
                        }
                    }
                }
                GContext.Main.DisableCursorHook();
            }
            return(text);
        }
Exemplo n.º 7
0
        // Frame doesn't need to be open, but it needs to be loaded
        public static bool HasPoints()
        {
            // Talent frame hasn't been loaded
            if (!FrameExists())
            {
                ToggleFrame();
                ToggleFrame();
            }


            GInterfaceObject points = GetFrame().GetChildObject(fPOINTS);

            if (points == null)
            {
                //PPather.WriteLine("Talent Frame interaction failed!");
                return(false);
            }

            // That little label text that has available points
            // updates even if the talent frame isn't shown
            if (Int32.Parse(points.LabelText) > 0)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 8
0
        private static TreeNode dumpUi_doChildren(ref GInterfaceObject gio)
        {
            // gio.Name is not defined...
            string s = gio.ToString();

            s = s.Substring(s.IndexOf('"') + 1);
            s = s.Substring(0, s.IndexOf('"'));

            //if (s.EndsWith("Text") || s.Contains("Button"))
            string lblText = gio.LabelText;

            if (lblText != "(read failed)")
            {
                s += " \"" + lblText + "\"";
            }

            TreeNode node = new TreeNode(s);

            for (int i = 0; i < gio.Children.Length; i++)
            {
                if (form.dumpUiVisibleCB.Checked && !gio.Children[i].IsVisible)
                {
                    continue;
                }

                TreeNode childNode = dumpUi_doChildren(ref gio.Children[i]);
                node.Nodes.Add(childNode);
            }

            return(node);
        }
Exemplo n.º 9
0
 public static void ClickOption(GInterfaceObject btn)
 {
     if (btn != null && btn.IsVisible)
     {
         Functions.Click(btn);
     }
 }
Exemplo n.º 10
0
        public static string GetCompleteTitle()
        {
            GInterfaceObject QuestDetailScrollChildFrame = GContext.Main.Interface.GetByName("QuestRewardScrollChildFrame");
            GInterfaceObject QuestTitle = QuestDetailScrollChildFrame.GetChildObject("QuestRewardTitleText");

            PPather.WriteLine("Reward title: {0}, v: {1}", QuestTitle.LabelText, QuestTitle.IsVisible);
            return(QuestTitle.LabelText);
        }
Exemplo n.º 11
0
        public static string GetAcceptTitle()
        {
            GInterfaceObject QuestDetailScrollChildFrame = GContext.Main.Interface.GetByName("QuestDetailScrollChildFrame");
            GInterfaceObject QuestTitle = QuestDetailScrollChildFrame.GetChildObject("QuestTitleText");

            PPather.WriteLine("Quest title: " + QuestTitle.LabelText + " v: " + QuestTitle.IsVisible);
            return(QuestTitle.LabelText);
        }
Exemplo n.º 12
0
 public static void Hover(GInterfaceObject u)
 {
     if (u != null && u.IsVisible)
     {
         GContext.Main.EnableCursorHook();
         u.Hover();
         GContext.Main.DisableCursorHook();
     }
 }
Exemplo n.º 13
0
        // Internal scroll handling
        private static void ScrollDown()
        {
            GInterfaceObject down = GContext.Main.Interface.GetByName(fDOWN);

            Functions.Click(down, false);
            Thread.Sleep(50);
            Functions.Click(down, false);
            scrolled = true;
        }
Exemplo n.º 14
0
        // Internal scroll handling
        private static void ScrollUp()
        {
            GInterfaceObject up = GContext.Main.Interface.GetByName(fUP);

            Functions.Click(up, false);
            Thread.Sleep(50);
            Functions.Click(up, false);
            scrolled = false;
        }
Exemplo n.º 15
0
        public static void Join()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("BattlefieldFrameJoinButton");

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn, false);
            }
        }
Exemplo n.º 16
0
        public static void SelectReward(int nr)
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestRewardItem" + nr);

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn, false);
            }
        }
Exemplo n.º 17
0
        public static void Complete()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestFrameCompleteQuestButton");

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn, false);
            }
        }
Exemplo n.º 18
0
 public static void Click(GInterfaceObject lbtn, bool right)
 {
     if (lbtn != null && lbtn.IsVisible)
     {
         GContext.Main.EnableCursorHook();
         lbtn.ClickMouse(right);
         GContext.Main.DisableCursorHook();
     }
 }
Exemplo n.º 19
0
        public static void Close()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameCloseButton");

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn);
            }
        }
Exemplo n.º 20
0
        public static void Goodbye()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameGreetingGoodbyeButton");

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn, false);
            }
        }
Exemplo n.º 21
0
        public static void ClickSkill(int i)
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("ClassTrainerSkill" + i);

            if (btn != null && btn.IsVisible)
            {
                Functions.Click(btn, false);                 // left click
            }
        }
Exemplo n.º 22
0
        // Internal frame handling
        private static void ToggleFrame()
        {
            GInterfaceObject micro = GContext.Main.Interface.GetByName(cBUTTON);

            if (micro.IsVisible)
            {
                Functions.Click(micro, false);
                Thread.Sleep(500);
            }
        }
Exemplo n.º 23
0
        public GInterfaceObject GetItem(int BagNr, int ItemNr)
        {
            //PPather.WriteLine("BagManager: Opening bag {0}",BagNr);
            OpenBag(BagNr);
            //PPather.WriteLine("BagManager: Click item " + BagNr + " " + ItemNr);
            String           itemStr = "ContainerFrame1Item" + ItemNr;
            GInterfaceObject ItemObj = GContext.Main.Interface.GetByName(itemStr);

            return(ItemObj);
        }
Exemplo n.º 24
0
        public static bool IsJoin()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("BattlefieldFrameJoinButton");

            if (btn != null && btn.IsVisible)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 25
0
        public static bool CanSend()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("SendMailMailButton");

            if (!btn.IsVisible)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 26
0
        public static bool IsComplete()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestFrameCompleteQuestButton");

            if (btn != null && btn.IsVisible)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 27
0
        public static bool IsVisible()
        {
            GInterfaceObject obj = GetFrame();

            if (obj != null && obj.IsVisible)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 28
0
        public static bool IsGoodbye()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameGreetingGoodbyeButton");

            if (btn != null && btn.IsVisible)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 29
0
        public static bool IsSelect()
        {
            GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestTitleButton1");

            if (btn != null && btn.IsVisible)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 30
0
        public static void RightClick()
        {
            GInterfaceObject obj = GetFrame();

            if (obj != null && obj.IsVisible)
            {
                Functions.Hover(obj);
                Functions.Click(obj, true);
            }
        }
Exemplo n.º 31
0
 private static void setFrame()
 {
     if (frame == null)
     {
         frame = GContext.Main.Interface.GetByName("QuestWatchFrame");
         questLines = new string[32];
         updateTimer = new GSpellTimer(5000);
         regex = new Regex("[0-9]{1,2}\\/[0-9]{1,2}$"); //matching a/b at the end of the string where a and b are integers with 1 or 2 digits
     }
     questStatus = new Dictionary<string, bool>();
 }
Exemplo n.º 32
0
        public static void RecursiveToolTip(GInterfaceObject gobj)
        {
            Thread.Sleep(150);
            if (gobj != null)
            {
                PPather.WriteLine("Tooltip{0}\t=>\t{1}", ttcount, gobj.LabelText);
                ttcount++;
                if(gobj.LabelText != null)
                    text.Add(gobj.LabelText);

                GInterfaceObject[] children = null;

                try
                {
                    children = gobj.Children;
                }
                catch
                { }

                if (children != null && children.Length > 0)
                {
                    foreach (GInterfaceObject child in children)
                    {
                        if (child != null)
                        {
                            if (child.LabelText != null)
                            {
                                PPather.WriteLine("Tooltip{0}\t=>\t{1}", ttcount, child.LabelText);
                                text.Add(child.LabelText);
                                ttcount++;
                            }
                            RecursiveToolTip(child);
                        }
                    }
                }
            }
        }
Exemplo n.º 33
0
 public static void ClickOption(GInterfaceObject btn)
 {
     if (btn != null && btn.IsVisible)
         Functions.Click(btn);
 }
Exemplo n.º 34
0
 public UIDumperTreeNode(string text, ref GInterfaceObject objectRef, bool isRoot)
     : base(text)
 {
     InitializeUIDumperTreeNode(isRoot, ref objectRef);
 }
Exemplo n.º 35
0
        private static UIDumperTreeNode[] Dumper_GetChildren(DumpUIChildrenArgs args, ref GInterfaceObject gio)
        {
            List<UIDumperTreeNode> nodes = new List<UIDumperTreeNode>();

            if (gio != null && gio.Children != null)
            {
                for (int i = 0, max = gio.Children.Length; i < max; i++)
                {
                    if (gio.Children[i] == null || (args.RootNode.OnlyVisible && !gio.Children[i].IsVisible)) continue;

                    string s = GetGIOString(ref gio.Children[i]);
                    UIDumperTreeNode node = new UIDumperTreeNode(s, ref gio.Children[i]);

                    try
                    {
                        if (!gio.Children[i].IsVisible)
                            node.ForeColor = Color.DarkGray;
                    }
                    catch
                    {
                        node.ForeColor = Color.DarkRed;
                    }

                    try
                    {
                        //PPather.WriteLine(String.Format("{0} - Child #{1}/{2}: {3}", rootName, i, max, s));
                        UIDumperTreeNode[] childNodes = Dumper_GetChildren(args, ref gio.Children[i]);

                        if (childNodes != null && childNodes.Length != 0)
                            node.Nodes.AddRange(childNodes);
                    }
                    catch (Exception e)
                    {
                        PPather.WriteLine(String.Format("Error reading child object #{1}: {0}", e.Message, i));
                        node.ForeColor = Color.DarkRed;
                    }

                    node.OnlyVisible = args.RootNode.OnlyVisible;

                    nodes.Add(node);

                    node = null;
                    s = null;
                }
            }

            return nodes.ToArray();
        }
Exemplo n.º 36
0
 public UIDumperTreeNode(string text, ref GInterfaceObject objectRef)
     : base(text)
 {
     InitializeUIDumperTreeNode(false, ref objectRef);
 }
Exemplo n.º 37
0
 public UIDumperTreeNode(string text)
     : base(text)
 {
     p_GObjectRef = null;
     InitializeUIDumperTreeNode(false);
 }
Exemplo n.º 38
0
        private static string GetGIOString(ref GInterfaceObject gio)
        {
            StringBuilder sb = new StringBuilder();
            string s = String.Empty;

            try
            {
                s = gio.ToString();

                if (!s.Contains("\"\""))
                {
                    s = s.Substring(s.IndexOf('"') + 1);
                    s = s.Substring(0, s.IndexOf('"'));
                }

                sb.Append(s);
            }
            catch (Exception e)
            {
                s = String.Empty;
                sb.Append(String.Format("<Error: {0}>", e.Message));
            }

            if (s.EndsWith("Text") || s.Contains("Button") || s.EndsWith("Label") ||
                (s.Contains("Text") && !s.Contains("Texture")))
            {
                try
                {
                    sb.Append(String.Format(": {0}", gio.LabelText));
                }
                catch (Exception e)
                {
                    sb.Append(String.Format(": <Error: {0}>", e.Message));
                }
            }

            return sb.ToString();
        }
Exemplo n.º 39
0
 public void InitializeUIDumperTreeNode(bool isRoot, ref GInterfaceObject objectRef)
 {
     InitializeUIDumperTreeNode(isRoot);
     p_GObjectRef = objectRef;
 }