Page 1 of 2

CyberCriminal - A C# project where you can be a part of

PostPosted: 26 Jul 2013, 16:47
by joppiesaus
Hi everyone!
I started a project called CyberCriminal. It is a C# Console program, what pretends to look something like (MS)-DOS. It is(going to be) a type game, and it is not finished.
Because it is a program with all sorts of commands, I thought that the community can make commands for it. You will get credit if you work on it!

Knipsel.PNG
CyberCriminal
Knipsel.PNG (8.39 KiB) Viewed 1027 times


Now about the source, there are almost NO comments. This has one advantage:
You must look at the code before you code something for it. It will force you to understand it.
And it has one disadvantage: You must look at the code :P

source:
The console void, this is the place where your comment if block will come. It is a infinite loop.
Spoiler:



An example of a command(color):
Spoiler:


The whole source v 0.1:
CyberCriminal Source 0_1.zip
CyberCriminal Source code v 0.1
(30.09 KiB) Downloaded 54 times


Rules submitting commands
Spoiler:


CyberCriminal(DEBUG).zip
cyber criminal preview exe
(6.75 KiB) Downloaded 47 times



Have fun with it!
PM me if you want more info.
For updates, SCROLL DOWN! You can't edit posts after a few minutes!
Image

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 26 Jul 2013, 18:47
by Conor
Nice idea to get everybody involved :)

Just a little suggestion, making each command as a separate class might make things a lot easier for you, and for organisation.

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 26 Jul 2013, 19:12
by joppiesaus
Conor wrote:Nice idea to get everybody involved :)

Just a little suggestion, making each command as a separate class might make things a lot easier for you, and for organisation.


You are right. The only bad thing is I use local varibles. To convert everything to classes, takes for me much, much time. Also, to make a command will be different.
So I am not sure if I do that, but thanks for the suggestion! :)

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 27 Jul 2013, 16:03
by joppiesaus
I would love to get some suggestions, and see some other coders.
I have worked on a file and directory system, so you can run files and stuff.
I am on vacation the next 7 days so I am away! :)

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 28 Jul 2013, 04:52
by Conor
Enjoy your holiday!

Here is something simple for the source :)

Code: Select all
// Below is an example of how to access my command from your command() method.
public void command()
{
    string msg = Console.ReadLine().ToLower().Trim();

    if (msg.IndexOf(' ') != -1)
    {
        if (msg.Split(' ')[0] == "setsize")
        {
             setConsoleSize(msg.Split(' ')[1]);
        }
    }
}

// Below is the called command
public void setConsoleSize(string msg)
{
    int squareLength;
    if (!int.TryParse(msg, out squareLength) || int.Parse(msg) < 50)
    {
        Console.WriteLine("Invalid size, retry?");
        if (Console.ReadLine().ToLower() == "yes" || Console.ReadLine().ToLower() == "y")
        {
             Console.WriteLine("Enter your new size:");
             setConsoleSize(Console.ReadLine().ToLower().Trim());
        }
    }
    else
    {
        try
        {
             Console.WindowWidth = squareLength;
             Console.WindowHeight = squareLength;
        }
        catch
        {
                 Console.WriteLine("An error occured, retry?");
                 if (Console.ReadLine().ToLower() == "yes" || Console.ReadLine() == "y")
                 {
                     Console.WriteLine("Enter your new size:");
                     setConsoleSize(Console.ReadLine().ToLower().Trim());
                 }
        }
    }
}

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 28 Jul 2013, 09:31
by joppiesaus
Conor wrote:Enjoy your holiday!

Here is something simple for the source :)

Code: Select all
// Below is an example of how to access my command from your command() method.
public void command()
{
    string msg = Console.ReadLine().ToLower().Trim();

    if (msg.IndexOf(' ') != -1)
    {
        if (msg.Split(' ')[0] == "setsize")
        {
             setConsoleSize(msg.Split(' ')[1]);
        }
    }
}

// Below is the called command
public void setConsoleSize(string msg)
{
    int squareLength;
    if (!int.TryParse(msg, out squareLength) || int.Parse(msg) < 50)
    {
        Console.WriteLine("Invalid size, retry?");
        if (Console.ReadLine().ToLower() == "yes" || Console.ReadLine().ToLower() == "y")
        {
             Console.WriteLine("Enter your new size:");
             setConsoleSize(Console.ReadLine().ToLower().Trim());
        }
    }
    else
    {
        try
        {
             Console.WindowWidth = squareLength;
             Console.WindowHeight = squareLength;
        }
        catch
        {
                 Console.WriteLine("An error occured, retry?");
                 if (Console.ReadLine().ToLower() == "yes" || Console.ReadLine() == "y")
                 {
                     Console.WriteLine("Enter your new size:");
                     setConsoleSize(Console.ReadLine().ToLower().Trim());
                 }
        }
    }
}


Thank you very much! May I put it into the "set" command? for example: set windowsize 40.

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 28 Jul 2013, 18:45
by Conor
Sure go for it, its your program ;D

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 03 Aug 2013, 08:42
by joppiesaus
0.2 is out!
Changes:
Code: Select all
v 0.2    -    9:37 3-8-2013
- Added a system so you can open a file
- Added the commands directory and cd(not finished)
- Added new SET arguments(Thanks to Conor)
* set height [value | max] - Sets the console height
* set width [value | max] - Sets the console width

- Added the command system to the help page
- Added more colors
- Code tweaks & fixes


The file:
CyberCriminal.zip
the debug .exe v 0.2
(8.45 KiB) Downloaded 57 times


The source:
CyberCriminal Source 0_2.zip
The source 0.2
(46.33 KiB) Downloaded 51 times

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 04 Aug 2013, 07:08
by Clowny
I guess I'd be nice to get into this and maybe learn a little along the way however I'm not quite understanding what commands would i make for this...?

Re: CyberCriminal - A C# project where you can be a part of

PostPosted: 04 Aug 2013, 09:37
by joppiesaus
Clowny wrote:I guess I'd be nice to get into this and maybe learn a little along the way however I'm not quite understanding what commands would i make for this...?


Thanks! It could be anything(as long as it is not useless, read the guidelines). <ok>