CampahApp.Interaction.TraverseMenu C# (CSharp) Method

TraverseMenu() public method

public TraverseMenu ( String address ) : bool
address String
return bool
        public bool TraverseMenu(String address)
        {
            GotoMenu(address);
            Thread.Sleep((int)CampahStatus.Instance.GlobalDelay);
            if (FFACEInstance.Instance.Menu.Selection == "Bid")
                return true;
            int max = AuctionHouse.MenuLength;

            for (int i = 1; i <= max; i++)
            {
                if (TraverseMenu(address + "," + i))
                {
                    int[] ids = ReadAHItems();
                    foreach (int id in ids)
                    {

                        var item = new AhItem(id, id.ToString(CultureInfo.InvariantCulture), false, address + "," + i);
                        if ((item = AuctionHouse.Add(item)) != null)
                        {
                            item.Stackable = true;
                        }
                    }
                    AuctionHouse.MenuIndex = 1;
                }
            }
            return false;
        }

Usage Example

Exemplo n.º 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();
        }