コード例 #1
0
        public void UpdateClassifieds(Notifications.Mailer mailer)//Notifications.Mailer mailer)
        {
            this.GetClassifieds();

            foreach (ClassifiedInfo element in this.ClassifiedItems)
            {
                int  w    = 0;
                bool flag = true;
                while (w < Method.IDPool.Count)
                {
                    if (Method.IDPool[w] == element.itemid)
                    {
                        flag = false;
                        break;
                    }
                    else
                    {
                        flag = true;
                        w++;
                    }
                }


                if (flag)
                {
                    element.GetNames();
                    if (MemoryCache.Default.Contains(element.completename))
                    {
                        Console.WriteLine("Classifieds: " + element.completename + Environment.NewLine + "listprice: " + element.listprice + Environment.NewLine + "calc price: " + element.price + Environment.NewLine + "bp price: " + element.BPprice);
                        if (element.listprice + .5 * double.Parse(MemoryCache.Default.Get("Mann Co. Supply Crate Key").ToString()) <= double.Parse(MemoryCache.Default.Get(element.completename).ToString()))
                        {
                            if (!element.CheckDuped() && !element.CheckScammer())
                            {
                                string text = "Listprice: " + element.listprice + Environment.NewLine +
                                              "ItemName: " + element.completename + Environment.NewLine +
                                              "SteamID: " + element.steamid + Environment.NewLine +
                                              "ItemID: " + element.itemid + Environment.NewLine +
                                              "Time: " + DateTime.Now.ToString();

                                mailer.SendMail("Trade Found", text);
                                using (StreamWriter sw = new StreamWriter("Matches.txt", true))
                                {
                                    sw.WriteLine("Mail Sent: " + element.itemid);
                                }
                            }
                        }
                    }
                    Method.IDPool.Add(element.itemid);
                    while (Method.IDPool.Count > 40)
                    {
                        Method.IDPool.RemoveAt(0);
                    }
                }
            }
        }
コード例 #2
0
 public void UpdateItemIDs(Notifications.Mailer Mailer)
 {
     this.GetItemIDs();
     foreach (ClassifiedInfo item in this.ClassifiedItems)
     {
         int  w    = 0;
         bool flag = true;
         while (w < Method.IDPool.Count)
         {
             if (Method.IDPool[w] == item.itemid)
             {
                 flag = false;
                 break;
             }
             else
             {
                 flag = true;
                 w++;
             }
         }
         if (flag)
         {
             Console.WriteLine(item.completename + " | " + item.itemid);
             if (item.completename.Contains("Strange"))
             {
                 Console.Write(" MAIL ALERT");
                 Mailer.SendMail("test", item.completename + " | " + item.itemid);
             }
             Method.IDPool.Add(item.itemid);
             while (Method.NotifiedPool.Count > 40)
             {
                 Method.NotifiedPool.RemoveAt(0);
             }
         }
     }
 }