public Chat(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; hasFocus = false; Util.LoadTheme(metroStyleManager1); }
public Chat(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; hasFocus = false; Util.LoadTheme(this, this.Controls); }
public Chat(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; hasFocus = false; Util.LoadTheme(metroStyleManager1); }
public ShowTrade_Web(SteamBot.Bot bot) { InitializeComponent(); this.Icon = MistClient.Properties.Resources.Icon; this.bot = bot; trade_url = string.Format("http://steamcommunity.com/trade/{0}/", bot.SteamUser.SteamID.ConvertToUInt64()); this.Text = "Trading with " + bot.SteamFriends.GetFriendPersonaName(bot.CurrentTrade.OtherSID); this.baseWidth = webControl1.Width; this.baseZoom = (int)Math.Round((double)baseWidth / 5.43); }
public static string GetSteamIDInfo(SteamBot.Bot bot, SteamKit2.SteamID steamId) { string output = ""; output += "| steamname: " + bot.SteamFriends.GetFriendPersonaName(steamId); output += "\r\n| steamID32: " + steamId.ToString(); output += "\r\n| steamID64: http://steamcommunity.com/profiles/" + steamId.ConvertToUInt64(); output += "\r\n| steamrep: http://steamrep.com/profiles/" + steamId.ConvertToUInt64(); return(output); }
public ShowTrade_Web(SteamBot.Bot bot) { InitializeComponent(); this.Icon = MistClient.Properties.Resources.Icon; this.bot = bot; trade_url = string.Format("http://steamcommunity.com/trade/{0}/", bot.SteamUser.SteamID.ConvertToUInt64()); this.Text = "Trading with " + bot.SteamFriends.GetFriendPersonaName(bot.CurrentTrade.OtherSID); this.baseWidth = webControl1.Width; this.baseZoom = (int)Math.Round((double)baseWidth / 5.43); }
public Friends(SteamBot.Bot bot, string username) { InitializeComponent(); this.MouseWheel += Friends_MouseWheel; webControl1.MouseWheel += Friends_MouseWheel; webControl1.Source = ("file://" + Application.StartupPath + "/Resources/Friends.html").ToUri(); webControl1.DocumentReady += webControl1_DocumentReady; webControl1.ShowContextMenu += webControl1_ShowContextMenu; this.StyleManager = Friends.GlobalStyleManager; this.StyleManager.OnThemeChanged += StyleManager_OnThemeChanged; Util.LoadTheme(this, this.Controls); this.shareUsageStatsToolStripMenuItem.Checked = Properties.Settings.Default.ShareUsageStats; if (Properties.Settings.Default.ShareUsageStats) { Util.SendUsageStats(bot.SteamUser.SteamID); statsSent = true; } this.Text = "Friends"; this.steam_name.Text = username; this.bot = bot; this.steam_name.ContextMenuStrip = menu_status; this.steam_status.ContextMenuStrip = menu_status; this.label_settings.ContextMenuStrip = menu_status; this.text_search.Text = ""; this.steam_status.TextChanged += steam_status_TextChanged; this.minimizeToTrayToolStripMenuItem.Checked = Properties.Settings.Default.MinimizeToTray; this.showOnlineFriendsOnlyToolStripMenuItem.Checked = Properties.Settings.Default.OnlineOnly; logConversationsToolStripMenuItem.Checked = Properties.Settings.Default.KeepLog; keepLog = logConversationsToolStripMenuItem.Checked; // Set colors var onlineColor = ColorTranslator.FromHtml("#5db2ff"); steam_name.ForeColor = onlineColor; steam_status.ForeColor = onlineColor; // Create a simple tray menu with only one item. trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Show", OnTrayIconDoubleClick); trayMenu.MenuItems.Add("Exit", OnExit); // Create a tray icon. In this example we use a // standard system icon for simplicity, but you // can of course use your own custom icon too. trayIcon = new NotifyIcon(); trayIcon.Text = "Mist"; Bitmap bmp = Properties.Resources.mist_icon; trayIcon.Icon = Icon.FromHandle(bmp.GetHicon()); // Add menu to tray icon and show it. trayIcon.ContextMenu = trayMenu; trayIcon.Visible = false; trayIcon.DoubleClick += new System.EventHandler(this.OnTrayIconDoubleClick); }
public static System.Drawing.Color GetColorFromPersonaState(SteamBot.Bot bot, SteamKit2.SteamID steamId) { var state = bot.SteamFriends.GetFriendPersonaState(steamId); if (state != SteamKit2.EPersonaState.Offline) { var isPlayingGame = !string.IsNullOrEmpty(bot.SteamFriends.GetFriendGamePlayedName(steamId)); if (isPlayingGame) { return((System.Drawing.Color)System.Drawing.ColorTranslator.FromHtml("#81b900")); } else { return((System.Drawing.Color)System.Drawing.ColorTranslator.FromHtml("#5db2ff")); } } return(System.Drawing.ColorTranslator.FromHtml("#8a8a8a")); }
public Friends(SteamBot.Bot bot, string username) { InitializeComponent(); Util.LoadTheme(metroStyleManager1); this.Text = "Friends - Mist v" + mist_ver + " (Dota 2 Edition)"; this.steam_name.Text = username; this.bot = bot; this.steam_name.ContextMenuStrip = menu_status; this.steam_status.ContextMenuStrip = menu_status; this.label1.ContextMenuStrip = menu_status; this.minimizeToTrayToolStripMenuItem.Checked = Properties.Settings.Default.MinimizeToTray; this.showOnlineFriendsOnlyToolStripMenuItem.Checked = Properties.Settings.Default.OnlineOnly; logConversationsToolStripMenuItem.Checked = Properties.Settings.Default.KeepLog; keepLog = logConversationsToolStripMenuItem.Checked; ListFriends.friends = this; form_friendsHeight = friends_list.Height; form_friendreqHeight = list_friendreq.Height; refreshTimer.Interval = TimerInterval; refreshTimer.Elapsed += (sender, e) => OnTimerElapsed(sender, e); refreshTimer.Start(); // Create a simple tray menu with only one item. trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Show", OnTrayIconDoubleClick); trayMenu.MenuItems.Add("Exit", OnExit); // Create a tray icon. In this example we use a // standard system icon for simplicity, but you // can of course use your own custom icon too. trayIcon = new NotifyIcon(); trayIcon.Text = "Mist"; Bitmap bmp = Properties.Resources.mist_icon; trayIcon.Icon = Icon.FromHandle(bmp.GetHicon()); // Add menu to tray icon and show it. trayIcon.ContextMenu = trayMenu; trayIcon.Visible = false; trayIcon.DoubleClick += new System.EventHandler(this.OnTrayIconDoubleClick); }
public Friends(SteamBot.Bot bot, string username) { InitializeComponent(); Util.LoadTheme(metroStyleManager1); this.Text = "Friends - Mist v" + mist_ver; this.steam_name.Text = username; this.bot = bot; this.steam_name.ContextMenuStrip = menu_status; this.steam_status.ContextMenuStrip = menu_status; this.label1.ContextMenuStrip = menu_status; this.minimizeToTrayToolStripMenuItem.Checked = Properties.Settings.Default.MinimizeToTray; this.showOnlineFriendsOnlyToolStripMenuItem.Checked = Properties.Settings.Default.OnlineOnly; logConversationsToolStripMenuItem.Checked = Properties.Settings.Default.KeepLog; keepLog = logConversationsToolStripMenuItem.Checked; ListFriends.friends = this; form_friendsHeight = friends_list.Height; form_friendreqHeight = list_friendreq.Height; refreshTimer.Interval = TimerInterval; refreshTimer.Elapsed += (sender, e) => OnTimerElapsed(sender, e); refreshTimer.Start(); // Create a simple tray menu with only one item. trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Show", OnTrayIconDoubleClick); trayMenu.MenuItems.Add("Exit", OnExit); // Create a tray icon. In this example we use a // standard system icon for simplicity, but you // can of course use your own custom icon too. trayIcon = new NotifyIcon(); trayIcon.Text = "Mist"; Bitmap bmp = Properties.Resources.mist_icon; trayIcon.Icon = Icon.FromHandle(bmp.GetHicon()); // Add menu to tray icon and show it. trayIcon.ContextMenu = trayMenu; trayIcon.Visible = false; trayIcon.DoubleClick += new System.EventHandler(this.OnTrayIconDoubleClick); }
public static double GetSteamMarketPrice(SteamBot.Bot bot, GenericInventory.Inventory.Item item, bool withFee = true) { var url = string.Format("http://steamcommunity.com/market/listings/{0}/{1}/render?currency=1", item.AppId, item.MarketHashName); var response = SteamWeb.Fetch(url, "GET", null, bot.botCookies, false); try { var json = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(response); List <double> prices = new List <double>(); int count = 0; var listings = Newtonsoft.Json.JsonConvert.DeserializeObject <Dictionary <string, dynamic> >(Convert.ToString(json.listinginfo)); foreach (var listingItem in listings.Values) { if (listingItem.price == 0) { continue; } if (count == 3) { break; } var basePrice = (double)listingItem.converted_price; var fee = withFee ? (double)listingItem.converted_fee : 0; var price = (double)((basePrice + fee) / 100); prices.Add(price); count++; } var totalPrices = 0.0; foreach (var price in prices) { totalPrices += price; } var averagePrice = prices.Count > 0 ? Math.Round(totalPrices / prices.Count, 2) : 0; return(averagePrice); } catch { return(0); } }
public static void ShowSteamProfile(SteamBot.Bot bot, ulong steamId) { var form = new MetroForm(); form.Text = "Steam Community"; form.Width = 800; form.Height = 600; form.Style = Friends.GlobalStyleManager.Style; form.Theme = Friends.GlobalStyleManager.Theme; form.Icon = MistClient.Properties.Resources.Icon; form.ShadowType = MetroFormShadowType.DropShadow; var webControl = new Awesomium.Windows.Forms.WebControl(); webControl.Dock = System.Windows.Forms.DockStyle.Fill; string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId); webControl.WebSession = Awesomium.Core.WebCore.CreateWebSession(new Awesomium.Core.WebPreferences()); webControl.WebSession.SetCookie(new Uri("http://steamcommunity.com"), cookies, true, true); webControl.Source = new Uri((string.Format("http://steamcommunity.com/profiles/{0}/", steamId))); webControl.DocumentReady += webControl_DocumentReady; webControl.TitleChanged += (s, e) => webControl_TitleChanged(s, e, form); form.Controls.Add(webControl); form.Show(); }
public AddFriend(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(metroStyleManager1); }
public ProfileName(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(metroStyleManager1); }
public ProfileName(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(this, this.Controls); }
public AddFriend(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(this, this.Controls); }
public Chat(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; hasFocus = false; }
public ViewBackpack(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(metroStyleManager1); }
public AddFriend(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(metroStyleManager1); }
public ProfileName(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(this, this.Controls); }
public ProfileName(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; }
public AddFriend(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(this, this.Controls); }
public AddFriend(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; }
public ProfileName(SteamBot.Bot bot) { InitializeComponent(); this.bot = bot; Util.LoadTheme(metroStyleManager1); }