CampahApp.Interaction.CloseMenu C# (CSharp) Method

CloseMenu() public method

public CloseMenu ( ) : void
return void
        public void CloseMenu()
        {
            while (FFACEInstance.Instance.Menu.IsOpen)
            {
                FFACEInstance.Instance.Windower.SendKeyPress(KeyCode.EscapeKey);
                Thread.Sleep((int)CampahStatus.Instance.GlobalDelay);
            }
            _currentAddress.Clear();
        }

Usage Example

Example #1
0
        private void CreateAhResourcesXml()
        {
            //GotoMenu("1");
            CampahStatus.SetStatus("Updating AH Database.  Please Wait...", Modes.Updating);
            AuctionHouse.Items.Clear();
            interactionManager.TraverseMenu("1");
            interactionManager.CloseMenu();
            var tw = new XmlTextWriter("ahresources.xml", null)
            {
                Formatting = Formatting.Indented
            };

            tw.WriteStartDocument();
            tw.WriteStartElement("AHStructure");
            tw.WriteComment("This XML was automatically generated by Campah.exe");
            tw.WriteComment("Editing this XML may cause Campah to no longer function properly");
            foreach (AhItem item in AuctionHouse.Items.Values)
            {
                tw.WriteStartElement("item");
                tw.WriteAttributeString("id", item.ID.ToString("X2"));
                tw.WriteAttributeString("name", item.Name);
                tw.WriteAttributeString("stackable", item.Stackable.ToString());
                tw.WriteAttributeString("address", item.Address);
                tw.WriteEndElement();
            }
            tw.WriteEndElement();
            tw.WriteEndDocument();
            tw.Flush();
            tw.Close();
            interactionManager.StopBuying("Finished Updating Successfully", CreateAhResourcesXml);
            settingsManager.loadAHResourcesXML();
        }