public static void Filter_packages(string category, string quality) { if (category == "") { category = "Wszystko"; } if (quality == "") { quality = "Normalny"; } try { Convert.ToInt32(category); category = Get.Category_packages(category); } catch { } try { Convert.ToInt32(quality); quality = Get.Quality_pack(quality); } catch { } Get.Element("//select[@name='f']//option[text() = '" + category + "']").Click(); Get.Element("//select[@name='fq']//option[text() = '" + quality + "']").Click(); Basic.Click_element("//input[@value='Filtr']"); }
public static void Sell() { if (!Settings.c_sell && !Bot.Sell_items) { return; } int category = 1; int shop = 1; while (category <= 10) { Navigation.Packages(); while (category <= 10) { Navigation.Filter_packages(Get.Category_packages(category), ""); Navigation.Backpack(Settings.b_sell); Basic.Click_if("//a[@clas='paging_button paging_right_full']"); List <IWebElement> elements = Get_items(Bot.driver.FindElementsByXPath("//div[@id='packages']//div[contains(@class,'draggable')]")); elements.Reverse(); if (elements.Count == 0) { category++; continue; } if (!Basic.Move_to_inventory(elements)) { break; } } while (true) { if (!Choose_shop(shop)) { if (!RegistryValues.Read_b("c_rubles")) { return; } else { shop = 1; } } List <IWebElement> elements = Get_items(Bot.driver.FindElementsByXPath("//div[@id='inv']//div[contains(@class,'draggable')]")); if (elements.Count == 0) { break; } if (!Basic.Move_to_shop(elements)) { break; } else { shop++; } } } }