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!
- CyberCriminal
- Knipsel.PNG (8.39 KiB) Viewed 1017 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
source:
The console void, this is the place where your comment if block will come. It is a infinite loop.
Spoiler:
- Code: Select all
public void command()
{
string input = Console.ReadLine();
string msg = input.ToLower();
if (msg == "cls")
{
Console.Clear();
}
else if (msg == "help")
{
Console.Write(help());
}
else if (msg == "exit")
{
Environment.Exit(0);
}
else if (msg == "connection")
{
showIPs();
}
else if (msg.Split(' ')[0] == "ping")
{
int argument = 0;
try
{
int amountOfSpaces = msg.Split(' ').Length - 1;
if (amountOfSpaces >= 2)
{
try
{
argument = Convert.ToInt32(msg.Split(' ')[2]);
}
catch
{
argument = 0;
}
}
ping(msg.Split(' ')[1], argument);
}
catch
{
Console.WriteLine(InvalidArgumentsException);
}
}
else if (msg.Split(' ')[0] == "set")
{
try
{
set(msg.Split(' ')[1]);
}
catch
{
Console.WriteLine(InvalidArgumentsException);
}
}
else if (msg.Split(' ')[0] == "echo")
{
try
{
string message = input.Replace("echo", "");
echo(message);
}
catch
{
echo("");
}
}
else if (msg == "system")
{
getSystem();
}
else if (msg.Split(' ')[0] == "color")
{
try
{
string color = msg.Split(' ')[1];
setColor(color);
}
catch
{
setColor("reset");
}
}
else if (msg.Split(' ')[0] == "force")
{
try
{
string ipAdress = msg.Split(' ')[1];
force(ipAdress);
}
catch
{
Console.WriteLine(InvalidArgumentsException);
}
}
else if (msg.Split(' ')[0] == "storage")
{
try
{
if (msg.Split(' ')[1] == "remove" || msg.Split(' ')[1] == "rmv")
{
store.remove(msg.Split(' ')[2]);
}
else if (msg.Split(' ')[1] == "get")
{
string display = store.get(msg.Split(' ')[2]);
if (display != "")
{
Console.WriteLine("The field \"" + msg.Split(' ')[2] + "\" has a value of \"" + display + "\"");
}
}
else if (msg.Split(' ')[1] == "set")
{
string str1 = msg.Split(' ')[2];
store.store(str1, msg.Replace("storage set " + str1 + " ", ""));
}
else
{
string str1 = msg.Split(' ')[1];
store.store(str1, msg.Replace("storage " + str1 + " ", ""));
}
Console.WriteLine();
}
catch
{
Console.WriteLine(InvalidArgumentsException);
}
}
else
{
Console.WriteLine("Bad command or illigal filename." + System.Environment.NewLine);
}
command();
}
An example of a command(color):
Spoiler:
It is not like MCDzienny just a DLL file that overrides. This is a void that comes in the source.
- Code: Select all
void setColor(string color)
{
if (color == "reset")
{
Console.ResetColor();
}
else if (color == "blue")
{
Console.ForegroundColor = ConsoleColor.Blue;
}
else if (color == "red")
{
Console.ForegroundColor = ConsoleColor.Red;
}
else if (color == "green")
{
Console.ForegroundColor = ConsoleColor.Green;
}
else if (color == "white")
{
Console.ForegroundColor = ConsoleColor.White;
}
else if (color == "pink")
{
Console.ForegroundColor = ConsoleColor.Magenta;
}
else
{
Console.WriteLine("Unknown color");
}
}
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:
1. The command must be effective.
You can't just post something that's uselless. For example a command which just say hi to you will be denied.
The command does not have to be a complex-super-awsome-coding-ninja-thing, but it must make sense.
2: The command must work.
If you have made a command but it does not work / compile, it is useless. Of course, if it doesn't work, you just post your command with "Help with this command please!"
or something.
Application format:
[Spoiler]
Command name duh. The command name!
Command description Here you put your description in it what the command does.
Command help message Here you put the help message if you type "help" in the program. Must be in this format: COMMAND NAME <arguments> / [arguments] - how it works and what it does.
Command IF code The "if" block when your commmand should be executed. Commenting is welcome.
Command void The void where all the magic happens! Commenting is welcome.
You can't just post something that's uselless. For example a command which just say hi to you will be denied.
The command does not have to be a complex-super-awsome-coding-ninja-thing, but it must make sense.
2: The command must work.
If you have made a command but it does not work / compile, it is useless. Of course, if it doesn't work, you just post your command with "Help with this command please!"
or something.
Application format:
[Spoiler]
Command name duh. The command name!
Command description Here you put your description in it what the command does.
Command help message Here you put the help message if you type "help" in the program. Must be in this format: COMMAND NAME <arguments> / [arguments] - how it works and what it does.
Command IF code The "if" block when your commmand should be executed. Commenting is welcome.
Command void The void where all the magic happens! Commenting is welcome.
- CyberCriminal(DEBUG).zip
- cyber criminal preview exe
- (6.75 KiB) Downloaded 46 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!