Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using PlayerIOClient;
- using System.IO;
- using System.Threading;
- using System.Text.RegularExpressions;
- using System.Net;
- using System.Collections;
- namespace EEArtistv21
- {
- public partial class Form1 : Form
- {
- private Connection con;
- private static Connection co;
- private string room;
- private string pass;
- private int accountOption = 1;
- public static int healer;
- public static int sickamount = 0;
- public static int woots = 0;
- string irritar = null;
- string myname = null;
- string nickname = null;
- Random randomanswer = new Random((int)(DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond));
- private static string seguido = null;
- private static string imitado = null;
- private static string worldkey = "";
- private static bool isFirstMovement = false;
- private static double XPosDifference = 0;
- private static double YPosDifference = 0;
- private static double myPlayerPosX = 0;
- private static double myPlayerPosY = 0;
- private static bool chupando = true;
- private static string chupaomsg = "Dei {0} {1} {2} {3}";
- private static bool darrt = true;
- private static string GenderFileName = "gender.txt";
- private static string NickFileName = "nick.txt";
- private static Dictionary<string, bool> girls = new Dictionary<string, bool>();
- private static Dictionary<string, string> nicks = new Dictionary<string, string>();
- public static Dictionary<int, bool> ingame = new Dictionary<int, bool>();
- public static Dictionary<int, bool> sick = new Dictionary<int, bool>();
- public static Dictionary<int, string> players = new Dictionary<int, string>();
- public static Dictionary<string, int> playeridsbyname = new Dictionary<string, int>();
- delegate void SetTextCallback(string text);
- public const string wordRegex = "[a-zA-Z0-9_áàâãéèêíìîóòôõúùç]+";
- public const string wordRegex2 = "[a-z]+";
- public class Healer
- {
- public bool isAlive;
- public string name;
- public int id;
- public int heals;
- public static int maxhealsdefault = 7;
- public static int maxheals = maxhealsdefault;
- public void tellHeals()
- {
- //this.pmhealer(string.Format("You have {0} healing powers left!", this.heals));
- }
- public void pmhealer(string pmMessage)
- {
- //sendPM(this.name, pmMessage);
- }
- public bool exists()
- {
- return this.id != -1;
- }
- }
- public static Healer gameHealer;
- public static void sendPM(string playerName, string pmMessage)
- {
- string chat = String.Format("/pm {0} {1}", playerName, pmMessage);
- Debug.Print(chat);
- co.Send("say", chat);
- }
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- emailTextBox.Text = "pilherio7@gmail.com";
- passwordTextBox.Text = "joaovictoroliveira";
- healUpDown.Text = Healer.maxheals.ToString();
- roomIDTextBox.Text = "";
- addMod("alex18");
- addMod("tesla");
- addMod("explozion");
- addMod("cyclon2");
- addMod("gabiputinha");
- addMod("arkonagames");
- addMod("joaovictorcastro");
- }
- #region Detect login method
- private string detectMethod(string u, string p, string r)
- {
- if (accountOption == 1)
- {
- if (!string.IsNullOrEmpty(u) && u.Contains("@"))
- {
- if (!string.IsNullOrEmpty(p))
- {
- var roomID = detectRoom(r);
- if (!string.IsNullOrEmpty(roomID))
- {
- return null;
- }
- else
- {
- return "You need to add a room";
- }
- }
- else
- {
- return "You need to add your password";
- }
- }
- else
- {
- return "You need to add your E-mail";
- }
- }
- else if (accountOption == 2)
- {
- if (!string.IsNullOrEmpty(u))
- {
- var roomID = detectRoom(r);
- if (!string.IsNullOrEmpty(roomID))
- {
- return null;
- }
- else
- {
- return "You need to add a room";
- }
- }
- else
- {
- return "You need to add your AccessToken";
- }
- }
- else if (accountOption == 3)
- {
- if (!string.IsNullOrEmpty(u))
- {
- if (!string.IsNullOrEmpty(p))
- {
- var roomID = detectRoom(r);
- if (!string.IsNullOrEmpty(roomID))
- {
- return null;
- }
- else
- {
- return "You need to add a room";
- }
- }
- else
- {
- return "You need to add your GameAuthToken";
- }
- }
- else
- {
- return "You need to add your UserID";
- }
- }
- else if (accountOption == 4)
- {
- if (!string.IsNullOrEmpty(u))
- {
- if (!string.IsNullOrEmpty(p))
- {
- var roomID = detectRoom(r);
- if (!string.IsNullOrEmpty(roomID))
- {
- return null;
- }
- else
- {
- return "You need to add a room";
- }
- }
- else
- {
- return "You need to add your AuthToken";
- }
- }
- else
- {
- return "You need to add your UserID";
- }
- }
- return "Doesn't contains anything";
- }
- #endregion
- #region detect roomID
- private string detectRoom(string room)
- {
- if (room.StartsWith("http://") || room.StartsWith("www."))
- {
- Match m0 = Regex.Match(room, @"/games/(PW|BW)+[A-f0-9_-]{3,13}", RegexOptions.IgnoreCase);
- if (m0.Success)
- {
- return Convert.ToString(m0).Substring(7);
- }
- else
- {
- Match m00 = Regex.Match(room, @"/games/OW+[A-z0-9]{1,4}-.*", RegexOptions.IgnoreCase);
- if (m00.Success)
- {
- return Convert.ToString(m00).Substring(7).Replace("-", " ");
- }
- }
- return null;
- }
- else
- {
- Match m1 = Regex.Match(room, "(PW|BW)+[A-f0-9_-]{3,13}", RegexOptions.IgnoreCase);
- if (m1.Success)
- {
- return room;
- }
- else
- {
- Match m2 = Regex.Match(room, "OW+[A-z0-9]{1,4}-.*", RegexOptions.IgnoreCase);
- if (m2.Success)
- {
- return Convert.ToString(room).Replace("-", " ");
- }
- }
- return null;
- }
- }
- #endregion
- #region login
- private void login(string a, string b, string c, string d)
- {
- room = c;
- pass = d;
- PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", a, b, LoginSuccess, LoginFail);
- }
- #endregion
- private void LoginFail(PlayerIOClient.PlayerIOError error)
- {
- MessageBox.Show(error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- private void LoginSuccess(PlayerIOClient.Client cl)
- {
- try
- {
- con = cl.Multiplayer.JoinRoom(room, null);
- co = con;
- con.Send("init");
- con.OnMessage += new MessageReceivedEventHandler(onMessage);
- con.OnDisconnect += delegate(object sender, string reason)
- {
- this.SetConnectButton("Connect");
- };
- }
- catch (PlayerIOError error)
- {
- MessageBox.Show(error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void onMessage(object sender, PlayerIOClient.Message m)
- {
- switch (m.Type)
- {
- case "god":
- try
- {
- string pnamegod = players[m.GetInt(0)].ToLower();
- if (players.ContainsKey(m.GetInt(0)) && pnamegod == seguido && pnamegod == imitado)
- con.Send("god", m.GetBoolean(1));
- }
- catch (Exception)
- { }
- break;
- case "m":
- string moveusername;
- try
- {
- double PlayerPosX = m.GetDouble(1);
- double PlayerPosY = m.GetDouble(2);
- double SpeedX = m.GetDouble(3);
- double SpeedY = m.GetDouble(4);
- int ModifierX = m.GetInt(5);
- int ModifierY = m.GetInt(6);
- int Horizontal = m.GetInt(7);
- int Vertical = m.GetInt(8);
- double GravityMultiplier = 1;
- bool SpaceDown = m.GetBoolean(10);
- moveusername = players[m.GetInt(0)].ToLower();
- if (moveusername == imitado)
- {
- if (isFirstMovement)
- {
- XPosDifference = myPlayerPosX - PlayerPosX;
- YPosDifference = myPlayerPosY - PlayerPosY;
- isFirstMovement = false;
- }
- myPlayerPosX = PlayerPosX + XPosDifference;
- myPlayerPosY = PlayerPosY + YPosDifference;
- if (myPlayerPosX < 16)
- myPlayerPosX = 16;
- if (myPlayerPosY < 16)
- myPlayerPosY = 16;
- con.Send("m", myPlayerPosX, myPlayerPosY, SpeedX, SpeedY, ModifierX, ModifierY, Horizontal, Vertical, GravityMultiplier, SpaceDown);
- }
- else if (moveusername == seguido)
- {
- myPlayerPosX = PlayerPosX;
- myPlayerPosY = PlayerPosY;
- Debug.Print(PlayerPosX.ToString());
- Debug.Print(myPlayerPosX.ToString());
- con.Send("m", PlayerPosX, PlayerPosY, SpeedX, SpeedY, ModifierX, ModifierY, Horizontal, Vertical, GravityMultiplier, SpaceDown);
- }
- }
- catch (KeyNotFoundException e)
- {
- Debug.Print(String.Format("KeyNotFoundException: {0}", m.GetInt(0).ToString()));
- return;
- }
- return;
- case "team":
- Debug.Print(m.GetInt(1).ToString());
- return;
- case "add":
- players[m.GetInt(0)] = m.GetString(1);
- //ingame[m.GetInt(0)] = true;
- playeridsbyname[m.GetString(1)] = m.GetInt(0);
- return;
- case "write":
- string wmsg = m.GetString(1);
- string[] wsplit = wmsg.Split(new Char[] {'!', '.', ' '});
- string user = m.GetString(0).Split(new Char[] { ' ' })[1].ToLower();
- if (!isMod(user))
- break;
- if (wsplit.Length > 0 && isMod(user))
- {
- try
- {
- if ((wsplit[1].ToLower() == "code") && (wsplit[2] != null))
- con.Send("access", wsplit[2]);
- else if ((wsplit[1].ToLower() == "irritar") && (wsplit[2] != null))
- {
- if (wsplit[2].ToLower() == myname)
- {
- Thread.Sleep(1000);
- //con.Send("say", (user + ": eu vou irritar é você, seu palhaço")/*.ToUpper()*/);
- irritar = user;
- }
- else
- {
- irritar = wsplit[2].ToLower();
- Thread.Sleep(1000);
- //con.Send("say", ("agora vou irritar o " + irritar)/*.ToUpper()*/);
- }
- }
- else if (wmsg.StartsWith("*"))
- con.Send("say", wmsg.Remove(0, 1));
- else
- {
- Thread.Sleep(1000);
- con.Send("say", m.GetString(1)/*.ToUpper()*/);
- }
- if (woots > 0 && (wsplit[1] == "woot"))
- giveWoot();
- Thread.Sleep(1500);
- }
- catch (Exception) { }
- }
- Debug.WriteLine(user);
- Debug.WriteLine(wmsg);
- return;
- /*
- case "say_old":
- string msg2 = m.GetString(1);
- string username2;
- try
- {
- username2 = m.GetString(0).ToLower();
- }
- catch (Exception e)
- {
- return;
- }
- addChatText(string.Format("OLD: {0}: {1}", username2.ToUpper(), msg2));
- return;*/
- case "say":
- string msg = m.GetString(1);
- string msgLowered = msg.ToLower();
- string[] SplitMsg = msg.Split(new Char[] {'!', '.', ' '});
- string command = null;
- string username;
- string Username;
- try
- {
- command = SplitMsg[1].ToLower();
- }
- catch (Exception e)
- {
- }
- try
- {
- username = players[m.GetInt(0)].ToLower();
- Username = char.ToUpper(username[0]) + username.Substring(1);
- }
- catch (KeyNotFoundException e)
- {
- Debug.Print(String.Format("KeyNotFoundException: {0}", m.GetInt(0).ToString()));
- return;
- }
- //if (!isRoot(username))
- //return;
- addChatText(string.Format("{0}: {1}", username.ToUpper(), msg));
- if (username == myname)
- return;
- if (msgLowered.Contains(nickname) && msgLowered.EndsWith("?"))
- {
- int min = randomanswer.Next((new Random()).Next());
- int val = (77 * randomanswer.Next(min));
- int selectanswer = randomanswer.Next(min, val > min ? val : min) % 2;
- string answer = null;
- if (selectanswer == 0)
- answer = "Sim";
- else if (selectanswer == 1)
- answer = "Não";
- con.Send("say", answer);
- return;
- }
- Dictionary<string, bool> eae = new Dictionary<string, bool>{
- {"eae", true},
- {"oi", true},
- {"olá", true},
- {"ola", true},
- {"rola", true},
- {"e aí", true},
- {"e ae", true},
- {"arroiz testando", true}
- };
- if (eae.Contains(new KeyValuePair<string,bool>(msgLowered, true)))
- {
- con.Send("say", char.ToUpper(msgLowered[0]) + msgLowered.Substring(1) + " " + Username);
- return;
- }
- if (msg.ToLower() == "tchau")
- {
- con.Send("say", "Tchau " + Username);
- }
- string eu = "eu";
- if (msg.ToLower().StartsWith(eu) && msg.Length > eu.Length)
- {
- string tambemmsg = msg.Substring(eu.Length).Trim();
- con.Send("say", "Eu também " + tambemmsg);
- return;
- }
- if (username == irritar)
- {
- string irritarmsg = msg;
- con.Send("say", ((darrt ? (irritar + ": ") : "") + irritarmsg)/*.ToUpper()*/);
- }
- else
- if (isMod(username))
- {
- if (msg.StartsWith("*"))
- con.Send("say", msg.Substring(1));
- else if (msg.StartsWith("@"))
- con.Send("say", msg.Substring(1).ToUpper());
- }
- if ((isRoot(username) || chupando) && SplitMsg.Length >= 2 && (msg[0] == '!'))
- {
- string tipodechupada = null;
- string verb = "Dei";
- string pre = "um";
- string sufix = "n";
- string male = "o";
- string female = "a";
- if (command.Contains("chupar"))
- tipodechupada = "chupão";
- else if (command.Contains("beijar"))
- tipodechupada = "beijão";
- else if (command.Contains("lamber"))
- {
- pre = "uma";
- tipodechupada = "lambida";
- }
- else if (command.Contains("copular"))
- {
- verb = "";
- pre = "";
- tipodechupada = "Copulei";
- }
- else if (command.Contains("rabo"))
- {
- pre = "o";
- tipodechupada = "rabão";
- sufix = "pr";
- }
- else if (command.Contains("galinha"))
- {
- pre = "uma";
- tipodechupada = "galinha";
- sufix = "pr";
- }
- else if (command.Contains("fuder"))
- {
- pre = "uma";
- tipodechupada = "fudida";
- sufix = "n";
- }
- else if (command.Contains("morder"))
- {
- pre = "uma";
- tipodechupada = "mordida";
- }
- else if (command.Contains("oco"))
- {
- verb = "Deixei";
- pre = "o";
- tipodechupada = "oco";
- }
- string msgchupao = verb + " {0} {1} {2} {3}";
- if (command == "darrt")
- darrt = true;
- else if (command == "naodarrt")
- darrt = false;
- //else if (command.Contains("dar"))
- if (tipodechupada != null && SplitMsg.Length > 2)
- {
- string sendmsg = msg.Substring(SplitMsg[1].Length + 2);
- string pronoun = (sendmsg.Contains(myname) || command.EndsWith(female)) ? sufix + female : sufix + male;
- if (sendmsg.StartsWith("em"))
- {
- pronoun = "em";
- sendmsg = sendmsg.Substring(2);
- }
- if (sendmsg.StartsWith("a "))
- {
- pronoun = sufix + female;
- sendmsg = sendmsg.Substring(2);
- }
- if (sendmsg.StartsWith("o "))
- {
- sendmsg.Substring(2);
- }
- sendmsg = sendmsg.Trim();
- if ((SplitMsg[2].ToLower() == "eu" || SplitMsg[2].ToLower() == "gay") && SplitMsg.Length == 3)
- sendmsg = username;
- Thread.Sleep(200);
- con.Send("say", String.Format(msgchupao, pre, tipodechupada, pronoun, sendmsg));
- Thread.Sleep(1000);
- return;
- }
- }
- if (command == "significado" && msg.Length > 2)
- {
- string meaning = getMeaning(SplitMsg[2]);
- if (meaning != null)
- con.Send("say", ((meaning.Length > 140) ? meaning.Substring(0, 140) : meaning));
- }
- if (!(msg.StartsWith("-") && isMod(username)))
- {
- string reply = msg.ToLower();
- string nick = myname.Substring(0, 4);
- if (reply.Contains(nick))
- {
- MatchCollection allwords = Regex.Matches(reply, wordRegex2, RegexOptions.IgnoreCase);
- foreach (Match match in allwords)
- {
- string word = match.Value;
- try
- {
- if (word != "" && word.Length > 1)
- {
- bool isFeminine = word[word.Length - 1] == 'a';
- string antonym = null;
- if (isFeminine)
- antonym = getAntonym(word.Substring(0, word.Length - 1) + "o");
- if (antonym == "" || antonym == null)
- antonym = getAntonym(word);
- if (antonym != null && antonym != "" && antonym.Length > 1)
- {
- if (isFeminine)
- antonym = antonym.Substring(0, antonym.Length - 1) + "a";
- reply = reply.Replace(word, antonym);
- }
- }
- }
- catch (Exception e)
- {
- Debug.Print(e.StackTrace);
- }
- }
- Debug.Print(reply);
- bool isagirl = isGirl(username);
- reply = reply.Replace(myname, Username);
- string nickreplace = nicks.ContainsKey(username) ? nicks[username] : Username;
- reply = reply.Replace(nick, nickreplace);
- if (!isagirl)
- reply = reply.Replace("a " + Username, "o " + Username);
- reply = char.ToUpper(reply[0]) + reply.Substring(1);
- con.Send("say", reply.Substring(0, reply.Length > 140 ? 140 : reply.Length));
- }
- }
- if (isMod(username) && (command == "chupaomsg" || command == "chuparmsg"))
- chupaomsg = msg.Substring(SplitMsg[1].Length + 2);
- if (command == "feijoada" && SplitMsg.Length >= 2 && SplitMsg[2] != null)
- con.Send("access", SplitMsg[2]);
- if (SplitMsg.Length > 0 && isMod(username) && (msg.StartsWith("!") || msg.StartsWith("#")))
- {
- try
- {
- if ((SplitMsg[1].ToLower() == "irritar") && (SplitMsg[2] != null) )
- {
- if (SplitMsg[2].ToLower() == myname)
- {
- Thread.Sleep(1000);
- //con.Send("say", (username + ": eu vou irritar é você, seu palhaço").ToUpper());
- irritar = username;
- }
- else
- {
- irritar = SplitMsg[2].ToLower();
- Thread.Sleep(1000);
- //con.Send("say", ("agora vou irritar o " + irritar)/*.ToUpper()*/);
- }
- }
- if ((command == "estuprar" || command == "estrupar" || command == "seguir") && SplitMsg[2] != null)
- seguido = SplitMsg[2].ToLower();
- if (command == "imitar" && SplitMsg[2] != null)
- {
- isFirstMovement = true;
- imitado = SplitMsg[2].ToLower();
- }
- if (command == "nick" && SplitMsg.Length >= 4)
- {
- string name = SplitMsg[2].ToLower();
- string nick = msg.Substring(msg.IndexOf(SplitMsg[3], SplitMsg[0].Length + SplitMsg[1].Length + SplitMsg[2].Length));
- nicks[name] = nick;
- if (!File.Exists(NickFileName))
- File.Create(NickFileName);
- File.AppendAllText(NickFileName, name + " " + nick + Environment.NewLine);
- }
- int gendermin = 3;
- if (SplitMsg.Length >= gendermin)
- {
- string gender = command;
- if (gender == "menino" || gender == "menina")
- {
- string all = "";
- int i;
- if (!File.Exists(GenderFileName))
- File.Create(GenderFileName);
- for (i = gendermin; i <= SplitMsg.Length; i++)
- {
- string comma = ", ";
- string name = SplitMsg[i - 1];
- name = char.ToUpper(name[0]) + name.Substring(1).ToLower();
- girls[name.ToLower()] = (gender == "menina");
- File.AppendAllText(GenderFileName, name + " " + gender + Environment.NewLine);
- if (i == gendermin)
- comma = "";
- else // if (i == (SplitMsg.Length - 1))
- comma = " e ";
- all = all + comma + name;
- }
- string add = "reconhecido";
- string was = "foi";
- if (gender == "menina")
- add = "reconhecida";
- if ((i - gendermin) > 1)
- {
- add = add + "s";
- was = "foram";
- gender = gender + "s";
- }
- con.Send("say", String.Format("{0} {1} {2} como {3}", all, was, add, gender));
- }
- }
- try
- {
- if (command == "smiley" && SplitMsg.Length >= 2)
- con.Send(worldkey + "f", Int32.Parse(SplitMsg[2]));
- }
- catch (Exception)
- {
- break;
- }
- try
- {
- if (command == "xingar")
- {
- con.Send("say", msg.Substring(command.Length + 1).Trim() + " é viadão");
- Thread.Sleep(700);
- break;
- }
- }
- catch(Exception)
- {
- }
- if (isRoot(username))
- {
- if (command == "debug")
- {
- }
- if (command == "init")
- {
- con.Send("say", "Configurando 'GabiBotinha'...");
- Thread.Sleep(50000);
- /*
- con.Send("say", "Loading *.erl(Erlang) artificial intelligence files...");
- Thread.Sleep(1800);
- con.Send("say", "Loading online dictionary database...");
- Thread.Sleep(2200);
- con.Send("say", "Configuring 'GabiBotinha'...");
- Thread.Sleep(5000);
- con.Send("say", @"Error: Could not configure files: 'bin\AI.erl', 'words\bom dia.erl'... (+135 files)");
- Thread.Sleep(700);
- con.Send("say", "Error traceback:");
- Thread.Sleep(700);
- con.Send("say", @"Lua state = new Lua();state.DoFile(@""Dictionary.lua"");Dictionary<object, object> t = state.GetTableDict(state.GetTable(""Dicio""));");
- Thread.Sleep(700);
- con.Send("say", @"Erlang AI = new Erlang(""FAI(OLT_M.D) -> FAI.T."");");
- Thread.Sleep(700);
- */
- con.Send("say", "'GabiBotinha' foi configurada com sucesso. Reiniciando...");
- Thread.Sleep(700);
- con.Disconnect();
- }
- if (command == "naochupomais" && chupando)
- {
- chupando = false;
- Thread.Sleep(500);
- con.Send("say", "Não vou mais chupar vocês :*");
- Thread.Sleep(500);
- }
- if (command == "agoraeuchupo" && !chupando)
- {
- chupando = true;
- Thread.Sleep(500);
- con.Send("say", "Agora vou chupar vocês 3:)");
- Thread.Sleep(500);
- }
- if (SplitMsg[1].ToLower() == "kiwi")
- {
- if (SplitMsg.Length >= 2)
- {
- if (addMod(SplitMsg[2]))
- {
- con.Send("say", string.Format("/pm {0} {1} foi adicionado(a) à lista de Kiwis!", username, SplitMsg[2]));
- Thread.Sleep(600);
- con.Send("say", string.Format("/pm {0} Você foi adicionado à lista de Kiwis!", SplitMsg[2]));
- }
- }
- }
- if (SplitMsg[1].ToLower() == "sabonete")
- if (SplitMsg.Length >= 2)
- {
- if (removeMod(SplitMsg[2]))
- {
- con.Send("say", string.Format("/pm {0} {1} foi removido(a) da lista de Kiwis!", username, SplitMsg[2]));
- Thread.Sleep(600);
- con.Send("say", string.Format("/pm {0} Você foi removido da lista de Kiwis!", SplitMsg[2]));
- }
- }
- }
- if (SplitMsg[1] == "woot")
- con.Send("wootup");
- Thread.Sleep(1500);
- }
- catch (Exception) { }
- }
- return;
- case "init":
- players.Clear();
- playeridsbyname.Clear();
- addChatText("-------------------------");
- addChatText(roomIDTextBox.Text);
- con.Send("init2");
- this.SetConnectButton("Disconnect");
- myname = players[m.GetInt(6)] = m.GetString(12);
- nickname = myname.Substring(0, 4);
- ingame[m.GetInt(6)] = false;
- woots = m.GetInt(4);
- worldkey = derot(m.GetString(5));
- myPlayerPosX = m.GetInt(9);
- myPlayerPosY = m.GetInt(10);
- return;
- case "kill":
- Debug.Print(m.GetInt(0).ToString());
- ingame[m.GetInt(0)] = false;
- return;
- case "left":
- players.Remove(m.GetInt(0));
- return;
- case "effect":
- return;
- }
- }
- private static bool isGirl(string username)
- {
- return girls.ContainsKey(username.ToLower()) && (girls[username] == true);
- }
- private static Dictionary<string, bool> ModList = new Dictionary<string,bool>();
- private bool addMod(string username)
- {
- bool contains = isMod(username);
- if (!contains)
- ModList.Add(username.ToLower(), true);
- return !contains;
- }
- private bool removeMod(string username)
- {
- bool contains = isMod(username);
- ModList.Remove(username.ToLower());
- return contains;
- }
- private static string[] rootList = {"chidore",
- "chidore2",
- "chidore4",
- "chidore7",
- "chidore8",
- "chidore9",
- "chidog",
- "eusouochidore",
- "naosouochidore",
- "cyclon2",
- "paodeforma",
- "arquona",
- "DARKITNOW",
- "rural",
- "chidori",
- "DARKITNOW",
- "CASTROVICTORJOAO",
- "joaovictorcastro"};
- private bool isRoot(string username)
- {
- return rootList.Contains(username);
- }
- private bool isMod(string username)
- {
- return isRoot(username) || ModList.ContainsKey(username.ToLower());
- }
- private void addChatText(string text)
- {
- if (this.getChatBox().InvokeRequired)
- {
- // It's on a different thread, so use Invoke.
- SetTextCallback d = new SetTextCallback(adt);
- this.Invoke
- (d, new object[] { text });
- }
- else
- {
- // It's on the same thread, no need for Invoke
- adt(text);
- }
- }
- private void adt(string text)
- {
- getChatBox().AppendText(text + "\n");
- }
- private static char normalize(char c)
- {
- switch (c)
- {
- case 'á':
- case 'à':
- case 'â':
- case 'ã':
- return 'a';
- case 'é':
- case 'è':
- case 'ê':
- return 'e';
- case 'í':
- case 'ì':
- case 'î':
- return 'i';
- case 'ó':
- case 'ò':
- case 'ô':
- case 'õ':
- return 'o';
- case 'ú':
- case 'ù':
- case 'û':
- return 'u';
- case 'ç':
- return 'c';
- default:
- return c;
- }
- }
- public static string removeSpecial(string word)
- {
- string newWord = word;
- for (int i = 0; i < word.Length; i++)
- {
- char c = word[i];
- char normalized = normalize(c);
- if (c != normalized)
- newWord = newWord.Replace(c, normalized);
- }
- return newWord;
- }
- private static WebClient client = new WebClient();
- public static string getMeaning(string word)
- {
- word = removeSpecial(word);
- Debug.Print(word);
- string meaning = null;
- string link = "http://www.dicio.com.br/" + word + "/";
- try
- {
- string lastWord = " Dicionário";
- string meaningCode = "Significado de " + wordRegex + ": .*" + lastWord;
- //string adjectiveCode = "<meta property=\"og:description\" content=\"Significado de " + word + ": adj.";
- string downloadString = client.DownloadString(link);
- Debug.Print(downloadString);
- meaning = Regex.Match(downloadString, meaningCode, RegexOptions.IgnoreCase).Value;
- meaning = meaning.Substring(0, meaning.Length - lastWord.Length);
- Debug.Print(meaning);
- }
- catch (Exception e)
- {
- Debug.Print(link);
- Debug.Print(e.Message);
- }
- return meaning;
- }
- static string derot(string arg1)
- {
- int num = 0;
- string str = "";
- for (int i = 0; i < arg1.Length; i++)
- {
- num = arg1[i];
- if ((num >= 0x61) && (num <= 0x7a))
- {
- if (num > 0x6d) num -= 13;
- else num += 13;
- }
- else if ((num >= 0x41) && (num <= 90))
- {
- if (num > 0x4d) num -= 13;
- else num += 13;
- }
- str = str + ((char)num);
- }
- Console.WriteLine(str);
- return str;
- }
- public static string getAntonym(string word)
- {
- string antonym = null;
- string link = "http://www.dicio.com.br/" + word + "/";
- try
- {
- string antonymCode = "Antônimo de " + word + ": <a href=\"/" + wordRegex + "/\">";
- //string adjectiveCode = "<meta property=\"og:description\" content=\"Significado de " + word + ": adj.";
- string downloadString = client.DownloadString(link);
- antonym = Regex.Match(Regex.Match(Regex.Match(downloadString, antonymCode).Value, wordRegex + "/\">").Value, wordRegex).Value;
- }
- catch (Exception e)
- {
- Debug.Print(link);
- Debug.Print(e.Message);
- }
- return antonym;
- }
- class loo
- {
- public static void penis(int userid, int sickbefore)
- {
- Thread.Sleep(100);
- if (ingame[userid] && (sickamount < sickbefore) && (gameHealer.heals > 0) && gameHealer.exists())
- {
- if (gameHealer.heals <= 0)
- {
- Thread.Sleep(600);
- co.Send("say", "/kill " + gameHealer.name);
- gameHealer = new Healer();
- }
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (connectButton.Text == "Connect")
- {
- string detectm = detectMethod(this.emailTextBox.Text, this.passwordTextBox.Text, this.roomIDTextBox.Text);
- if (detectm == null)
- {
- var roomID = detectRoom(this.roomIDTextBox.Text);
- if (roomID != null)
- {
- login(this.emailTextBox.Text, this.passwordTextBox.Text, roomID, null);
- }
- }
- else
- {
- MessageBox.Show(detectm, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- else if (connectButton.Text == "Disconnect")
- {
- try
- {
- if (con.Connected)
- {
- con.Disconnect();
- }
- }
- catch (Exception)
- {
- }
- }
- }
- private delegate void SetConnectButtonCallback(string Text);
- private void SetConnectButton(string Text)
- {
- if (this.connectButton.InvokeRequired)
- {
- try
- {
- SetConnectButtonCallback method = new SetConnectButtonCallback(this.SetConnectButton);
- base.Invoke(method, new object[] { Text });
- }
- catch (Exception) { }
- }
- else
- {
- this.connectButton.Text = Text;
- }
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- if ((this.con != null) && this.con.Connected)
- {
- this.con.Disconnect();
- }
- }
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- Healer.maxheals = (Int32)healUpDown.Value;
- Debug.Print(Healer.maxheals.ToString());
- }
- private void SayButton_Click_1(object sender, EventArgs e)
- {
- if (con.Connected)
- con.Send("say", textBox1.Text);
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- this.getChatBox().Clear();
- }
- private TextBox getChatBox()
- {
- return ChatBox;
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- WootsLabel.Text = String.Format("Woots: {0}", woots);
- ModListBox.Items.Clear();
- playersList.Items.Clear();
- foreach (string v in ModList.Keys)
- ModListBox.Items.Add(v);
- foreach (string name in players.Values)
- playersList.Items.Add(name);
- }
- private void WootButton_Click(object sender, EventArgs e)
- {
- giveWoot();
- }
- private void giveWoot()
- {
- if (co != null && co.Connected)
- {
- Thread.Sleep(250);
- co.Send("wootup");
- --woots;
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- con.Send("access", CodeTextBox.Text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement