public void Bet(BET bet) //ставим { Thread.Sleep(1200); var txtBet = driver.FindElement(By.Name("bet-size"));//находим элемент "кол-во ставки" try { txtBet.Clear(); txtBet.SendKeys(Convert.ToString(bet.rate)); } catch { } Thread.Sleep(500); var txtBetC = driver.FindElement(By.Name("cash-out"));//находим элемент "коеф на вывод" try { txtBetC.Clear(); txtBetC.SendKeys(Convert.ToString(bet.crash)); } catch { } Thread.Sleep(1000); try { var BetClick = driver.FindElement(By.XPath("//SPAN[text()='Place Bet']"));//ставим BetClick.Click(); } catch { } }
/// <summary> /// Возвращает структуру с начальными условиями /// </summary> /// <returns>Структура начальными условиями</returns> public BET GetBET() { BET bet = new BET(); bet.rate = Rate; bet.crash = Crash(Min, Max); return(bet); }
/// Платежеспособный ли игрок (может-ли он поддержать ставку) public bool isSolvent(BET bet) { if (bet.rate > bank) { return(false); } return(true);; }
public void Infinity_cheak(BET bet) //проверка на конец партии { //access = 0; try { Hash = driver.FindElement(By.XPath("(//INPUT[@type='input'])")).GetAttribute("value").ToString(); do { } while (Hash == driver.FindElement(By.XPath("(//INPUT[@type='input'])")).GetAttribute("value").ToString()); } catch { RobotLogs.Add("ERROR: Чтение HASH — " + System.DateTime.Now.ToLongTimeString()); } //access = 1; Console.WriteLine(cheak_win(bet.crash)); Thread.Sleep(500); }
public BET Processing(bool win) { BET bet = new BET(); if (win) { bank += rate * crash; rate = bet.rate = Rate; } else { bank -= rate; rate *= Coefficient; bet.rate = (int)Math.Round(rate); } crash = Crash(Min, Max); bet.crash = crash; return(bet); }
static void Main(string[] args) { Robot bot = new Robot(); Analytic analytic = null; string str = String.Empty; Console.Title = "Crash Mining Robot"; Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("bot : hi"); Thread.Sleep(600); Console.WriteLine("bot : My name is Mining RObot"); Thread.Sleep(600); Console.WriteLine("bot : Set my settings please..."); Thread.Sleep(600); Console.ForegroundColor = ConsoleColor.White; Console.Write("Bank : "); int bank = Int32.Parse(Console.ReadLine()); Console.Write("Rate : "); int rate = Int32.Parse(Console.ReadLine()); Console.Write("Coefficient multiplier : "); double coefficient = Double.Parse(Console.ReadLine()); Console.Write("Min crash : "); double min = Double.Parse(Console.ReadLine()); Console.Write("Max crash : "); double max = Double.Parse(Console.ReadLine()); analytic = new Analytic(bank, rate, coefficient, min, max); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("bot : good"); round: Console.WriteLine("bot : Do You want me to start work?"); Console.WriteLine("Y/N : "); Console.ForegroundColor = ConsoleColor.White; str = Console.ReadLine(); if (str == "Y" || str == "y") // Здесь происходит запуск работы { bot.Start(); Console.WriteLine("bot : Do You press password on website?"); Console.WriteLine("Y/N : "); str = Console.ReadLine(); if (str == "Y" || str == "y") { BET b = analytic.GetBET(); bot.Infinity_cheak(b); bot.Bet(b); while (true) { bot.Infinity_cheak(b); BET bet = analytic.Processing(bot.cheak_win(b.crash)); bot.Bet(bet); b = bet; } } /// участок кода отвечающий за обработку... } else if (str == "N" || str == "n") // Исправление невернно введенных данных { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("bot : Do You want change setting?"); Console.WriteLine("Y/N(exit) : "); Console.ForegroundColor = ConsoleColor.White; str = Console.ReadLine(); if (str == "Y" || str == "y") { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("bot : okey"); Thread.Sleep(600); Console.WriteLine("bot : enter number"); Thread.Sleep(600); Console.WriteLine("\t 1 - Bank"); Console.WriteLine("\t 2 - Rate"); Console.WriteLine("\t 3 - Coefficient multiplier"); Console.WriteLine("\t 4 - Min crash"); Console.WriteLine("\t 5 - Max crash"); Console.ForegroundColor = ConsoleColor.White; Console.Write("Number : "); int num = Int32.Parse(Console.ReadLine()); Console.Clear(); switch (num) { case 1: Console.Write("Bank : "); bank = Int32.Parse(Console.ReadLine()); analytic.Bank = bank; break; case 2: Console.Write("Rate : "); rate = Int32.Parse(Console.ReadLine()); analytic.Rate = rate; break; case 3: Console.Write("Coefficient multiplier : "); coefficient = Double.Parse(Console.ReadLine()); analytic.Coefficient = coefficient; break; case 4: Console.Write("Min crash : "); min = Double.Parse(Console.ReadLine()); analytic.Min = min; break; case 5: Console.Write("Max crash : "); max = Double.Parse(Console.ReadLine()); analytic.Max = max; break; } Console.ForegroundColor = ConsoleColor.Yellow; goto round; } else if (str == "N" || str == "n") { return; } } Console.Read(); }