Post by Anatoly on Jul 29, 2017 11:26:17 GMT 2
As I leave, I decided to publish all bots I coded so far.
My Main Bot
DMT (I started coding)
Yeah, when using them (however, idc) please tell who coded. Thanks for all the good!
My Main Bot
using System;
using System.Threading;
using System.Collections.Generic;
using PlayerIOClient;
using System.IO;
namespace EEBot
{
class Program
{
public static Client _client;
public static Connection _connection;
// Edit this values
public static string roomid = "PWRngvmEVLQ"; //PWRngvmEVLQ
static int BotId; // The Id of the Bot User
static Dictionary<int, Player> Players = new Dictionary<int, Player>(); // All players in room
static int cReport = 0; // Current Report
static Dictionary<int, Report> Reports = new Dictionary<int, Report>(); // Reports
static string Hoster = "anatoly"; // The name of the Bot Owner
//static string[] AdminList = File.ReadAllLines(Environment.CurrentDirectory + "/adminlist.txt");
// Game playing
static int GameType;
// GameType 1 BOSS
static int GameType_Snake_Milliseconds = 20;
static int GameType_Snake_Mode = 1;
//GameType 2 OPTIONAL
static string Follow;
// GameType 3 DMT
static int GameType_DMT_PlayerEditing = 0;
static string[] GameType_DMT_Words = new string[]{
// Not Sorted
"alone", "phone", "diamond", "umbrella",
"book", "macbook", "house", "door", "window", "vase",
"wall", "water", "fridge", "carpet", "bottle", "box", "chair", "table", "cup",
"tea", "plate", "spoon", "knife", "turtle", "explosion", "fire", "death", "love", "hookjump", "admin", "noob",
"sign", "clock", "book", "human", "peace", "war", "ice", "big", "small", "paper", "trash", "cupboard",
"bed", "car", "sand", "tree", "sky", "wifi", "television", "lamp", "minecraft",
"ground", "head", "eyes", "mouth", "feet", "hat", "earrings", "half", "smiley", "shoe",
"robot", "console", "block", "pig", "cow", "sword", "pickaxe", "axe", "brick",
// Adjectives: Colors
"gold", "red", "green", "blue", "cyan", "magenta", "yellow",
// Religion or Magic: People
"wizard", "god", "devil", "jesus", "symbol",
// Physic, Geography, Universe, Nature
"earth", "lava", "rainbow", "sun", "cloud", "sky", "moon", "star", "planet", "flower", "grass", "bush",
"magnet", "meteor",
// Fruits, "Tree"
"apple", "tree", "stick", "leaf", "banana", "strawberry", "pineapple",
// Subjects
"math", "circle", "triangle", "square", "digit",
};
static string GameType_DMT_WordNow = "unknown";
//GameType 4 MAFIA
static List<int> GameType_Mafia_SignedUp = new List<int>();
static int GameType_Mafia_state = 0;
static int GameType_Mafia_Moderator = 0; // Moderator
static int[] GameType_Mafia_Group1 = new int[] {}; // Mafia (1/4)
static int[] GameType_Mafia_Group2 = new int[] {}; // Villagers (2/4)
static int GameType_Mafia_Group3 = 0; // Detective (1x) Can gets if someone is mafia
static int GameType_Mafia_Group4 = 0; // Doctor (1x) Can heal someone
static int GameType_Mafia_Group5 = 0; // Police (1x) Changes Roles with someone
static int GameType_Mafia_Group6 = 0; // Girl (1x) Gets all Mafias on start to know
static int GameType_Mafia_Group7 = 0; // Terrorist (1x) In a day, he can kill hisself, and taking someone else intothe grave.
// GameType 5 MOVEBOT
static int[] b_ids = new int[]{10, 12, 13, 70, 30, 29, 31};
// GameType 6 COINHACK
// CoinHack needs nothing.
//<-- GameTypes end -->//
static void Main(string[] args)
{
// eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw, everybody-edits-su9rn58o40itdbnw69plyw
PlayerIO.QuickConnect.SimpleConnect("eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw", "email", "password", null, loginSuccess, loginFail);
Console.ReadKey();
}
static void loginSuccess(Client client)
{
_client = client;
Console.WriteLine("Logged in!");
client.Multiplayer.CreateJoinRoom(roomid, roomid.StartsWith("BW") ? "Beta" : "Everybuildexists" + client.BigDB.Load("config", "data")["version"], true, null, null, connectionSuccess, connectionFail);
}
static void loginFail(PlayerIOError error)
{
Console.WriteLine("Can't login, reason: " + error.Message);
}
static void connectionSuccess(Connection con)
{
_connection = con;
Console.WriteLine("Connected!");
con.Send("init");
con.OnMessage += Con_OnMessage;
}
/*_client = PlayerIO.QuickConnect.SimpleConnect("gameID", "<snip>","<snip>",null);
_connection = client.Multiplayer.CreateJoinRoom(textBox1.Text, "version", true, new Dictionary<string, string>(), new Dictionary<string, string>());
_connection.Send("init");
_connection.OnMessage += new MessageReceivedEventHandler(onmessage);*/
private static void Con_OnMessage(object sender,PlayerIOClient.Message m)
{
switch (m.Type)
{
case "init":
_connection.Send("init2");
BotId = m.GetInt(5);
GameType = 0;
Follow = Hoster;
break;
case "init2":
Console.WriteLine("Joined the room!");
_connection.Send("say", "[Bot] Connected!");
Thread.Sleep(100);
_connection.Send("god", true);
Thread.Sleep(100);
_connection.Send("m", 320, 243, 0, 0, 0, 0, 0, 0, 0, false, false, 0);
break;
case "add":
Player player = new Player(m.GetInt(0), m.GetString(1), m.GetString(2));
Players.Add(player.Id, player);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(m[1] + " in Room! (Rank " + Players[m.GetInt(0)].Rank + ")");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId:" + m[0]);
Console.WriteLine("\tId:" + m[2]);
Thread.Sleep(100);
// Admin
if (Players[m.GetInt(0)].Rank == 2) {
_connection.Send("say","/giveedit " + Players[m.GetInt(0)].Username);
Thread.Sleep(100);
_connection.Send("say","/setteam " + Players[m.GetInt(0)].Username + " yellow");
// Mod
} else if ((Players[m.GetInt(0)].Rank == 1)) {
if (GameType == 2 || GameType == 6) {
_connection.Send("say","/giveedit " + Players[m.GetInt(0)].Username);
} else {
_connection.Send("say","/givegod " + Players[m.GetInt(0)].Username);
}
Thread.Sleep(100);
_connection.Send("say","/setteam " + Players[m.GetInt(0)].Username + " magenta");
// Member
} else if ((Players[m.GetInt(0)].Rank == 0)) {
if (GameType == 2) {
_connection.Send("say","/giveedit " + Players[m.GetInt(0)].Username);
} else if (GameType == 6) {
_connection.Send("say","/givegod " + Players[m.GetInt(0)].Username);
} else {
_connection.Send("say","/pm " + Players[m.GetInt(0)].Username + " Welcome, " + Players[m.GetInt(0)].Username + ", to Anatoly's Bot World!");
}
//Banned
} else if ((Players[m.GetInt(0)].Rank == -1)) {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " You are temporary banned!");
} else if ((Players[m.GetInt(0)].Rank == -2)) {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " You are permament banned!");
} else if ((Players[m.GetInt(0)].Rank == -3)) {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " Your name is banned! Change it!");
}
//Guest
if (m.GetString(3) == "simpleguest") {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " Guest Accounts are banned during the issue with 'guest-0'.");
}
break;
case "left":
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(Players[m.GetInt(0)].Username + " left!");
Players.Remove(m.GetInt(0));
break;
case "info":
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write(m.GetInt(1));
Console.ForegroundColor = ConsoleColor.Gray;
Console.Write("Reason: ");
Console.ForegroundColor = ConsoleColor.Magenta;
Console.Write(m.GetInt(2));
_connection.Disconnect();
break;
case "b":
// Collect placed coins (Magic reasons) [BROCKEN]
/*if (m.GetInt(3) == 100 || m.GetInt(3) == 101) {
_connection.Send("c", 0, 0, m.GetInt(1), m.GetInt(2));
}*/
// Bug: Snake Bot stops replacing blocks after a moment.
if (GameType == 1) {
// Basic
if (m.GetInt(3) == 14) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 12);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
// Brick
} else if (m.GetInt(3) == 19) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 20);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
// Ruins
} else if (m.GetInt(3) == 198) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 196);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
//Sand
} else if (m.GetInt(3) == 140) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 137);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
// Checker
} else if (m.GetInt(3) == 191) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 189);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
// Checker
} else if (m.GetInt(3) == 56) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 51);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
// Mineral
} else if (m.GetInt(3) == 74) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 70);
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 75);
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 76);
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 1112) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1109);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 174) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 175);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 1072) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1071);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 1076) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1075, 2);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 31) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 30);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 38) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 40);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 203) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 202);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 416);
} else if (m.GetInt(3) == 100) {
for (int i = 0; i <= 4; i++) {
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 101);
Thread.Sleep(17);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
}
} else if (GameType_Snake_Mode == 13) { // SPECIAL! This Blocks are only supposed to change in this mode.
// Solid Block
if (m.GetInt(3) == 23) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 24);
} else if (m.GetInt(3) == 24) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 25);
} else if (m.GetInt(3) == 25) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1005);
} else if (m.GetInt(3) == 1005) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1006);
} else if (m.GetInt(3) == 1006) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1007);
} else if (m.GetInt(3) == 1007) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 26);
} else if (m.GetInt(3) == 26) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 27);
} else if (m.GetInt(3) == 27) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 28);
} else if (m.GetInt(3) == 28) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1008);
} else if (m.GetInt(3) == 1008) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1009);
} else if (m.GetInt(3) == 1009) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 1010);
} else if (m.GetInt(3) == 1010) {
Thread.Sleep(5);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 23);
// CHANGER
} else if (m.GetInt(3) == 6) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 7) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 8) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 408) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 409) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
} else if (m.GetInt(3) == 4010) {
Thread.Sleep(100);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 0);
};
}
/* DIDN'T WORK
if (m.GetInt(0) == BotId) {
//_connection.Send("b", 1, 6 + i, 21, 10);
Thread.Sleep(20);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 10);
}*/
} else if (GameType == 3) {
if ((m.GetInt(3) == 385 || m.GetInt(3) == 1000) && Players[m.GetInt(5)].Username == Players[GameType_DMT_PlayerEditing].Username) {
GameType_DMT_WordNow = "unknown";
GameType_DMT_PlayerEditing = 0;
_connection.Send("say", "[DrawMyThing] @" + Players[m.GetInt(0)].Username + ": You broke the rules! Text is forbidden as drawer!");
}
} else if (GameType == 6) {
if (m.GetInt(3) == 100) {
Thread.Sleep(3);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 101);
} else if (m.GetInt(3) == 101) {
Thread.Sleep(3);
_connection.Send("b", m.GetInt(0), m.GetInt(1), m.GetInt(2), 100);
}
}
break;
/*case "write":
Console.ForegroundColor = ConsoleColor.Green; Console.Write(m.GetString(0));
Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(": ");
Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(m.GetString(1));
break;*/
case "m":
if (Players[m.GetInt(0)].Afk == true) {
Players[m.GetInt(0)].Afk = false;
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " You are no longer afk!");
/*Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " came from AFK!");*/
}
if (GameType == 2 && Players[m.GetInt(0)].Username == Follow.ToLower() && m.GetInt(0) != BotId) {
_connection.Send("m", m.GetDouble(1), m.GetDouble(2), m.GetDouble(3), m.GetDouble(4), m.GetDouble(5), m.GetDouble(6), m.GetDouble(7), m.GetDouble(8), 0, m.GetBoolean(9), m.GetBoolean(10), 0);
}
break;
case "god":
if (GameType == 2 && Players[m.GetInt(0)].Username == Follow) {
_connection.Send("god", m.GetBoolean(1));
} break;
case "say":
string[] arg = m.GetString(1).Split(' ');
string command = arg[0].ToLower();
//Console.WriteLine(Players[m.GetInt(0)].Username + ": " + m[1]);
if (BotId == m.GetInt(0)) {http://everybuildexists.boards.net/thread/231/bal-fecrew-bot-arena
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(m[1]);
} else {
if (command == "!help") {
//_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " ...");
Thread.Sleep(500);
if (GameType == 0) {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Bot is currently Afk! All you can do is: Wait for mods!");
if (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1) {
Thread.Sleep(500);
_connection.Send("say","/pm " + Players[m.GetInt(0)].Username + " Admin Help: You are supposed to set a !game.");
}
} else if (GameType == 1) { // Snake
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " BossToCode is a WiP section of the bot! You can't get help here.");
} else if (GameType == 2) { // Edit
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Say '!gainedit' to get edit!");
} else if (GameType == 3) { // DrawMy
if (GameType_DMT_PlayerEditing == m.GetInt(0)) {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Commands: changeword, tellword");
} else {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Guess the thing which is drawn currently");
}
if (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1) {
Thread.Sleep(500);
_connection.Send("say","/pm " + Players[m.GetInt(0)].Username + " Admin Help: setturn, skip, forceskip, getword");
}
} else if (GameType == 4) { // Mafia
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mafia is a WiP section of the bot! You can't get help here.");
} else if (GameType == 5) { // Move Bot
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " MoveBot is a WiP section of the bot! You can't get help here.");
if (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1) {
Thread.Sleep(500);
_connection.Send("say","/pm " + Players[m.GetInt(0)].Username + " Admin Help: (All arguments with '!move') box, terrain, blocks");
}
} else if (GameType == 6) { // CoinHack
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Find a coin in the world, and stay there afk. It will be permamently replaced. Of course you can talk and enjoy!");
} else {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " The Mode which has been set by the owner couldn't be found.");
}
Thread.Sleep(500);
// Admin Help
if (Players[m.GetInt(0)].Rank == 2 && Players[m.GetInt(0)].Rank == 1) {
_connection.Send("say","/pm " + Players[m.GetInt(0)].Username + " Admin Help: ge, re, kick, clear, bg, game, name");
}
//} else if (command == "!news") {
//_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Life is getting better, working on Mafia, noting else!");
// Moderation
} else if (command == "!ge" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
_connection.Send("say", "/giveedit " + arg[1]);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " gave " + arg[1] + " edit.");
} else if (command == "!re" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
_connection.Send("say", "/removeedit " + arg[1]);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " removed " + arg[1] + " edit.");
//} else if (command == "!tp" && Players[m.GetInt(0)].Rank == 1) {
//_connection.Send("say", "/teleport " + arg[1] + arg[2] + arg[3]);
} else if (command == "!clear" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
_connection.Send("say", "/clear");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " cleared the world.");
} else if (command == "!load" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
_connection.Send("say", "/loadlevel");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " loaded the world.");
} else if (command == "!kick" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2) && arg[1].ToLower() != "anatoly") {
_connection.Send("say", "/fastkick " + arg[1] + " Kicked by " + Players[m.GetInt(0)].Username);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " kicked " + arg[1]);
//} else if (command == "!say" && Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2) {
//_connection.Send("say", "[Information] " + m.GetString(1).Substring(5, m.GetString(1).Length - 5));
} else if (command == "!bg" && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
if (arg[1] == "none") {
_connection.Send("say", "/bgcolor none");
/*} else if (arg[1] == "") {
_connection.Send("say", "/bgcolor ");*/
} else if (arg[1] == "pink") {
_connection.Send("say", "/bgcolor ff5f7f");
} else if (arg[1] == "green") {
_connection.Send("say", "/bgcolor 5fff5f");
} else if (arg[1] == "cyan") {
_connection.Send("say", "/bgcolor 40e0d0");
} else if (arg[1] == "red") {
_connection.Send("say", "/bgcolor ff1a1a");
} else if (arg[1] == "blue") {
_connection.Send("say", "/bgcolor 3333ff");
} else if (arg[1] == "yellow") {
_connection.Send("say", "/bgcolor e6e600");
} else if (arg[1] == "brown") {
_connection.Send("say", "/bgcolor 994d00");
} else if (arg[1] == "purple") {
_connection.Send("say", "/bgcolor 800080");
} else if (arg[1] == "orange") {
_connection.Send("say", "/bgcolor ff751a");
} else if (arg[1] == "turquoise") {
_connection.Send("say", "/bgcolor 2e7dff");
} else if (arg[1] == "darkred") {
_connection.Send("say", "/bgcolor 5f0000");
} else if (arg[1] == "darkgreen") {
_connection.Send("say", "/bgcolor 005f00");
} else if (arg[1] == "darkblue") {
_connection.Send("say", "/bgcolor 00005f");
} else if (arg[1] == "black") {
_connection.Send("say", "/bgcolor 000000");
} else if (arg[1] == "white") {
_connection.Send("say", "/bgcolor ffffff");
} else if (arg[1] == "gray" || arg[1] == "grey") {
_connection.Send("say", "/bgcolor 7f7f7f");
} else if (arg[1] == "darkgray" || arg[1] == "darkgrey") {
_connection.Send("say", "/bgcolor 151515");
} else if (arg[1] == "list") {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Colors: pink, green, cyan, red, blue, yellow, brown, purple, orange, darkred, darkgreen, darkblue, black, white, gray, darkgray, turquoise");
} else {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Say '!bg list' to get all existing values!");
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " used '!bg' as '" + arg[1] + "'");
} else if (arg[0] == "!name" && (Players[m.GetInt(0)].Rank == 2)) {
string name = m.GetString(1).Substring(6, m.GetString(1).Length - 6);
_connection.Send("name", name);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " changed world name to: " + name);
} else if (arg[0] == "!closeroom" && (Players[m.GetInt(0)].Rank == 2)) {
// ALPHA
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("ROOM CLOSED");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
foreach(KeyValuePair<int, Player> p in Players) {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " Room closed by " + Players[m.GetInt(0)].Username);
}
} else if (command == "!game" && (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1)) {
// Null
if (arg[1] == "null" || arg[1] == "none" || arg[1] == "afk") {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + ": ... is now pausing!");
GameType = 0;
// Setting Operation
} else if (arg[1] == "list") {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " List: null(Afk), snake (Boss to Code), edit (Art Level), drawmy (Draw my Thing), move (Move Bot)");
// Boss To Code
} else if (arg[1] == "snake" || arg[1] == "1" || arg[1] == "boss") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: Boss to Code.");
GameType = 1;
// Art Level
} else if (arg[1] == "edit" || arg[1] == "2" || arg[1] == "art") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: Art Level");
GameType = 2;
} else if (arg[1] == "drawmy" || arg[1] == "3" || arg[1] == "dmt") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: Draw my thing.");
GameType = 3;
} else if (arg[1] == "mafia" || arg[1] == "4" || arg[1] == "m") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: Mafia (Werewolf).");
GameType = 4;
} else if (arg[1] == "move" || arg[1] == "5" || arg[1] == "mbt") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: MoveBot");
GameType = 5;
} else if (arg[1] == "coin" || arg[1] == "6" || arg[1] == "c") {
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " Mode: CoinHack");
GameType = 6;
} else {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode doesn't exist! Try '!game list' for existing modes!");
//_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Modes: snake, null");
}
} else if (command == "!console" && (Players[m.GetInt(0)].Username == Hoster)) {
if (arg[1] == "list") {
if (arg[2] == "reports") {
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("Reports List");
Console.WriteLine("=====================================================================");
foreach(KeyValuePair<int, Report> r in Reports) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Report #" + r.Value.Id);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Issued by: ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(r.Value.ByUser);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Content: ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(r.Value.Content);
}
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("=====================================================================");
Console.WriteLine();
Thread.Sleep(100);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " All Reports listed!");
} else if (arg[2] == "players") {
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("Players List");
Console.WriteLine("=====================================================================");
foreach(KeyValuePair<int, Player> p in Players) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(p.Value.Username);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("ID: ");
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine(p.Value.Id);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("AFK: ");
if (p.Value.Afk == true) {
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine("true");
} else {
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("false");
}
Console.ForegroundColor = ConsoleColor.White;
Console.Write("RANK: ");
if (p.Value.Rank == 0) {
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("member");
} else if (p.Value.Rank == 1) {
Console.ForegroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("moderator");
} else if (p.Value.Rank == 2) {
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("adminstrator");
}
}
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("=====================================================================");
Console.WriteLine();
Thread.Sleep(100);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " All Players listed!");
}
} else if (arg[1] == "clear") {
Console.Clear();
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("Console cleared!");
Thread.Sleep(100);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Console cleared!");
}
// GameType 1: Boss To Code
} else if (command == "!boss" && GameType == 1
&& /*(Players[m.GetInt(0)].Rank == 1 ||*/ Players[m.GetInt(0)].Rank == 2) {
// TO-DO: Got this for StackOverflow: int salaryCounter = int.Parse(athleteSalary)
if (arg[1].ToLower() == "platform") {
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOSS");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " created a platform in mode " + GameType_Snake_Mode + ".");
Thread.Sleep(150);
if (GameType_Snake_Mode == 1) { // Basic
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 10);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 611);
}
} else if (GameType_Snake_Mode == 2) { // Checker
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 186);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 513);
}
} else if (GameType_Snake_Mode == 3) { // Bricks
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 1022);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 646);
}
} else if (GameType_Snake_Mode == 4) { // Ruins
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 195);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 617);
}
} else if (GameType_Snake_Mode == 5) { // Sand
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 142);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 584);
}
} else if (GameType_Snake_Mode == 6) { // Glass
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 54);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 531);
}
} else if (GameType_Snake_Mode == 7) { // Mineral
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 72);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 606);
}
} else if (GameType_Snake_Mode == 8) { // Tiles
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 1108);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 735);
}
} else if (GameType_Snake_Mode == 9) { // Rocket
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 172);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 601);
}
} else if (GameType_Snake_Mode == 10) { // Fairy Tale
Random r = new Random();
int[] b_ids = new [] {704, 705, 706, 707};
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 1070);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, b_ids[r.Next(0, b_ids.Length)]);
}
} else if (GameType_Snake_Mode == 11) { // Gemstone
Random r = new Random();
int[] b_ids = new [] {666, 665, 664, 663, 609, 608};
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 1077, 2);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, b_ids[r.Next(0, b_ids.Length)]);
}
} else if (GameType_Snake_Mode == 12) { // Iron
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 29);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 598);
}
} else if (GameType_Snake_Mode == 13) { // Keys
Random r = new Random();
int[] b_ids = new [] {23, 24, 25, 1005, 1006, 1007, 26, 27, 28, 1008, 1009, 1010};
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, b_ids[r.Next(0, b_ids.Length)]);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 744);
}
} else if (GameType_Snake_Mode == 14) { // Beta
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 41);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 697);
}
} else if (GameType_Snake_Mode == 15) { // Lava
for (int i = 0; i <= 27; i++) {
Thread.Sleep(35);
_connection.Send("b", 1, 6 + i, 21, 204);
Thread.Sleep(35);
_connection.Send("b", 0, 6 + i, 21, 682);
}
}
} else if (arg[1].ToLower() == "break") {
List<int> blocks = new List<int>();
Random r = new Random();
for (int i = 0; i <= 20; i++) {
blocks.Add(r.Next(6, 34));
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOSS");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " broke the platform in mode " + GameType_Snake_Mode + ".");
Console.ForegroundColor = ConsoleColor.White;
Console.Write("\tPositions: ");
int n = 0;
foreach (var pos in blocks) {
n = n + 1;
if (n == 1 && GameType_Snake_Mode != 13) {
Console.Write(pos);
} else if (GameType_Snake_Mode != 13) {
Console.Write(", " + pos);
}
Thread.Sleep(35);
if (GameType_Snake_Mode == 1) {
_connection.Send("b", 1, pos, 21, 14);
} else if (GameType_Snake_Mode == 2) {
_connection.Send("b", 1, pos, 21, 191);
} else if (GameType_Snake_Mode == 3) {
_connection.Send("b", 1, pos, 21, 19);
} else if (GameType_Snake_Mode == 4) {
_connection.Send("b", 1, pos, 21, 198);
} else if (GameType_Snake_Mode == 5) {
_connection.Send("b", 1, pos, 21, 140);
} else if (GameType_Snake_Mode == 6) {
_connection.Send("b", 1, pos, 21, 56);
} else if (GameType_Snake_Mode == 7) {
_connection.Send("b", 1, pos, 21, 74);
} else if (GameType_Snake_Mode == 8) {
_connection.Send("b", 1, pos, 21, 1112);
} else if (GameType_Snake_Mode == 9) {
_connection.Send("b", 1, pos, 21, 174);
} else if (GameType_Snake_Mode == 10) {
_connection.Send("b", 1, pos, 21, 1072);
} else if (GameType_Snake_Mode == 11) {
_connection.Send("b", 1, pos, 21, 1076, 2);
} else if (GameType_Snake_Mode == 12) {
_connection.Send("b", 1, pos, 21, 31);
} else if (GameType_Snake_Mode == 14) {
_connection.Send("b", 1, pos, 21, 38);
} else if (GameType_Snake_Mode == 15) {
_connection.Send("b", 1, pos, 21, 203);
}
}
if (GameType_Snake_Mode == 13) {
int red = r.Next(6, 34);
int green = r.Next(6, 34);
int blue = r.Next(6, 34);
int cyan = r.Next(6, 34);
int purple = r.Next(6, 34);
int yellow = r.Next(6, 34);
Thread.Sleep(15);
_connection.Send("b", 1, red, 18, 6);
Thread.Sleep(15);
_connection.Send("b", 1, green, 18, 7);
Thread.Sleep(15);
_connection.Send("b", 1, blue, 18, 8);
Thread.Sleep(15);
_connection.Send("b", 1, cyan, 18, 408);
Thread.Sleep(15);
_connection.Send("b", 1, purple, 18, 409);
Thread.Sleep(15);
_connection.Send("b", 1, yellow, 18, 410);
Console.ForegroundColor = ConsoleColor.Red;
Console.Write(red + " ");
Console.ForegroundColor = ConsoleColor.Green;
Console.Write(green + " ");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write(blue + " ");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write(cyan + " ");
Console.ForegroundColor = ConsoleColor.Magenta;
Console.Write(purple + " ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write(yellow + " ");
}
Console.WriteLine();
/* It then removes your blocks.
Thread.Sleep(1000);
for (int i = 0; i <= 27; i++) {
Thread.Sleep(20);
_connection.Send("b", 1, 6 + i, 21, 10);
}
*/
} else if (arg[1].ToLower() == "mode") {
Thread.Sleep(25);
if (arg[2] == "1" || arg[2] == "basic") {
GameType_Snake_Mode = 1;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Basic'!");
} else if (arg[2] == "2" || arg[2].ToLower() == "checker") {
GameType_Snake_Mode = 2;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Checker'");
} else if (arg[2] == "3" || arg[2].ToLower() == "brick") {
GameType_Snake_Mode = 3;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Brick'");
} else if (arg[2] == "4" || arg[2].ToLower() == "jungle") {
GameType_Snake_Mode = 4;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Jungle'");
} else if (arg[2] == "5" || arg[2].ToLower() == "sand") {
GameType_Snake_Mode = 5;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Sand'");
} else if (arg[2] == "6" || arg[2].ToLower() == "glass") {
GameType_Snake_Mode = 6;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Glass'");
} else if (arg[2] == "7" || arg[2].ToLower() == "mineral") {
GameType_Snake_Mode = 7;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Mineral' (Easy)");
} else if (arg[2] == "8" || arg[2].ToLower() == "tiles") {
GameType_Snake_Mode = 8;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Tiles'");
} else if (arg[2] == "9" || arg[2].ToLower() == "rocket") {
GameType_Snake_Mode = 9;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Rocket'");
} else if (arg[2] == "10" || arg[2].ToLower() == "fairytale") {
GameType_Snake_Mode = 10;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Fairy Tale'");
} else if (arg[2] == "11" || arg[2].ToLower() == "gemstone") {
GameType_Snake_Mode = 11;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Gemstone' Warning! This Mode is brocken!");
} else if (arg[2] == "12" || arg[2].ToLower() == "iron") {
GameType_Snake_Mode = 12;
Thread.Sleep(150);
} else if (arg[2] == "12" || arg[2].ToLower() == "iron") {
GameType_Snake_Mode = 12;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Iron'");
} else if (arg[2] == "13" || arg[2].ToLower() == "keys") {
GameType_Snake_Mode = 13;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Keys' Note! This is a special mode. It works only good with much players");
} else if (arg[2] == "14" || arg[2].ToLower() == "beta") {
GameType_Snake_Mode = 14;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Beta'");
} else if (arg[2] == "15" || arg[2].ToLower() == "lava") {
GameType_Snake_Mode = 15;
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode: 'Lava'");
} else if (arg[2] == "list") {
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " List: basic, checker, brick, jungle, sand, glass, mineral, tiles, rocket, fairytale, gemstone, iron, keys");
} else {
Thread.Sleep(150);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Mode doesn't exist! Use 'list' as second argument, to get a list of existing values!");
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOSS");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " used 'mode' to: " + GameType_Snake_Mode + ".");
}
// GameType 2: Edit
} else if (command == "!gainedit" && GameType == 2) {
_connection.Send("say", "/giveedit " + Players[m.GetInt(0)].Username);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("ART WORLD");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " gained edit.");
} else if (command == "!follow" && GameType == 2 && (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)) {
_connection.Send("say", "[Bot] Following: " + arg[1]);
Follow = arg[1];
// Game Type 3: Draw My Thing
} else if ((command == "!setturn" && GameType == 3)
&& (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)
&& (arg[1] != Hoster)
) {
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == arg[1].ToLower()) {
selectedUser = p.Value.Id;
break;
}
}
_connection.Send("say", "[DrawMyThing] " + Players[selectedUser].Username + " is drawing!");
GameType_DMT_PlayerEditing = selectedUser;
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length) ];
// PM the word
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[selectedUser].Username + " Your word is: " + GameType_DMT_WordNow);
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[selectedUser].Username + " was made drawer by "+ Players[m.GetInt(0)].Username +"!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + GameType_DMT_PlayerEditing);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
//Thread.Sleep(350);
//_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " You chose " + Players[selectedUser].Username);
} else if ((command == "!skip" && GameType == 3)
&& (Players[m.GetInt(0)].Rank == 1 || Players[m.GetInt(0)].Rank == 2)
) {
List<int> listed = new List<int>();
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Afk == false) {
//listed[p] = Players[p.Value.Id].Id;
//listed[p] = p.Value.Id;
listed.Add(p.Value.Id);
}
}
if (listed.Count >= 2) {
int selectedUser = listed[new Random().Next(0, listed.Count)];
GameType_DMT_PlayerEditing = selectedUser;
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length)];
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " You have been chosen randomly! Your word is: " + GameType_DMT_WordNow);
Thread.Sleep(500);
_connection.Send("say", "[DrawMyThing] " + Players[GameType_DMT_PlayerEditing].Username + " became drawer!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[selectedUser].Username + " was made drawer with '!skip' by " + Players[m.GetInt(0)].Username +"!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + GameType_DMT_PlayerEditing);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
} else if (listed.Count == 1) {
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length)];
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " Your word is: " + GameType_DMT_WordNow + " (It looks like nobody else is in room)");
Thread.Sleep(500);
_connection.Send("say", "[DrawMyThing] " + Players[GameType_DMT_PlayerEditing].Username + " became drawer with 'skip'!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[GameType_DMT_PlayerEditing].Username + " was made drawer with '!skip' by "+ Players[m.GetInt(0)].Username +"!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + GameType_DMT_PlayerEditing);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
} else if (listed.Count == 0) {
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Everyone looks like being afk! You can't skip!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[m.GetInt(0)].Username +" tried to make someone drawer with '!skip', although everyone is afk!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: --");
Console.WriteLine("\tWord: --");
}
} else if ((command == "!forceskip" && GameType == 3)
&& (Players[m.GetInt(0)].Rank == 2)
) {
GameType_DMT_PlayerEditing = m.GetInt(0);
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length)];
Thread.Sleep(500);
_connection.Send("say", "/loadlevel");
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " Your word is: " + GameType_DMT_WordNow);
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[GameType_DMT_PlayerEditing].Username + " forceskipped!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + GameType_DMT_PlayerEditing);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
} else if ((command == "!getword" && GameType == 3)
&& (Players[m.GetInt(0)].Rank == 2)
) {
Thread.Sleep(350);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Word is: " + GameType_DMT_WordNow);
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[GameType_DMT_PlayerEditing].Username + " received the word!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + GameType_DMT_PlayerEditing);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
} else if ((command == "!tellword" && GameType == 3)
&& (Players[GameType_DMT_PlayerEditing].Username == Players[m.GetInt(0)].Username)
) {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Word is: " + GameType_DMT_WordNow);
} else if ((command == "!changeword" && GameType == 3)
&& (Players[GameType_DMT_PlayerEditing].Username == Players[m.GetInt(0)].Username)
) {
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length) ];
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " Your new word is: " + GameType_DMT_WordNow);
Thread.Sleep(500);
_connection.Send("/loadlevel");
Console.WriteLine("<DrawMyThing> " + Players[GameType_DMT_PlayerEditing].Username + " changed the word!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tNew Word: " + GameType_DMT_WordNow);
// GameType 4: Mafia
} else if (command == "!mafia" && Players[m.GetInt(0)].Rank == 2 && GameType == 4) {
if (arg[1] == "start") { // Second Stage
GameType_Mafia_state = 2;
Thread.Sleep(500);
_connection.Send("say", "[Bot] Sign Ups are closed! Game starts!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<Mafia> " + Players[m.GetInt(0)].Username + " closed sign ups! Game starts!");
} else if (arg[1] == "signup") { // First Stage
GameType_Mafia_state = 1;
Thread.Sleep(500);
_connection.Send("say", "[Bot] Sign Ups will be now taken! Use '!signup' to join!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<Mafia> " + Players[m.GetInt(0)].Username + " started Sign Ups!");
}
} else if (command == "!signup" && GameType == 4 && GameType_Mafia_state == 1) {
if (Players[m.GetInt(0)].Mafia_SignedUp == false) {
GameType_Mafia_SignedUp.Add(m.GetInt(0));
Players[m.GetInt(0)].Mafia_SignedUp = true;
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " You signed up succesfully! Do not rejoin the world anymore!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<Mafia> " + Players[m.GetInt(0)].Username + " signed up!");
} else {
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " You already signed up!");
}
} else if (command == "!night" && GameType_Mafia_state == 2 && (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1)) {
Thread.Sleep(500);
_connection.Send("say", "[Mafia] Night begins! Morning will start automatically!");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<Mafia> " + Players[m.GetInt(0)].Username + " opened Night Mode!");
// Game Type 5: MoveBot
} else if (command == "!move" && GameType == 5 && (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1)) {
if (arg[1] == "box") {
for (int i = 0; i <= 29; i++) {
Thread.Sleep(3);
_connection.Send("b", 1, 5 + i, 5, 22);
Thread.Sleep(3);
_connection.Send("b", 1, 5 + i, 24, 22);
}
for (int i = 0; i <= 18; i++) {
Thread.Sleep(3);
_connection.Send("b", 1, 5, 5 + i, 22);
Thread.Sleep(3);
_connection.Send("b", 1, 34, 5 + i, 22);
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("MOVE BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " makes the box.");
} else if (arg[1] == "terrain") {
for (int i = 0; i <= 27; i++) {
for (int j = 0; j <= 17; j++) {
Thread.Sleep(3);
_connection.Send("b", 1, 6 + i, 6 + j, 4);
}
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("MOVE BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " makes the gravity field.");
} else if (arg[1] == "blocks") {
/*
List<int> blocks = new List<int>();
Random r = new Random();
for (int i = 0; i <= 20; i++) {
blocks.Add(r.Next(6, 33));
}
foreach (var pos in blocks) {
...
}
*/
Random r = new Random();
for (int i = 0; i <= 27; i++) {
Thread.Sleep(3);
_connection.Send("b", 1, 6 + i, r.Next(6, 24), b_ids[r.Next(b_ids.Length)]);
Thread.Sleep(3);
_connection.Send("b", 1, 6 + i, r.Next(6, 24), b_ids[r.Next(b_ids.Length)]);
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("MOVE BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " started the generation of randomly positioned blocks.");
}
// Coin Hack
} else if (command == "!coinhack" && GameType == 6 && (Players[m.GetInt(0)].Rank == 2 || Players[m.GetInt(0)].Rank == 1)) {
// Build horizontal border
for (int i = 0; i <= 25; i++) {
Thread.Sleep(15);
_connection.Send("b", 1, 7 + i, 8, 1099);
Thread.Sleep(15);
_connection.Send("b", 1, 7 + i, 20, 1099);
}
// Build vertical border
for (int i = 0; i <= 10; i++) {
Thread.Sleep(15);
_connection.Send("b", 1, 7, 9 + i, 1100);
Thread.Sleep(15);
_connection.Send("b", 1, 32, 9 + i, 1100);
}
// Build horizontal middle levels
for (int i = 0; i <= 23; i++) {
//if (i == 12) {} else {
Thread.Sleep(15);
_connection.Send("b", 1, 8 + i, 10, 1099);
Thread.Sleep(15);
_connection.Send("b", 1, 8 + i, 12, 1099);
Thread.Sleep(15);
_connection.Send("b", 1, 8 + i, 14, 1099);
Thread.Sleep(15);
_connection.Send("b", 1, 8 + i, 16, 1099);
Thread.Sleep(15);
_connection.Send("b", 1, 8 + i, 18, 1099);
//}
}
// Coins
for (int i = 0; i <= 11; i++) {
for (int j = 0; j <= 5; j++) {
if (i > 5) {
Thread.Sleep(15);
_connection.Send("b", 1, 9 + 2 * i, 9 + 2 * j, 100);
} else {
Thread.Sleep(15);
_connection.Send("b", 1, 8 + 2 * i, 9 + 2 * j, 100);
}
}
}
// Build elevators.
for (int i = 0; i <= 10; i++) {
Thread.Sleep(15);
_connection.Send("b", 1, 20, 9 + i, 4);
Thread.Sleep(15);
_connection.Send("b", 1, 19, 9 + i, 4);
Thread.Sleep(15);
_connection.Send("b", 1, 9, 9 + i, 4);
Thread.Sleep(15);
_connection.Send("b", 1, 30, 9 + i, 4);
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("COIN HACK");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " makes the coinhack platform.");
// Members
} else if (command == "!afk") {
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == Players[m.GetInt(0)].Username) {
selectedUser = p.Value.Id;
p.Value.Afk = true;
break;
}
}
_connection.Send("say", "/pm " + Players[selectedUser].Username + " You are now afk!");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("BOT");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username + " went AFK!");
} else if (command == "!report") {
cReport = cReport + 1; // The next id.
string c = m.GetString(1).Substring(8, m.GetString(1).Length - 8);
Report rep = new Report(cReport, m.GetInt(0), c);
Reports.Add(rep.Id, rep);
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Report #" + Reports[rep.Id].Id);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("\tBy: ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(Players[m.GetInt(0)].Username);
Console.ForegroundColor = ConsoleColor.White;
Console.Write("\tContent: ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(c);
Console.WriteLine();
Thread.Sleep(350);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Report was submitted!");
} else if (command == "!myid") {
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " UserId: " + Players[m.GetInt(0)].ConnectID + " RoomUserId: " + m.GetInt(0));
// If somebody is simple stupid
} else if (command == "!kickme") {
_connection.Send("say", "/fastkick " + Players[m.GetInt(0)].Username + " Requested a kick!");
//Normal Chat
} else {
// Speech
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("<");
Console.ForegroundColor = ConsoleColor.Green;
Console.Write(Players[m.GetInt(0)].Username);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(m[1]);
// Error commands
string c = m.GetString(1).Substring(0, 1);
if (c == "." || c == "@" || c == "?" || c == "~") {
Thread.Sleep(100);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " The prefix for our commands is '!'. Please say '!help' for more.");
} else if (c == "/") {
Thread.Sleep(100);
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + " is a hacker!");
}
//Speaking while drawer
if (GameType == 3 && Players[GameType_DMT_PlayerEditing].Username == Players[m.GetInt(0)].Username) {
GameType_DMT_WordNow = "unknown";
GameType_DMT_PlayerEditing = 0;
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + ": You broke the rules! Speaking is not allowed while being drawer!");
// Chose new player!
List<int> listed = new List<int>();
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Afk == false) {
//listed[p] = Players[p.Value.Id].Id;
//listed[p] = p.Value.Id;
listed.Add(p.Value.Id);
}
}
if (listed.Count >= 2) {
int selectedUser = listed[new Random().Next(0, listed.Count)];
GameType_DMT_PlayerEditing = selectedUser;
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length)];
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " You have been chosen because some spoke! Speaking is not allowed! Your word is: " + GameType_DMT_WordNow);
Thread.Sleep(500);
_connection.Send("say", "[DrawMyThing] " + Players[GameType_DMT_PlayerEditing].Username + " became drawer!");
} else if (listed.Count == 1) {
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length)];
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[GameType_DMT_PlayerEditing].Username + " Your word is: " + GameType_DMT_WordNow + " (It looks like nobody else is in room)");
Thread.Sleep(500);
_connection.Send("say", "[DrawMyThing] " + Players[GameType_DMT_PlayerEditing].Username + " became drawer!");
} else if (listed.Count == 0) {
Thread.Sleep(500);
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " Everyone looks like being afk! You can't skip!");
}
}
// Guessing word without !word command
/*if (arg[0] == GameType_DMT_WordNow && Players[GameType_DMT_PlayerEditing].Username != Players[m.GetInt(0)].Username) {
_connection.Send("say", "[DrawMyThing] " + Players[m.GetInt(0)].Username + " won!");
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == Players[m.GetInt(0)].Username) {
selectedUser = p.Value.Id;
break;
}
}
GameType_DMT_PlayerEditing = selectedUser;
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length) ];
Thread.Sleep(350);
_connection.Send("say", "/pm " + Players[selectedUser].Username + " Your word is: " + GameType_DMT_WordNow);
Thread.Sleep(350);
_connection.Send("say", "loadlevel");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[selectedUser].Username + " is drawing!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + selectedUser);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
}*/
/*if (m[1] == GameType_DMT_WordNow && Players[GameType_DMT_PlayerEditing].Username != Players[m.GetInt(0)].Username && GameType == 3) {
GameType_DMT_WordNow = "unknown";
GameType_DMT_PlayerEditing = 0;
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + ": You broke the rules! Speaking is not allowed while being drawer!");
}*/
}
}
// Speaking while drawer
/*if (GameType == 3 && Players[GameType_DMT_PlayerEditing].Username == Players[m.GetInt(0)].Username) {
Thread.Sleep(200);
GameType_DMT_WordNow = "unknown";
GameType_DMT_PlayerEditing = 0;
Thread.Sleep(100);
_connection.Send("say", "[Bot] @" + Players[m.GetInt(0)].Username + ": You broke the rules! Speaking is not allowed while being drawer!");
}*/
if (arg[0].ToLower() == GameType_DMT_WordNow && GameType == 3) {
Thread.Sleep(500);
_connection.Send("say", "[DrawMyThing] " + Players[m.GetInt(0)].Username + " won!");
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == Players[m.GetInt(0)].Username) {
selectedUser = p.Value.Id;
break;
}
}
GameType_DMT_PlayerEditing = selectedUser;
GameType_DMT_WordNow = GameType_DMT_Words[new Random().Next(0, GameType_DMT_Words.Length) ];
Thread.Sleep(400);
_connection.Send("say", "/pm " + Players[selectedUser].Username + " Your word is: " + GameType_DMT_WordNow);
Thread.Sleep(400);
_connection.Send("say", "/loadlevel");
Thread.Sleep(400);
_connection.Send("say", "/giveedit " + Players[selectedUser].Username + "");
Thread.Sleep(400);
_connection.Send("say", "/pm " + Players[selectedUser].Username + " Remember! Speaking is not allowed as drawer! For more infos go to '!help'");
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("<DrawMyThing> " + Players[selectedUser].Username + " is drawing!");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\tId: " + selectedUser);
Console.WriteLine("\tWord: " + GameType_DMT_WordNow);
}
break;
}
}
static void connectionFail(PlayerIOError error)
{
Console.WriteLine("Can't connect, reason: " + error.Message);
}
}
}
class Player
{
public int Id;
public string Username;
public int Rank;
public bool Afk;
public bool Mafia_SignedUp = false;
public string ConnectID;
public Player(int _Id, string _Username, string _ConnectId) {
//General
Id = _Id;
Username = _Username;
Afk = true;
ConnectID = _ConnectId;
//Adminstrator
/*
* !name
* !getword
*/
if (
ConnectID == "simple1492590671667x87" // anatoly
|| Username == "lee77"
|| ConnectID == "simple1487276151399x66" // doomester
) {
Rank = 2;
// Moderator
/*
* !ge / !re
* !kick
* !clear
* !bg
* !game command
* Game3: !setturn
*/
} else if (
Username == "peace" // ?
|| Username == "realmaster42" // ?
|| Username == "matthijsfidder" // Guard
|| Username == "thetriplet" // ?
//|| Username == "orko" // Mod
) {
Rank = 1;
/*} else if (
ConnectID == "simple1489088519045x43" // Excoluss + Banning me
){
Rank = -1;*/
// PermBanned [KICKED ON JOIN]
} else if (
Username == "iguesti" // Demoted Mod
|| Username == "anatolykickme" // RM's Alt
|| Username == "eehacked" // Harasment
|| Username == "killer12" // Content
|| Username == "lambapea" // Troll
//|| Username == "beandanika" // Saying my remake is bad + A banning fight
){
Rank = -2;
// Bad named [KICKED ON JOIN]
} else if (
Username == "<snip>"
|| Username == "<snip>"
|| Username == "nigger"
){
Rank = -3;
// Member
/*
* User without special permissions
*/
} else {
Rank = 0;
}
}
}
class Report
{
public int Id;
public int ByUser;
public string Content;
public Report(int _Id, int _ByUser, string _c) {
Id = _Id;
ByUser = _ByUser;
Content = _c;
}
}
DMT (I started coding)
using System;
using System.Threading;
using System.Collections.Generic;
using PlayerIOClient;
using System.IO;
namespace EEBot
{
class Program
{
public static Client _client;
public static Connection _connection;
// Edit this values
public static string roomid = "PWRngvmEVLQ"; //PWRngvmEVLQ
static int BotId; // The Id of the Bot User
static Dictionary<int, Player> Players = new Dictionary<int, Player>(); // All players in room
static int PlayersTurn = 0;
static string[] Words = new string[]{
"apple", "television", "wizard"
};
static string CurrentWord = "unknown";
//<-- GameTypes end -->//
static void Main(string[] args)
{
// eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw, everybody-edits-su9rn58o40itdbnw69plyw;
PlayerIO.QuickConnect.SimpleConnect("eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw", "email", "password", null, loginSuccess, loginFail);
Console.ReadKey();
}
static void loginSuccess(Client client)
{
_client = client;
Console.WriteLine("Logged in!");
client.Multiplayer.CreateJoinRoom(roomid, roomid.StartsWith("BW") ? "Beta" : "Everybuildexists" + client.BigDB.Load("config", "data")["version"], true, null, null, connectionSuccess, connectionFail);
}
static void loginFail(PlayerIOError error)
{
Console.WriteLine("Can't login, reason: " + error.Message);
}
static void connectionSuccess(Connection con)
{
_connection = con;
Console.WriteLine("Connected!");
con.Send("init");
con.OnMessage += Con_OnMessage;
}
static bool command(string arg, string com) {
if (
arg.StartsWith("!") ||
arg.StartsWith(".") ||
arg.StartsWith("-")
) {
if (arg.Remove(0, 1).ToLower() == com.ToLower()) {
return true;
}
}
return false;
// return arg.EndsWith(com); – Suggested by Bene
}
static void say(string text) {
Thread.Sleep(350);
_connection.Send("say", "<dmt> " + text);
}
static void pm(int user, string text) {
Thread.Sleep(350);
_connection.Send("say", "/pm " + Players[user].Username + " " + text);
}
static void randomWord() {
CurrentWord = Words[new Random().Next(0, Words.Length) ];
}
private static void Con_OnMessage(object sender,PlayerIOClient.Message m)
{
switch (m.Type)
{
case "init":
_connection.Send("init2");
BotId = m.GetInt(5);
break;
case "init2":
Console.WriteLine("Joined the room!");
say("Connected!");
break;
case "add":
Player player = new Player(m.GetInt(0), m.GetString(1), m.GetString(2), m.GetBoolean(6), m.GetBoolean(24));
Players.Add(player.Id, player);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(m[1] + " in Room!");
Console.ForegroundColor = ConsoleColor.White;
Thread.Sleep(100);
break;
case "left":
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(Players[m.GetInt(0)].Username + " left!");
Players.Remove(m.GetInt(0));
break;
case "editRights":
Players[m.GetInt(0)].Edit = m.GetBoolean(1);
break;
case "god":
Players[m.GetInt(0)].God = m.GetBoolean(1);
break;
case "b":
// Check if signs or labels were placed.
break;
case "m":
if (Players[m.GetInt(0)].Afk == true) {
Players[m.GetInt(0)].Afk = false;
_connection.Send("say", "/pm " + Players[m.GetInt(0)].Username + " You are no longer afk!");
}
break;
case "say":
string[] arg = m.GetString(1).Split(' ');
if (BotId == m.GetInt(0)) {
// Nothing.
} else {
if (command(arg[0], "help")) {
pm(m.GetInt(0), "This is a Draw My Thing bot by Anatoly.");
} else if (command(arg[0], "wins") && Players[m.GetInt(0)].Rank == 1) {
pm(m.GetInt(0), "You have won " + Players[m.GetInt(0)].Wins + " times!");
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == arg[1].ToLower()) {
selectedUser = p.Value.Id;
break;
}
}
if (arg[1] != null) {
pm(m.GetInt(0), Players[selectedUser].Username + " won " + Players[selectedUser].Wins + " times!");
}
} else if (command(arg[0], "turn")) {
int selectedUser = BotId;
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Username == arg[1].ToLower()) {
selectedUser = p.Value.Id;
break;
}
}
pm(m.GetInt(0), Players[selectedUser].Username + " is now drawing!");
pm(selectedUser, "You became drawer!");
randomWord();
pm(selectedUser, "Word: " + CurrentWord);
PlayersTurn = selectedUser;
} else if (command(arg[0], "skip") && Players[m.GetInt(0)].Rank == 1) {
List<int> listed = new List<int>();
foreach(KeyValuePair<int, Player> p in Players) {
if (p.Value.Afk == false) {
//listed[p] = Players[p.Value.Id].Id;
//listed[p] = p.Value.Id;
listed.Add(p.Value.Id);
}
}
if (listed.Count < 2) {
int selectedUser = listed[new Random().Next(0, listed.Count)];
PlayersTurn = selectedUser;
pm(m.GetInt(0), Players[selectedUser].Username + " is now drawing!");
pm(selectedUser, "You became drawer!");
randomWord();
pm(selectedUser, "Word: " + CurrentWord);
}
}
}
break;
}
}
static void connectionFail(PlayerIOError error)
{
Console.WriteLine("Can't connect, reason: " + error.Message);
}
}
}
class Player
{
public int Id;
public string Username;
public int Rank;
public bool Afk = true;
public string ConnectID;
public int Wins = 0;
public bool God;
public bool Edit;
public Player(int _Id, string _Username, string _ConnectId, bool _g, bool _e) {
// General
Id = _Id;
Username = _Username;
ConnectID = _ConnectId;
// Set Rank
if (
ConnectID == "simple1492590671667x87" // anatoly
|| ConnectID == "simple1498410884520x89" // whitelover
//|| ConnectID == "simple1489088519045x43" // excoluss // STUPID MISTAKE
|| ConnectID == "simple1487276151399x66" // doomester
) {
Rank = 1;
} else {
Rank = 0;
}
}
}
Yeah, when using them (however, idc) please tell who coded. Thanks for all the good!