public static void ClickSend() { GInterfaceObject btn = GContext.Main.Interface.GetByName("SendMailMailButton"); Functions.Click(btn, false); Thread.Sleep(200); }
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]); } } }
public static void TypeTo(string toName) { GInterfaceObject name = GContext.Main.Interface.GetByName("SendMailNameEditBox"); Functions.Click(name, false); GContext.Main.Interface.SendString(toName); }
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]); } } }
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); }
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); }
// 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); }
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); }
public static void ClickOption(GInterfaceObject btn) { if (btn != null && btn.IsVisible) { Functions.Click(btn); } }
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); }
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); }
public static void Hover(GInterfaceObject u) { if (u != null && u.IsVisible) { GContext.Main.EnableCursorHook(); u.Hover(); GContext.Main.DisableCursorHook(); } }
// 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; }
// 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; }
public static void Join() { GInterfaceObject btn = GContext.Main.Interface.GetByName("BattlefieldFrameJoinButton"); if (btn != null && btn.IsVisible) { Functions.Click(btn, false); } }
public static void SelectReward(int nr) { GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestRewardItem" + nr); if (btn != null && btn.IsVisible) { Functions.Click(btn, false); } }
public static void Complete() { GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestFrameCompleteQuestButton"); if (btn != null && btn.IsVisible) { Functions.Click(btn, false); } }
public static void Click(GInterfaceObject lbtn, bool right) { if (lbtn != null && lbtn.IsVisible) { GContext.Main.EnableCursorHook(); lbtn.ClickMouse(right); GContext.Main.DisableCursorHook(); } }
public static void Close() { GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameCloseButton"); if (btn != null && btn.IsVisible) { Functions.Click(btn); } }
public static void Goodbye() { GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameGreetingGoodbyeButton"); if (btn != null && btn.IsVisible) { Functions.Click(btn, false); } }
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 } }
// Internal frame handling private static void ToggleFrame() { GInterfaceObject micro = GContext.Main.Interface.GetByName(cBUTTON); if (micro.IsVisible) { Functions.Click(micro, false); Thread.Sleep(500); } }
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); }
public static bool IsJoin() { GInterfaceObject btn = GContext.Main.Interface.GetByName("BattlefieldFrameJoinButton"); if (btn != null && btn.IsVisible) { return(true); } return(false); }
public static bool CanSend() { GInterfaceObject btn = GContext.Main.Interface.GetByName("SendMailMailButton"); if (!btn.IsVisible) { return(false); } return(true); }
public static bool IsComplete() { GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestFrameCompleteQuestButton"); if (btn != null && btn.IsVisible) { return(true); } return(false); }
public static bool IsVisible() { GInterfaceObject obj = GetFrame(); if (obj != null && obj.IsVisible) { return(true); } return(false); }
public static bool IsGoodbye() { GInterfaceObject btn = GContext.Main.Interface.GetByName("GossipFrameGreetingGoodbyeButton"); if (btn != null && btn.IsVisible) { return(true); } return(false); }
public static bool IsSelect() { GInterfaceObject btn = GContext.Main.Interface.GetByName("QuestTitleButton1"); if (btn != null && btn.IsVisible) { return(true); } return(false); }
public static void RightClick() { GInterfaceObject obj = GetFrame(); if (obj != null && obj.IsVisible) { Functions.Hover(obj); Functions.Click(obj, true); } }
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>(); }
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); } } } } }
public static void ClickOption(GInterfaceObject btn) { if (btn != null && btn.IsVisible) Functions.Click(btn); }
public UIDumperTreeNode(string text, ref GInterfaceObject objectRef, bool isRoot) : base(text) { InitializeUIDumperTreeNode(isRoot, ref objectRef); }
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(); }
public UIDumperTreeNode(string text, ref GInterfaceObject objectRef) : base(text) { InitializeUIDumperTreeNode(false, ref objectRef); }
public UIDumperTreeNode(string text) : base(text) { p_GObjectRef = null; InitializeUIDumperTreeNode(false); }
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(); }
public void InitializeUIDumperTreeNode(bool isRoot, ref GInterfaceObject objectRef) { InitializeUIDumperTreeNode(isRoot); p_GObjectRef = objectRef; }