Ejemplo n.º 1
0
        void PlaceBetThread(object _High)
        {
            try
            {
                Lastbet = DateTime.Now;
                bool           High       = (bool)_High;
                HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://dadice.com/api/roll");
                betrequest.Method = "POST";
                string post = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "username={0}&key={1}&amount={2:0.00000000}&chance={3:00.00}&bet={4}", username, key, amount, chance, High ? "over" : "under");
                betrequest.ContentLength = post.Length;
                if (Prox != null)
                {
                    betrequest.Proxy = Prox;
                }
                betrequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
                using (var writer = new StreamWriter(betrequest.GetRequestStream()))
                {
                    writer.Write(post);
                }
                HttpWebResponse EmitResponse2  = (HttpWebResponse)betrequest.GetResponse();
                string          sEmitResponse2 = new StreamReader(EmitResponse2.GetResponseStream()).ReadToEnd();
                DADICERollBase  tmp            = json.JsonDeserialize <DADICERollBase>(sEmitResponse2);
                if (tmp.status)
                {
                    balance += (double)tmp.roll.profit;

                    ++bets;
                    ++losses;
                    profit  += (double)tmp.roll.profit;
                    wagered += (double)tmp.roll.amount;
                    ++wins;
                    LastBalance = DateTime.Now;
                    betcount    = 0;
                    Lastbet     = DateTime.Now;
                    FinishedBet(tmp.roll.ToBet());
                }
                else
                {
                    Parent.updateStatus("Bet Failed: " + tmp.error);
                }
            }
            catch (Exception E)
            {
                if (betcount++ < 3)
                {
                    PlaceBetThread(_High);
                }
                else
                {
                    Parent.updateStatus(E.Message);
                }
            }
        }
Ejemplo n.º 2
0
        void PlaceBetThread(object _High)
        {
            try
            {
                Lastbet = DateTime.Now;
                bool High = (bool)_High;
                List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >();
                pairs.Add(new KeyValuePair <string, string>("username", username));
                pairs.Add(new KeyValuePair <string, string>("key", key));
                pairs.Add(new KeyValuePair <string, string>("amount", amount.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
                pairs.Add(new KeyValuePair <string, string>("chance", chance.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
                pairs.Add(new KeyValuePair <string, string>("bet", High ? "over" : "under"));

                FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);
                DADICERollBase        tmp     = new DADICERollBase();
                using (var response = Client.PostAsync("roll", Content))
                {
                    string sEmitResponse2 = response.Result.Content.ReadAsStringAsync().Result;
                    tmp = json.JsonDeserialize <DADICERollBase>(sEmitResponse2);
                }
                if (tmp.status)
                {
                    balance += (decimal)tmp.roll.profit;

                    ++bets;
                    ++losses;
                    profit  += (decimal)tmp.roll.profit;
                    wagered += (decimal)tmp.roll.amount;
                    ++wins;
                    LastBalance = DateTime.Now;
                    betcount    = 0;
                    Lastbet     = DateTime.Now;
                    FinishedBet(tmp.roll.ToBet());
                    retrycount = 0;
                }
                else
                {
                    Parent.updateStatus("Bet Failed: " + tmp.error);
                }
            }
            catch (Exception E)
            {
                if (betcount++ < 3)
                {
                    PlaceBetThread(_High);
                }
                else
                {
                    Parent.updateStatus(E.Message);
                }
            }
        }
Ejemplo n.º 3
0
        void PlaceBetThread(object _High)
        {
            try
            {
                Lastbet = DateTime.Now;
                bool High = (bool)_High;
                List<KeyValuePair<string, string>> pairs = new List<KeyValuePair<string, string>>();
                pairs.Add(new KeyValuePair<string, string>("username",username));
                pairs.Add(new KeyValuePair<string, string>("key", key));
                pairs.Add(new KeyValuePair<string, string>("amount", amount.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
                pairs.Add(new KeyValuePair<string, string>("chance", chance.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
                pairs.Add(new KeyValuePair<string, string>("bet", High ? "over" : "under"));

                FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);
                DADICERollBase tmp = new DADICERollBase();
                using (var response = Client.PostAsync("roll", Content))
                {
                    string sEmitResponse2 = response.Result.Content.ReadAsStringAsync().Result;
                    tmp = json.JsonDeserialize<DADICERollBase>(sEmitResponse2);
                }
                if (tmp.status)
                {

                    balance += (double)tmp.roll.profit;

                    ++bets;
                    ++losses;
                    profit += (double)tmp.roll.profit;
                    wagered += (double)tmp.roll.amount;
                    ++wins;
                    LastBalance = DateTime.Now;
                    betcount = 0;
                    Lastbet = DateTime.Now;
                    FinishedBet(tmp.roll.ToBet());
                    retrycount = 0;

                }
                else
                {
                    Parent.updateStatus("Bet Failed: " + tmp.error);
                }
            }
            catch (Exception E)
            {
                if (betcount++<3)
                {
                    PlaceBetThread(_High);
                }
                else
                {

                    Parent.updateStatus(E.Message);
                }

            }
        }