コード例 #1
0
ファイル: jdDesktop.cs プロジェクト: chilly2k/jdcapi
 void JD_OnRoll(Roll roll)
 {
     //Show form with bet result
 }
コード例 #2
0
ファイル: JDCAPI.cs プロジェクト: chilly2k/jdcapi
        private void ProcessDetails(string tmpstring)
        {
            string s3 = tmpstring.Replace(" ", "");
            Roll tmp = new Roll();
            string date = s3.Substring(s3.IndexOf("moment") + 8, 10);
            tmp.date = ToDateTime2(date);
            //                            tmp.date = DateTime.Parse(date);

            string id = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            id = id.Substring(id.IndexOf(">") + 1);
            tmp.betid = long.Parse(id);

            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string user = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            user = user.Substring(user.IndexOf(">") + 1);
            tmp.userid = long.Parse(user);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string multiplier = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            multiplier = multiplier.Substring(multiplier.IndexOf(">") + 1).Replace("x", "");
            tmp.multiplier = decimal.Parse(multiplier, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string stake = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            stake = stake.Substring(stake.IndexOf(">") + 1).ToLower().Replace("doge", "").Replace("btc", "").Replace(" ", "");
            tmp.stake = decimal.Parse(stake, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string profit = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            profit = profit.Substring(profit.IndexOf(">") + 1).ToLower().Replace("doge", "").Replace("btc", "").Replace(" ", "");
            tmp.profit = decimal.Parse(profit, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string chance = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            chance = chance.Substring(chance.IndexOf(">") + 1).ToLower().Replace("%", "").Replace(" ", "");
            tmp.chance = decimal.Parse(chance, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            if (s3.Contains("&gt"))
                tmp.high = true;
            else
                tmp.high = false;
            //s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string target = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            target = target.Substring(target.IndexOf(">") + 1).ToLower().Replace("%", "").Replace(" ", "");
            tmp.target = decimal.Parse(target, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string lucky = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            lucky = lucky.Substring(lucky.IndexOf(">") + 1).ToLower().Replace("%", "").Replace(" ", "");
            tmp.lucky = decimal.Parse(lucky, System.Globalization.CultureInfo.InvariantCulture);
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string result = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            result = result.Substring(result.IndexOf(">") + 1);
            tmp.result = result.Contains("lose") ? 0 : 1;
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string hash = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            hash = hash.Substring(hash.IndexOf(">") + 1);
            tmp.hash = hash;
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string server = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            server = server.Substring(server.IndexOf(">") + 1);
            tmp.server_seed = server;
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string client = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            client = client.Substring(client.IndexOf(">") + 1);
            tmp.client_seed = client;
            s3 = s3.Substring(s3.IndexOf("</span>") + 7);
            string nonce = s3.Substring(s3.IndexOf("<span>"), s3.IndexOf("</span>") - s3.IndexOf("<span>"));
            nonce = nonce.Substring(nonce.IndexOf(">") + 1).ToLower().Replace(" ", "");
            tmp.nonce = long.Parse(nonce);
            if (OnRoll != null && !logginging) OnRoll(tmp);
        }
コード例 #3
0
ファイル: JD.cs プロジェクト: bdcravens/DiceBot
        void Instance_OnRoll(Roll roll)
        {
            if (roll.server_seed != "")
            {
                sqlite_helper.InsertSeed(roll.hash, roll.server_seed);

                GettingSeed = false;
            }
        }