Esempio n. 1
0
 private void button10_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex != 8)
     {
         string truePrice = string.Empty;
         if (textBox2.Text == string.Empty)
         {
             MessageBox.Show("Wrong Price!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
         else
         {
             truePrice = SteamLibrary.GetSweetPrice(textBox2.Text);
             if (truePrice == string.Empty)
             {
                 MessageBox.Show("WrongPrice", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
         }
         for (int i = 0; i < InvenLV.SelectedIndices.Count; i++)
         {
             var ourItem = SteamParsing.InventList[InvenLV.SelectedIndices[i]];
             ourItem.BuyPrice = truePrice;
             InvenLV.SelectedItems[i].SubItems[2].Text = SteamParsing.Currencies.GetName() + " " + textBox2.Text;
         }
     }
 }
Esempio n. 2
0
 private void textBox1_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         if (textBox1.Text != string.Empty)
         {
             textBox2.Text = SteamLibrary.DoFracture(SteamLibrary.AddFee(SteamLibrary.GetSweetPrice(textBox1.Text)));
         }
     }
     catch (Exception)
     {
     }
 }
Esempio n. 3
0
            public int ParseOnSale(string content)
            {
                InventList.Clear();
                string parseBody = Regex.Match(content, "(?<=section market_home_listing_table\">)(.*)(?=<div id=\"tabContentsMyMarketHistory)",
                                               RegexOptions.Singleline).ToString();

                MatchCollection matches = Regex.Matches(parseBody, "(?<=market_recent_listing_row listing_)(.*?)(?=	</div>\r\n</div>)",
                                                        RegexOptions.Singleline);

                if (matches.Count != 0)
                {
                    foreach (Match match in matches)
                    {
                        string currmatch = match.Groups[1].Value;

                        string ImgLink = Regex.Match(currmatch, "(?<=economy/image/)(.*)(?=/38fx38f)").ToString();

                        //If you need:
                        //string assetid = Regex.Match(currmatch, "(?<='mylisting', ')(.*)(?=\" class=\"item_market)").ToString();
                        //assetid = assetid.Substring(assetid.Length - 11, 9);

                        string listId = Regex.Match(currmatch, "(?<=mylisting_)(.*)(?=_image\" src=)").ToString();

                        string appidRaw = Regex.Match(currmatch, "(?<=market_listing_item_name_link)(.*)(?=</a></span>)").ToString();
                        string pageLnk  = Regex.Match(appidRaw, "(?<=href=\")(.*)(?=\">)").ToString();

                        string captainPrice = Regex.Match(currmatch, @"(?<=>
						)(.*)(?=					</span>
					<br>)"                    , RegexOptions.Singleline).ToString();

                        captainPrice = SteamLibrary.GetSweetPrice(Regex.Replace(captainPrice,
                                                                                Currencies.GetAscii(), string.Empty).Trim());

                        captainPrice.Insert(captainPrice.Length - 2, ".");

                        string[] LinkName = Regex.Match(currmatch, "(?<=_name_link\" href=\")(.*)(?=</a></span><br/>)").
                                            ToString().Split(new string[] { "\">" }, StringSplitOptions.None);

                        string ItemType = Regex.Match(currmatch, "(?<=_listing_game_name\">)(.*)(?=</span>)").ToString();

                        InventList.Add(new SteamLibrary.InventItem(listId, LinkName[1], ItemType, captainPrice, "0", ImgLink,
                                                                   string.Empty, true, true, pageLnk));
                    }
                }
                //else
                //TODO. Add correct error processing
                //MessageBox.Show(Strings.OnSaleErr, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);

                return(matches.Count);
            }
Esempio n. 4
0
        public void RefreshProgress(object state)
        {
            object[] parameters = state as object[];

            SteamLibrary.InventItem item = (SteamLibrary.InventItem)parameters[0];
            int index = (int)parameters[1];

            string[] split = item.PageLink.Split('/');

            SteamLibrary.StrParam priceOver = SteamParseSite.ParseItemPrice(split[7], split[6], cookieCont);

            item.MedianPrice = priceOver.P2;

            if (item.BuyPrice == "0")
            {
                item.BuyPrice = SteamLibrary.GetSweetPrice(item.MedianPrice);
            }

            doMessage(flag.InvPrice, index, item, true);
        }