コード例 #1
0
ファイル: Chat.cs プロジェクト: notafraid90/Mist
 public Chat(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     hasFocus = false;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #2
0
 public Chat(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     hasFocus = false;
     Util.LoadTheme(this, this.Controls);
 }
コード例 #3
0
 public Chat(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     hasFocus = false;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #4
0
ファイル: ShowTrade_Web.cs プロジェクト: The-Mad-Pirate/Mist
 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);
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: Friends.cs プロジェクト: The-Mad-Pirate/Mist
        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);
        }
コード例 #8
0
        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"));
        }
コード例 #9
0
        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);
        }
コード例 #10
0
ファイル: Friends.cs プロジェクト: notafraid90/Mist
        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);
        }
コード例 #11
0
        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);
            }
        }
コード例 #12
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();
        }
コード例 #13
0
 public AddFriend(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #14
0
ファイル: ProfileName.cs プロジェクト: notafraid90/Mist
 public ProfileName(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #15
0
ファイル: ProfileName.cs プロジェクト: xaustinx/Mist
 public ProfileName(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(this, this.Controls);
 }
コード例 #16
0
ファイル: AddFriend.cs プロジェクト: The-Mad-Pirate/Mist
 public AddFriend(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(this, this.Controls);
 }
コード例 #17
0
ファイル: Chat.cs プロジェクト: Jamyn/Mist
 public Chat(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     hasFocus = false;
 }
コード例 #18
0
 public ViewBackpack(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #19
0
ファイル: AddFriend.cs プロジェクト: notafraid90/Mist
 public AddFriend(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(metroStyleManager1);
 }
コード例 #20
0
ファイル: ProfileName.cs プロジェクト: The-Mad-Pirate/Mist
 public ProfileName(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(this, this.Controls);
 }
コード例 #21
0
ファイル: ProfileName.cs プロジェクト: Jamyn/Mist
 public ProfileName(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
 }
コード例 #22
0
 public AddFriend(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(this, this.Controls);
 }
コード例 #23
0
ファイル: AddFriend.cs プロジェクト: Jamyn/Mist
 public AddFriend(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
 }
コード例 #24
0
ファイル: ProfileName.cs プロジェクト: notafraid90/Mist
 public ProfileName(SteamBot.Bot bot)
 {
     InitializeComponent();
     this.bot = bot;
     Util.LoadTheme(metroStyleManager1);
 }