/cp Console command

04/15/2009 21:23 Vortex.#1
Ok, could some tell me how to add the command in General.cs that lets me open my Control Panel, I have no idea how to do this.....

I really need this because....

The control panel opens by it self on restarts...

And if I close the control panel it can't be opened again with out a restart....

[Only registered and activated users can see links. Click Here To Register...]
04/15/2009 21:37 r.0ck#2
Well if you have a control panel and you close it make it close the server too? Or create a command that has the run application in it. Look at Emme's Lame Console Commands.
04/15/2009 23:33 tao4229#3
Copy and paste the code for the original form running...
04/15/2009 23:41 Vortex.#4
wdf you on about :S

#Edit figured it out thnx tao..

Code:
{
                string str;
                str = Console.ReadLine();
                if (str == "/cp")
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Form1());
                }
04/15/2009 23:43 r.0ck#5
Quote:
Originally Posted by Vortex. View Post
wdf you on about :S
Your saying when you close your control panel you can not reopen it...Did you even follow the How to make a form load? It gives you a small code to make the application run which Saint is talking about. He and I , but he said it in a more understandable way, To put that thing in as a new command for the console application so that you can make it load up again...
04/16/2009 00:38 Vortex.#6
r.0ck nope your wrong, any way....

I need to know how to stop loft from closing when I press enter....

it works i type /cp and it opens but when but loft closes automatically, since the control panel takes over full control of the console
it freezes loft from closing, but after i close it, the console closes, I also added other codes, like clear, and help ect..

Does anyone know how to stop this?
04/16/2009 05:03 Tarouka#7
Code:
            string Cmd;
            while ((Cmd = Console.ReadLine().ToLower()) != "/quit")
            {
                switch (Cmd)
                {
                    case "/cp": Application.Run(new Form1()); break;
                }
            }
Wouldn't that'd be lighter and also implement a new command? Also, you don't need to always put the...
Code:
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
...doing it once in the whole app will be fine.
04/16/2009 12:34 r.0ck#8
you didn't even read my post i said exactly what tao said...anyway find Console.Readline(); and remove it so the console wont exit when you click enter.
04/16/2009 15:05 Vortex.#9
Quote:
Originally Posted by Tarouka View Post
Code:
            string Cmd;
            while ((Cmd = Console.ReadLine().ToLower()) != "/quit")
            {
                switch (Cmd)
                {
                    case "/cp": Application.Run(new Form1()); break;
                }
            }
Wouldn't that'd be lighter and also implement a new command? Also, you don't need to always put the...
Code:
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
...doing it once in the whole app will be fine.


Thnx, gonna try it, and yes

You need to add:
Code:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
or else the buttons won't appear....


#Edit your code doesn't work, soo... I looked at your formula, and generated my own...

Which has a new bug, I can't type/open.. control panel/cp twice...
Code:
{

            string Cmd;
            while ((Cmd = Console.ReadLine().ToLower()) != "/quit")
                if (Cmd == "/cp")
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Form1());
                }