diff --git a/scr/SCMBot/Main.Designer.cs b/scr/SCMBot/Main.Designer.cs index 8c6313e..68282dd 100644 --- a/scr/SCMBot/Main.Designer.cs +++ b/scr/SCMBot/Main.Designer.cs @@ -338,6 +338,7 @@ private void InitializeComponent() // resources.ApplyResources(this.scanGroupBox, "scanGroupBox"); this.scanGroupBox.Controls.Add(this.splitContainer3); + this.scanGroupBox.MinimumSize = new System.Drawing.Size(0, 237); this.scanGroupBox.Name = "scanGroupBox"; this.scanGroupBox.TabStop = false; // @@ -524,7 +525,7 @@ private void InitializeComponent() this.groupBox4.Controls.Add(this.label11); this.groupBox4.Controls.Add(this.pictureBox1); this.groupBox4.Controls.Add(this.searchButton); - this.groupBox4.MinimumSize = new System.Drawing.Size(300, 109); + this.groupBox4.MinimumSize = new System.Drawing.Size(300, 50); this.groupBox4.Name = "groupBox4"; this.groupBox4.TabStop = false; // @@ -690,7 +691,7 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.label4); this.groupBox3.Controls.Add(this.pictureBox3); this.groupBox3.Controls.Add(this.textBox1); - this.groupBox3.MinimumSize = new System.Drawing.Size(300, 150); + this.groupBox3.MinimumSize = new System.Drawing.Size(300, 50); this.groupBox3.Name = "groupBox3"; this.groupBox3.TabStop = false; // @@ -704,6 +705,7 @@ private void InitializeComponent() resources.GetString("filterTypeBox.Items2")}); resources.ApplyResources(this.filterTypeBox, "filterTypeBox"); this.filterTypeBox.Name = "filterTypeBox"; + this.filterTypeBox.SelectedIndexChanged += new System.EventHandler(this.filterTypeBox_SelectedIndexChanged); // // label18 // @@ -996,10 +998,14 @@ private void InitializeComponent() this.Controls.Add(this.groupBox2); this.Controls.Add(this.label15); this.Controls.Add(this.DonateBox); + this.DoubleBuffered = true; this.Name = "Main"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); this.Load += new System.EventHandler(this.Main_Load); this.Shown += new System.EventHandler(this.Main_Shown); + this.ResizeEnd += new System.EventHandler(this.Main_ResizeEnd); + this.LocationChanged += new System.EventHandler(this.Main_LocationChanged); + this.Resize += new System.EventHandler(this.Main_Resize); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); diff --git a/scr/SCMBot/Main.cs b/scr/SCMBot/Main.cs index 307d795..89e0125 100644 --- a/scr/SCMBot/Main.cs +++ b/scr/SCMBot/Main.cs @@ -24,7 +24,7 @@ namespace SCMBot public partial class Main : Form { public static SteamSite steam_srch = new SteamSite(); - SearchPagePos sppos; + private SearchPagePos sppos; string lastSrch; int lastSelec = -1; bool addonComplete = false; @@ -38,17 +38,18 @@ public partial class Main : Form static public Semaphore reqPool; - ScanItemList scanItems = new ScanItemList(); + private ScanItemList scanItems = new ScanItemList(); - SettingsFrm settingsForm = new SettingsFrm(); - GraphFrm graphFrm = new GraphFrm(); + private SettingsFrm settingsForm = new SettingsFrm(); + private GraphFrm graphFrm = new GraphFrm(); Properties.Settings settings = Properties.Settings.Default; - ImageList StatImgLst; - List filteredInvList = new List(); - + private ImageList StatImgLst; + private List filteredInvList = new List(); + private Size lastFrmSize; + private Point lastFrmPos; public Main() { @@ -165,6 +166,21 @@ private void LoadSettings(bool loadtabs) splitContainer1.Panel2Collapsed = settings.hideInvent; minimizeOnClosingToolStripMenuItem.Checked = settings.minOnClose; + if (settings.formParams == null) + { + settings.formParams = new MainFormParams(this.Size, this.Location, this.WindowState, + splitContainer1.SplitterDistance, splitContainer2.SplitterDistance, splitContainer3.SplitterDistance); + } + else + { + this.Size = settings.formParams.FrmSize; + this.Location = settings.formParams.Location; + this.WindowState = settings.formParams.FrmState; + splitContainer1.SplitterDistance = settings.formParams.Split1; + splitContainer2.SplitterDistance = settings.formParams.Split2; + splitContainer3.SplitterDistance = settings.formParams.Split3; + } + if (!String.IsNullOrEmpty(settings.Language)) { settingsForm.intLangComboBox.SelectedValue = settings.Language; @@ -235,6 +251,10 @@ private void SaveSettings(bool savetabs) settings.Language = settingsForm.intLangComboBox.SelectedItem.ToString(); + settings.formParams = new MainFormParams(lastFrmSize, lastFrmPos, this.WindowState, + splitContainer1.SplitterDistance, splitContainer2.SplitterDistance, splitContainer3.SplitterDistance); + + splitContainer1.Panel2Collapsed = settings.hideInvent; label3.Text = string.Format("({0})", settings.lastLogin); @@ -367,14 +387,13 @@ private void LoadRecent(saveTabLst lst) - public void GetAccInfo(string mess) + public void GetAccInfo(StrParam mess) { - if (mess != string.Empty) + if (mess != null) { - string[] accinfo = mess.Split('|'); - StartLoadImgTread(accinfo[2], pictureBox2); - label5.Text = accinfo[1]; - label10.Text = accinfo[0]; + StartLoadImgTread(mess.P3, pictureBox2); + label5.Text = mess.P2; + label10.Text = mess.P1; ProgressBar1.Visible = false; SetButton(loginButton, Strings.Logout, 2); buyNowButton.Enabled = true; @@ -418,22 +437,24 @@ private void AddToScanLog(string message, int scanId, byte color, bool addcurr, } - public void Event_Message(object sender, string message, int searchId, flag myflag, bool isMain) + public void Event_Message(object sender, object data, int searchId, flag myflag, bool isMain) { + string message = data.ToString(); + switch (myflag) { case flag.Already_logged: AddtoLog(Strings.AlreadyLogged); StatusLabel1.Text = Strings.AlreadyLogged; - GetAccInfo(message); + GetAccInfo((StrParam)data); break; case flag.Login_success: relog = false; AddtoLog(Strings.LoginSucc); StatusLabel1.Text = Strings.LoginSucc; - GetAccInfo(message); + GetAccInfo((StrParam)data); break; case flag.Login_cancel: @@ -527,14 +548,14 @@ public void Event_Message(object sender, string message, int searchId, flag myfl break; case flag.SetHeadName: - string[] newInfo = message.Split(';'); + var info = (StrParam)data; var item = scanItems[searchId].Steam.scanInput; - item.Name = newInfo[0]; - item.ImgLink = newInfo[1]; + item.Name = info.P1; + item.ImgLink = info.P2; - scanListView.Items[searchId].SubItems[1].Text = newInfo[0]; + scanListView.Items[searchId].SubItems[1].Text = info.P1; SetColumnWidths(scanListView, true); if (scanListView.SelectedIndices[0] == searchId) @@ -593,11 +614,15 @@ public void Event_Message(object sender, string message, int searchId, flag myfl break; case flag.InvPrice: - string sweet = MainScanItem.LogItem.DoFracture(message); - InventoryList.Items[searchId].SubItems[3].Text = sweet; - filteredInvList[searchId].Price = message; - textBox1.Text = sweet; + var lowprice = ((StrParam)data).P1; + InventoryList.Items[searchId].SubItems[3].Text = lowprice; + filteredInvList[searchId].Price = SteamSite.GetSweetPrice(lowprice); + textBox1.Text = lowprice; textBox1.ReadOnly = false; + + //sold in the last 24 hours + //((StrParam)data).P2; + break; case flag.ActPrice: string sweet2 = MainScanItem.LogItem.DoFracture(message); @@ -705,8 +730,9 @@ public void Event_Message(object sender, string message, int searchId, flag myfl break; case flag.Inventory_Loaded: - InventoryList.Items.Clear(); - filteredInvList = new List(steam_srch.inventList); + + + SetInvFilter(); label4.Text = filteredInvList.Count.ToString(); button1.Enabled = true; @@ -733,6 +759,8 @@ public void Event_Message(object sender, string message, int searchId, flag myfl private void FillInventoryList() { + InventoryList.Items.Clear(); + for (int i = 0; i < filteredInvList.Count; i++) { var ourItem = filteredInvList[i]; @@ -753,6 +781,35 @@ private void FillInventoryList() SetColumnWidths(InventoryList, true); } + private void SetInvFilter() + { + filteredInvList.Clear(); + + if (textBox2.Text == string.Empty) + { + filteredInvList = new List(steam_srch.inventList); + } + else + { + switch (filterTypeBox.SelectedIndex) + { + case 0: + filteredInvList = steam_srch.inventList.Where(x => (x.Type.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); + break; + case 1: + filteredInvList = steam_srch.inventList.Where(x => (x.Name.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); + break; + case 2: + filteredInvList = steam_srch.inventList.Where(x => (x.Price.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); + break; + + default: + filteredInvList = new List(steam_srch.inventList); + break; + } + } + } + public static void GetDownLbox(ListBox lbox) { @@ -1179,9 +1236,9 @@ private void splitContainer2_Paint(object sender, PaintEventArgs e) int x1 = 5; int x2 = s.Width - 5; int y1 = s.SplitterDistance; - int y2 = y1 + 3; - e.Graphics.DrawLine(Pens.Silver, x1, y1, x2, y1); - e.Graphics.DrawLine(Pens.Silver, x1, y2, x2, y2); + Pen silverPen = new Pen(Color.Silver, 4); + + e.Graphics.DrawLine(silverPen, x1, y1, x2, y1); } } @@ -1194,9 +1251,10 @@ private void splitContainer3_Paint(object sender, PaintEventArgs e) int x1 = 5; int x2 = s.Height - 5; int y1 = s.SplitterDistance; - int y2 = y1 + 3; - e.Graphics.DrawLine(Pens.Silver, y1, x1, y1, x2); - e.Graphics.DrawLine(Pens.Silver, y2, x1, y2, x2); + + Pen silverPen = new Pen(Color.Silver, 4); + + e.Graphics.DrawLine(silverPen, y1, x1, y1, x2); } } @@ -2054,8 +2112,7 @@ private void InventoryList_SelectedIndexChanged(object sender, EventArgs e) { if (settings.loadActual) { - var url = string.Format("{0}{1}/{2}/render/", SteamSite._lists, SteamSite.GetUrlApp(steam_srch.invApp, false).App, Uri.EscapeDataString(ourItem.MarketName)); - steam_srch.GetPriceTread(url, lit.Index, true); + steam_srch.GetPriceTread(SteamSite.GetUrlApp(steam_srch.invApp, false).App, Uri.EscapeDataString(ourItem.MarketName), lit.Index, true); textBox1.Text = Strings.Loading; textBox1.ReadOnly = true; } @@ -2085,12 +2142,12 @@ private void resellComboBox_SelectedIndexChanged(object sender, EventArgs e) if (isFirstTab) { var ourItem = scanItems[scanListView.SelectedIndices[0]].Steam.scanInput; - steam_srch.GetPriceTread(ourItem.Link, scanListView.SelectedIndices[0], false); + //steam_srch.GetPriceTread(ourItem.Link, scanListView.SelectedIndices[0], false); } else { var ourItem = steam_srch.recentInputList[recentListView.SelectedIndices[0]]; - steam_srch.GetPriceTread(ourItem.Link, recentListView.SelectedIndices[0], false); + // steam_srch.GetPriceTread(ourItem.Link, recentListView.SelectedIndices[0], false); } resellPriceBox.Text = Strings.Loading; @@ -2308,35 +2365,8 @@ private void textBox2_TextChanged(object sender, EventArgs e) { if (steam_srch.Logged && steam_srch.inventList.Count != 0) { - filteredInvList.Clear(); - InventoryList.Items.Clear(); - - if (textBox2.Text == string.Empty) - { - filteredInvList = new List(steam_srch.inventList); - } - else - { - switch (filterTypeBox.SelectedIndex) - { - case 0: - filteredInvList = steam_srch.inventList.Where(x => (x.Type.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); - break; - case 1: - filteredInvList = steam_srch.inventList.Where(x => (x.Name.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); - break; - case 2: - filteredInvList = steam_srch.inventList.Where(x => (x.Price.StartsWith(textBox2.Text, StringComparison.OrdinalIgnoreCase))).ToList(); - break; - - default: - filteredInvList = new List(steam_srch.inventList); - break; - } - } - + SetInvFilter(); FillInventoryList(); - } } @@ -2397,5 +2427,34 @@ private void recentListView_DragDrop(object sender, DragEventArgs e) } + private void filterTypeBox_SelectedIndexChanged(object sender, EventArgs e) + { + textBox2_TextChanged(sender, e); + } + + private void Main_LocationChanged(object sender, EventArgs e) + { + if (this.WindowState == FormWindowState.Normal) + { + lastFrmPos = this.Location; + } + } + + private void Main_ResizeEnd(object sender, EventArgs e) + { + if (this.WindowState == FormWindowState.Normal) + { + lastFrmSize = this.Size; + } + } + + private void Main_Resize(object sender, EventArgs e) + { + splitContainer1.Refresh(); + splitContainer2.Refresh(); + splitContainer3.Refresh(); + } + + } } diff --git a/scr/SCMBot/Main.resx b/scr/SCMBot/Main.resx index 4c20337..d783bf4 100644 --- a/scr/SCMBot/Main.resx +++ b/scr/SCMBot/Main.resx @@ -137,25 +137,6 @@ Horizontal - - - True - - - NoControl - - - 33, 12 - - - 34, 13 - - - 64 - - - Name - NameLabel @@ -168,27 +149,6 @@ 0 - - NoControl - - - 12, 186 - - - 95, 26 - - - 56 - - - Copy - - - MiddleRight - - - ImageBeforeText - button3 @@ -201,15 +161,6 @@ 1 - - 84, 9 - - - 126, 20 - - - 63 - nameTextBox @@ -222,24 +173,6 @@ 2 - - True - - - NoControl - - - 9, 36 - - - 63, 13 - - - 54 - - - Link to Item - label14 @@ -252,15 +185,6 @@ 3 - - 84, 33 - - - 126, 20 - - - 50 - linkTextBox @@ -273,27 +197,6 @@ 4 - - NoControl - - - 115, 186 - - - 96, 26 - - - 52 - - - Start - - - MiddleRight - - - ImageBeforeText - scanButton @@ -306,24 +209,6 @@ 5 - - 84, 81 - - - 0000000 - - - - - - 56, 20 - - - 57 - - - 3000 - delayTextBox @@ -336,24 +221,6 @@ 6 - - True - - - NoControl - - - 2, 60 - - - 68, 13 - - - 52 - - - Wished Price - label9 @@ -366,24 +233,6 @@ 7 - - True - - - NoControl - - - 11, 107 - - - 71, 17 - - - 55 - - - buy qty.: - buyCheckBox @@ -396,21 +245,6 @@ 8 - - NoControl - - - 145, 57 - - - 64, 64 - - - CenterImage - - - 59 - pictureBox4 @@ -423,75 +257,886 @@ 9 - - 137, 19 + + ExtraGroup - - 55, 20 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 2 + + panel1 - - resellPriceBox + + 10 - + + wishpriceBox + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ExtraGroup + + panel1 - - 0 + + 11 - - True + + label12 - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 102, 22 + + panel1 - - 33, 13 + + 12 - - 1 + + buyUpDown - - Value + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label7 + + panel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 13 - - ExtraGroup + + 8, 15 - - 1 + + 213, 212 - - Without resell + + + 65 - - Set markup + + panel1 - - Your price + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 6, 19 + + splitContainer2.Panel1 - - 91, 21 + + 0 - + + Top, Bottom, Left, Right + + + splitContainer3 + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scanGroupBox + + + 0 + + + 6, 1 + + + 775, 237 + + + 63 + + + Scan Items + + + scanGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer2.Panel1 + + + 1 + + + splitContainer2.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer2 + + + 0 + + + Top, Bottom, Left, Right + + + nextButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 0 + + + searchBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 1 + + + FoundList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 2 + + + buyNowButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 3 + + + addtoScan + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 4 + + + prevButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 5 + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 6 + + + label11 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 7 + + + pictureBox1 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 8 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 9 + + + 6, 3 + + + 776, 204 + + + 40 + + + Find Item + + + groupBox4 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer2.Panel2 + + + 0 + + + splitContainer2.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer2 + + + 1 + + + 791, 459 + + + 245 + + + 51 + + + splitContainer2 + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1.Panel1 + + + 0 + + + splitContainer1.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1 + + + 0 + + + 330 + + + Top, Bottom, Left, Right + + + filterTypeBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 0 + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 1 + + + textBox2 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 2 + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 3 + + + sellDelayBox + + + System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 4 + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 5 + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 6 + + + button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 7 + + + InventoryList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 8 + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 9 + + + SellButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 10 + + + comboBox3 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 11 + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 12 + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 13 + + + pictureBox3 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 14 + + + textBox1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 15 + + + 6, 3 + + + 778, 244 + + + 49 + + + My Inventory + + + groupBox3 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1.Panel2 + + + 0 + + + splitContainer1.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1 + + + 1 + + + 130 + + + 794, 719 + + + 465 + + + 50 + + + splitContainer1 + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + True + + + NoControl + + + 33, 12 + + + 34, 13 + + + 64 + + + Name + + + NameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + NoControl + + + 12, 186 + + + 95, 26 + + + 56 + + + Copy + + + MiddleRight + + + ImageBeforeText + + + button3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + 84, 9 + + + 126, 20 + + + 63 + + + nameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 2 + + + True + + + NoControl + + + 9, 36 + + + 63, 13 + + + 54 + + + Link to Item + + + label14 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 3 + + + 84, 33 + + + 126, 20 + + + 50 + + + linkTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 4 + + + NoControl + + + 115, 186 + + + 96, 26 + + + 52 + + + Start + + + MiddleRight + + + ImageBeforeText + + + scanButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 5 + + + 84, 81 + + + 0000000 + + + + + + 56, 20 + + + 57 + + + 3000 + + + delayTextBox + + + System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 6 + + + True + + + NoControl + + + 2, 60 + + + 68, 13 + + + 52 + + + Wished Price + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 7 + + + True + + + NoControl + + + 11, 107 + + + 71, 17 + + + 55 + + + buy qty.: + + + buyCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 8 + + + NoControl + + + 145, 57 + + + 64, 64 + + + CenterImage + + + 59 + + + pictureBox4 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 9 + + + resellPriceBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ExtraGroup + + 0 + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ExtraGroup + + + 1 + resellComboBox @@ -528,278 +1173,179 @@ 10 - - 84, 57 + + 137, 19 - - 56, 20 + + 55, 20 - - 53 + + 2 - - wishpriceBox + + resellPriceBox - + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel1 + + ExtraGroup - - 11 + + 0 - + True - + NoControl - - 33, 84 + + 102, 22 - - 34, 13 + + 33, 13 - - 56 + + 1 - - Delay + + Value - - label12 + + label7 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel1 - - - 12 - - - 84, 105 - - - 56, 20 - - - 60 - - - buyUpDown - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 13 + + ExtraGroup - - 8, 15 + + 1 - - 213, 212 + + Without resell - - 65 + + Set markup - - panel1 + + Your price - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 6, 19 - - splitContainer2.Panel1 + + 91, 21 - + 0 - - Top, Bottom, Left, Right - - - Top, Bottom, Left, Right - - - 218, 14 - - - Top, Bottom, Left, Right - - - Top, Bottom, Left, Right - - - Status - - - 52 - - - Name - - - 116 - - - Wished Price - - - 123 - - - 415, 14 - - - 153, 22 - - - Delete - - - 153, 22 - - - Start Selected - - - 153, 22 - - - Stop Selected - - - 153, 22 - - - Start All - - - 153, 22 - - - Stop All - - - 154, 114 - - - contextMenuStrip3 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 0 - - - 383, 183 + + resellComboBox - - 63 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - scanListView + + ExtraGroup - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2 - - tabPage1 + + 84, 57 - - 0 + + 56, 20 - - 4, 22 + + 53 - - 3, 3, 3, 3 + + wishpriceBox - - 384, 183 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + panel1 - - Item Page + + 11 - - tabPage1 + + True - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl - - tabControl1 + + 33, 84 - - 0 + + 34, 13 - - Top, Bottom, Left, Right + + 56 - - Status + + Delay - - 52 + + label12 - - Name + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 116 + + panel1 - - Wished Price + + 12 - - 123 + + 84, 105 - - 0, 0 + + 56, 20 - - 383, 183 + + 60 - - 64 + + buyUpDown - - recentListView + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + panel1 - - tabPage2 + + 13 - - 0 + + Top, Bottom, Left, Right - - 4, 22 + + 218, 14 - - 3, 3, 3, 3 + + Top, Bottom, Left, Right - - 384, 183 + + tabPage1 - - 1 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Newly Listed + + tabControl1 + + + 0 tabPage2 @@ -817,7 +1363,7 @@ 1, 1 - 392, 209 + 412, 212 66 @@ -853,10 +1399,10 @@ NoControl - 2, 186 + 2, 189 - 152, 24 + 129, 24 65 @@ -892,7 +1438,7 @@ 2, 0 - 152, 186 + 129, 189 64 @@ -918,69 +1464,234 @@ splitContainer3 - + + 1 + + + 549, 213 + + + 414 + + + 65 + + + splitContainer3 + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scanGroupBox + + + 0 + + + scanListView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage1 + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 404, 186 + + + 0 + + + Item Page + + + tabPage1 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl1 + + + 0 + + + Top, Bottom, Left, Right + + + Status + + + 52 + + + Name + + + 116 + + + Wished Price + + + 123 + + + 415, 14 + + + 154, 114 + + + contextMenuStrip3 + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0, 0 + + + 403, 186 + + + 63 + + + scanListView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage1 + + + 0 + + + 153, 22 + + + Delete + + + 153, 22 + + + Start Selected + + + 153, 22 + + + Stop Selected + + + 153, 22 + + + Start All + + + 153, 22 + + + Stop All + + + recentListView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage2 + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 404, 186 + + 1 - - 549, 210 + + Newly Listed - - 391 + + tabPage2 - - 65 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - splitContainer3 + + tabControl1 - - System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - - scanGroupBox + + Top, Bottom, Left, Right - - 0 + + Status - - 6, 1 + + 52 - - 775, 234 + + Name - - 63 + + 116 - - Scan Items + + Wished Price - - scanGroupBox + + 123 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 0 - - splitContainer2.Panel1 + + 403, 186 - - 1 + + 64 - - splitContainer2.Panel1 + + recentListView - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - splitContainer2 + + tabPage2 - + 0 - - Top, Bottom, Left, Right - False @@ -1044,6 +1755,27 @@ Top, Bottom, Left, Right + + 7, 78 + + + 761, 120 + + + 53 + + + FoundList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox4 + + + 2 + @@ -1074,27 +1806,6 @@ 149 - - 7, 78 - - - 761, 123 - - - 53 - - - FoundList - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 2 - Top, Right @@ -1143,30 +1854,6 @@ 21, 17 - - 204, 22 - - - Checked to Selected Tab - - - 204, 22 - - - Checked to Both Tabs - - - 204, 22 - - - Full Set - - - 204, 22 - - - EmptyTab - 205, 92 @@ -1215,6 +1902,30 @@ 4 + + 204, 22 + + + Checked to Selected Tab + + + 204, 22 + + + Checked to Both Tabs + + + 204, 22 + + + Full Set + + + 204, 22 + + + EmptyTab + False @@ -1377,81 +2088,6 @@ 9 - - 6, 3 - - - 776, 207 - - - 40 - - - Find Item - - - groupBox4 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer2.Panel2 - - - 0 - - - splitContainer2.Panel2 - - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer2 - - - 1 - - - 791, 459 - - - 242 - - - 51 - - - splitContainer2 - - - System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer1.Panel1 - - - 0 - - - splitContainer1.Panel1 - - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer1 - - - 0 - - - 191 - - - Top, Bottom, Left, Right - Type @@ -1683,8 +2319,29 @@ 7 - - Top, Bottom, Left, Right + + Top, Bottom, Left, Right + + + 6, 79 + + + 764, 159 + + + 51 + + + InventoryList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 8 @@ -1710,27 +2367,6 @@ 96 - - 6, 79 - - - 764, 159 - - - 51 - - - InventoryList - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 8 - True @@ -1956,63 +2592,6 @@ 15 - - 6, 3 - - - 778, 244 - - - 49 - - - My Inventory - - - groupBox3 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer1.Panel2 - - - 0 - - - splitContainer1.Panel2 - - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - splitContainer1 - - - 1 - - - 794, 719 - - - 465 - - - 50 - - - splitContainer1 - - - System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - True @@ -2106,6 +2685,54 @@ Top, Left, Right + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + pictureBox2 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 1 + + + 97, 3 + + + 590, 64 + + + 36 + + + Account Info + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + True @@ -2163,66 +2790,12 @@ 1 - - 97, 3 - - - 590, 64 - - - 36 - - - Account Info - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - 163, 22 264, 21 - - 166, 22 - - - Minimize on close - - - 166, 22 - - - Settings - - - 166, 22 - - - Help - - - 166, 22 - - - About... - - - 166, 22 - - - Exit - 167, 114 @@ -2371,6 +2944,36 @@ True + + 166, 22 + + + Minimize on close + + + 166, 22 + + + Settings + + + 166, 22 + + + Help + + + 166, 22 + + + About... + + + 166, 22 + + + Exit + True @@ -2440,27 +3043,6 @@ None - - False - - - None - - - 17, 17 - - - 38, 17 - - - Ready - - - 100, 16 - - - False - 0, 789 @@ -2485,6 +3067,27 @@ 3 + + False + + + None + + + 17, 17 + + + 38, 17 + + + Ready + + + 100, 16 + + + False + Top, Right @@ -2694,7 +3297,7 @@ - 560, 709 + 620, 700 CenterScreen diff --git a/scr/SCMBot/MainUtils.cs b/scr/SCMBot/MainUtils.cs index ea417a1..168c335 100644 --- a/scr/SCMBot/MainUtils.cs +++ b/scr/SCMBot/MainUtils.cs @@ -17,7 +17,7 @@ namespace SCMBot { - public delegate void eventDelegate(object sender, string message, int searchId, flag myflag, bool isMain); + public delegate void eventDelegate(object sender, object data, int searchId, flag myflag, bool isMain); [Flags] public enum flag : byte @@ -542,6 +542,49 @@ public void StartCmdLine(string process, string param, bool wait) } + public class StrParam + { + public StrParam(string p1, string p2) + { + this.P1 = p1; + this.P2 = p1; + } + + public StrParam(string p1, string p2, string p3) + { + this.P1 = p1; + this.P2 = p2; + this.P3 = p3; + } + + public string P1 { set; get; } + public string P2 { set; get; } + public string P3 { set; get; } + } + + [Serializable] + public class MainFormParams + { + public MainFormParams(Size size, Point location, FormWindowState state, int split1, int split2, int split3) + { + this.FrmSize = size; + this.Location = location; + this.FrmState = state; + + //Сплит - хуесос. Hello, Joyreactor! + this.Split1 = split1; + this.Split2 = split2; + this.Split3 = split3; + } + + public Size FrmSize { set; get; } + public Point Location { set; get; } + public FormWindowState FrmState { set; get; } + public int Split1 { set; get; } + public int Split2 { set; get; } + public int Split3 { set; get; } + } + [Serializable] public class saveTabLst : List { diff --git a/scr/SCMBot/Properties/Settings.Designer.cs b/scr/SCMBot/Properties/Settings.Designer.cs index 30fe118..d8c7b07 100644 --- a/scr/SCMBot/Properties/Settings.Designer.cs +++ b/scr/SCMBot/Properties/Settings.Designer.cs @@ -141,6 +141,23 @@ public string lastPass { } } + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))] + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + //Fucking important! + [global::System.Configuration.SettingsSerializeAs(System.Configuration.SettingsSerializeAs.Binary)] + public global::SCMBot.MainFormParams formParams + { + get + { + return ((global::SCMBot.MainFormParams)(this["formParams"])); + } + set + { + this["formParams"] = value; + } + } + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))] [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] diff --git a/scr/SCMBot/SteamSite.cs b/scr/SCMBot/SteamSite.cs index f5b4f48..02dd150 100644 --- a/scr/SCMBot/SteamSite.cs +++ b/scr/SCMBot/SteamSite.cs @@ -5,6 +5,7 @@ using System.Threading; using Newtonsoft.Json; using System.Collections.Generic; +using System.Text.RegularExpressions; namespace SCMBot { @@ -213,25 +214,32 @@ public void ItemSell() } - public void GetPriceTread(string url, int pos, bool isInv) + public void GetPriceTread(string appid, string markname, int pos, bool isInv) { ThreadStart threadStart = delegate() { - - var tempLst = new List(); + try + { + var priceOver = JsonConvert.DeserializeObject(SendGet(string.Format(priceOverview, appid, markname), cookieCont)); - ParseLotList(SendGet(UrlForRender(url), cookieCont), tempLst, currencies, false); + if (priceOver.Success) + { + var fl = flag.ActPrice; + if (isInv) + fl = flag.InvPrice; - if (tempLst.Count != 0) - { - var fl = flag.ActPrice; + var low_clean = Regex.Replace(priceOver.Lowest, currencies.GetAscii(), string.Empty).Trim(); - if (isInv) - fl = flag.InvPrice; + doMessage(fl, pos, new StrParam(low_clean, priceOver.Volume), true); + } - doMessage(fl, pos, tempLst[0].Price.ToString(), true); } + catch (Exception) + { + Main.AddtoLog("Error loading price for: " + markname); + } + }; Thread pTh = new Thread(threadStart); pTh.IsBackground = true; @@ -340,9 +348,9 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) LoginProgr("10"); - string accInfo = GetNameBalance(cookieCont, currencies); + var accInfo = GetNameBalance(cookieCont, currencies); - if (accInfo != string.Empty) + if (accInfo != null) { doMessage(flag.Already_logged, 0, accInfo, true); doMessage(flag.Rep_progress, 0, "100", true); @@ -467,7 +475,8 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) if (rFinal.Success && rFinal.isComplete) { //Okay - string accInfo2 = GetNameBalance(cookieCont, currencies); + var accInfo2 = GetNameBalance(cookieCont, currencies); + doMessage(flag.Login_success, 0, accInfo2, true); LoginProgr("100"); diff --git a/scr/SCMBot/SteamUtils.cs b/scr/SCMBot/SteamUtils.cs index 47e6ffd..5890049 100644 --- a/scr/SCMBot/SteamUtils.cs +++ b/scr/SCMBot/SteamUtils.cs @@ -64,6 +64,7 @@ public partial class SteamSite public const string searchPageReq = "{0}&start={1}0"; public const string recentMarket = _market + "recent/"; + public const string priceOverview = _market + "priceoverview/?appid={0}&market_hash_name={1}"; //================================ Consts ======================= End =============================================== @@ -437,11 +438,23 @@ public class SearchBody [JsonProperty("total_count")] public string TotalCount { get; set; } } + + public class PriceOverview + { + [JsonProperty("success")] + public bool Success { get; set; } + [JsonProperty("lowest_price")] + public string Lowest { get; set; } + [JsonProperty("volume")] + public string Volume { get; set; } + [JsonProperty("median_price")] + public string Median { get; set; } + } //End JSON - protected void doMessage(flag myflag, int searchId, string message, bool isMain) + protected void doMessage(flag myflag, int searchId, object message, bool isMain) { try { @@ -624,7 +637,7 @@ public static AppType GetUrlApp(int appIndx, bool isGetInv) - public string GetNameBalance(CookieContainer cock, CurrInfoLst currLst) + public StrParam GetNameBalance(CookieContainer cock, CurrInfoLst currLst) { Main.AddtoLog("Getting account name and balance..."); string markpage = SendGet(_market, cock); @@ -637,7 +650,7 @@ public string GetNameBalance(CookieContainer cock, CurrInfoLst currLst) if (parseName == "") { - return string.Empty; + return null; } //accName = parseName; @@ -650,9 +663,9 @@ public string GetNameBalance(CookieContainer cock, CurrInfoLst currLst) string parseAmount = Regex.Match(markpage, "(?<=marketWalletBalanceAmount\">)(.*)(?=)").ToString(); currLst.GetType(parseAmount); - parseAmount = currLst.ReplaceAscii(parseAmount); - return string.Format("{0}|{1}|{2}", parseName, parseAmount, parseImg); + + return new StrParam(parseName, parseAmount, parseImg); } @@ -785,7 +798,7 @@ public byte ParseLotList(string content, List lst, CurrInfoLst currLst //Damn, Mr.Crowley... WTF!? if (NotSetHead && !full) { - doMessage(flag.SetHeadName, scanID, ourItemInfo.name + ";" + ourItemInfo.icon_url, true); + doMessage(flag.SetHeadName, scanID, new StrParam(ourItemInfo.name, ourItemInfo.icon_url), true); scanInput.Name = ourItemInfo.name; NotSetHead = false; } @@ -914,23 +927,17 @@ public int ParseInventory(string content) if (!ourItem.Marketable) price = "1"; - //Careful, this action takes time! - //string cont = GetRequest(_lists + GetUrlApp(invApp, false).App + "/" + ourItem.MarketName, cookieCont); - //var tempLst = new List(); - //ParseLotList(cont, tempLst, currencies); - //if (tempLst.Count != 0) - // price = tempLst[0].Price; - //fix for special symbols in Item Name string markname = string.Empty; - //BattleBlock Theater Fix + if ((ourItem.MarketName == null) && (ourItem.Name == string.Empty)) { ourItem.Name = ourItem.SimpleName; ourItem.MarketName = ourItem.SimpleName; } + //BattleBlock Theater Fix markname = Uri.EscapeDataString(ourItem.MarketName); string pageLnk = string.Format("{0}/{1}/{2}", _lists, ourItem.AppId, markname); @@ -969,7 +976,7 @@ public int ParseOnSale(string content, CurrInfoLst currLst) string appidRaw = Regex.Match(currmatch, "(?<=market_listing_item_name_link)(.*)(?=)").ToString(); string pageLnk = Regex.Match(appidRaw, "(?<=href=\")(.*)(?=\">)").ToString(); - string captainPrice = GetSweetPrice(Regex.Match(currmatch, "(?<=market_listing_price\">)(.*)(?= )", RegexOptions.Singleline).ToString().Trim()); + string captainPrice = Regex.Match(currmatch, "(?<=market_listing_price\">)(.*)(?= )", RegexOptions.Singleline).ToString().Trim(); captainPrice = Regex.Replace(captainPrice, currLst.GetAscii(), string.Empty); @@ -978,7 +985,7 @@ public int ParseOnSale(string content, CurrInfoLst currLst) string ItemType = Regex.Match(currmatch, "(?<=_listing_game_name\">)(.*)(?=)").ToString(); - inventList.Add(new InventItem(listId, LinkName[1], ItemType, captainPrice, ImgLink, string.Empty, true, true, pageLnk)); + inventList.Add(new InventItem(listId, LinkName[1], ItemType, GetSweetPrice(captainPrice), ImgLink, string.Empty, true, true, pageLnk)); }