void go(Object sender, EventArgs e)
        {
            RSGame game = (RSGame)gameChooser.SelectedItem;
            Console.WriteLine(game);

            MacroMain main = new MacroMain(game);
            this.Close();
        }
        /*private String assemblyName;
        private Type mainScript;
        private Type apiType;
        private ScriptAttributes attribute;
        private Assembly assembly;*/
        public ScriptController(MacroMain mainController)
        {
            main = mainController;

            sInfo = new ScriptInformation();
            sInfo.run = false;

            stopHotkey = new Hotkey_WPF(System.Windows.Forms.Keys.Q, false, true, false, false);
            stopHotkey.Pressed += (object sender, System.ComponentModel.HandledEventArgs e) => setScript(null);
            //stopHotkey.Register(main.window);
        }
        public MainWindow(RSGame game, MacroMain main)
        {
            /*this.game = game;
            this.gameProcess = process;

            InitializeComponent();

            consoleOutput.AppendText(Environment.NewLine);

            TextWriter t = Console.Out;
            Console.SetOut(new TextBoxWriter(consoleOutput));

            consoleOutput.IsReadOnly = true;

            selectProcess.Click += new RoutedEventHandler(printaline);*/
            init(game, main);
        }
        void init(RSGame game, MacroMain main)
        {
            this.main = main;

            this.random = new Random();

            InitializeComponent();

            consoleOutput.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            //consoleOutput.AppendText(Environment.NewLine);

            foreach (Process p in Process.GetProcesses()) {
                ProcessItem i = new ProcessItem(p);
                processSelectBox.Items.Add(i);
                if (p.ProcessName == Util.launcherName) {
                    processSelectBox.SelectedItem = i;
                    main.setOverlay(p);
                    break;
                }
            }
            /*if(main.gameProcess != null) {
                main.overlay = new WindowOverlay(main.gameProcess);
                main.overlay.Show();
                this.mouse = main.overlay.MouseInstance;
                this.mouse.Enable();
            }*/

            foreach (RSGame g in RSGame.games) {
                MenuItem item = new MenuItem();
                item.Header =  g.getName();
                item.IsCheckable = true;
                item.Click += new RoutedEventHandler(setGame);
                if (g.Equals(game))
                    item.IsChecked = true;
                gameMenu.Items.Add(item);
            }

            mouseHook = IntPtr.Zero;

            gameString = (String)lblGame.Content;
            scriptString = (String)lblScript.Content;
            authorString = (String)lblAuthor.Content;
            descString = (String)lblDesc.Content;

            lblGame.Content += game.getName();
            Closing += onClose;

            //TextWriter t = Console.Out;
            //Console.SetOut(new TextBoxWriter(consoleOutput));

            consoleOutput.IsReadOnly = true;

            Polygon pol = new Polygon();
            pol.Stroke = System.Windows.Media.Brushes.Black;
            pol.Fill = System.Windows.Media.Brushes.LightSeaGreen;
            pol.StrokeThickness = 2;
            pol.HorizontalAlignment = HorizontalAlignment.Left;
            pol.VerticalAlignment = VerticalAlignment.Center;
            Point p1 = new Point(10, 10);
            Point p2 = new Point(100, 15);
            Point p3 = new Point(86, 40);
            Point p4 = new Point(136, 76);
            PointCollection col = new PointCollection();
            col.Add(p1);
            col.Add(p2);
            col.Add(p3);
            col.Add(p4);
            pol.Points = col;

            //processCanvas.Children.Add(pol);

            //selectProcess.Click += new RoutedEventHandler(selectTheProcess);
            //refreshProcess.Click += new RoutedEventHandler(refreshProcesses);
            this.KeyDown += MainWindow_KeyDown;
        }
        void launchGame(Object sender, EventArgs e)
        {
            if (clicked)
                return;
            else
                clicked = true;

            RSGame game = (RSGame)gameChooser.SelectedItem;
            Console.WriteLine(game);

            String loc = Util.createTempUrl(game.ToString(), game.getUrl());
            Util.startProcess(loc);

            /*switch (game)
            {
                case "RuneScape 3":
                    String s = Util.createTempUrl("RS3", "jagex-jav://www.runescape.com/jav_config.ws");
                    Util.startProcess(s);
                    break;
                case "OldSchool RuneScape":
                    String t = Util.createTempUrl("OSRS", "jagex-jav://oldschool8.runescape.com/jav_config.ws");
                    Util.startProcess(t);
                    break;
                case "DarkScape":
                    String r = Util.createTempUrl("DarkScape", "jagex-jav://www.runescape.com/jav_config_beta.ws");
                    Util.startProcess(r);
                    break;
                default:
                    Console.WriteLine("Selected is not found.");
                    break;
            }*/
            MacroMain main = new MacroMain(game);
            this.Close();
        }