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;
        }