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.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using PlayerIOClient;
- using System.Threading;
- namespace WindowsFormsApp2
- {
- public partial class Form1 : Form
- {
- public string stalking = "";
- public Form1()
- {
- InitializeComponent();
- }
- #region public variables
- public Connection con;
- public Client client;
- public bool isConnected;
- public Dictionary<int, string> users = new Dictionary<int, string>();
- bool b = true;
- #endregion
- #region public voids
- public void Say(string message)
- {
- if (isConnected)
- {
- con.Send("say", message);
- }
- }
- #endregion
- #region Connection
- private void Connect_Click(object sender, EventArgs e)
- {
- if (!isConnected)
- {
- try
- {
- client = PlayerIO.QuickConnect.SimpleConnect("eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw", emailBox.Text, passBox.Text, null);
- con = client.Multiplayer.CreateJoinRoom(idBox.Text, "Everybuildexists221", true, new Dictionary<string, string>(), new Dictionary<string, string>());
- con.Send("init");
- con.OnMessage += handlemsg;
- isConnected = true;
- Connect.Text = "Disconnect :(";
- }
- catch (Exception o)
- {
- MessageBox.Show(o.ToString(), "Error?");
- }
- }
- else
- con.Disconnect();
- isConnected = false;
- users.Clear();
- Connect.Text = "Connect again?";
- {
- }
- }
- #endregion
- public void handlemsg(object sender, PlayerIOClient.Message m)
- {
- string adminlist = "excoluss";
- #region init
- if (m.Type == "init")
- {
- con.Send("init2");
- con.Send("say", "[Sommelier] Connected!");
- Thread.Sleep(600);
- string isOwner = (m.GetString(0));
- {
- con.Send("say", "[Sommelier] World owner: " + isOwner);
- }
- }
- #endregion
- #region add
- else if (m.Type == "add")
- {
- if (!users.ContainsKey(m.GetInt(0)))
- {
- users.Add(m.GetInt(0), m.GetString(1));
- }
- }
- #endregion
- #region left
- else if(m.Type == "left")
- {
- if(users.ContainsKey(m.GetInt(0)))
- {
- users.Remove(m.GetInt(0));
- }
- }
- #endregion
- #region Commands
- else if(m.Type == "say")
- {
- if(users.ContainsKey(m.GetInt(0)))
- {
- string msg = m.GetString(1);
- string username = users[m.GetInt(0)];
- if (msg.StartsWith("!"))
- {
- string[] msgA = msg.Remove(0, 1).Split(' ');
- if (msgA[0] == "hello")
- {
- con.Send("say", "[Sommelier] Hello there, " + username + "!");
- }
- else if (msgA[0] == "anatoly")
- {
- con.Send("say", "[Sommelier] Excoluss is a bad friend. But why then he made this command?");
- }
- else if (msgA[0] == "kill")
- {
- if (adminlist.Contains("excoluss"))
- {
- con.Send("say", "[Sommelier] Ouch! " + username + " killed" + msg + "!");
- }
- else
- {
- con.Send("say", "[Sommelier] Ouch! " + username + "tried to kill" + msg + "!");
- }
- }
- else if (msgA[0] == "answer")
- {
- string[] outputs = { "[Sommelier] " + username + " I think no.", "[Sommelier] " + username + " Everything is possible.", "[Sommelier] " + username + " Yes of course!!", "[Sommelier] " + username + " Don't ask me.", "[Sommelier] " + username + " I dunno.", "[Sommelier] " + username + " Will my answer change anything?", "[Sommelier] " + username + " Never!", "[Sommelier] " + username + " Well. Yeah? Sort of." };
- if (msg.EndsWith("?"))
- {
- con.Send("say", outputs[new Random().Next(outputs.Length)]);
- }
- else if (!msg.EndsWith("?"))
- {
- con.Send("say", "/pm " + username + " [Sommelier] You must have '?' in your question. Credits: EBEbot by Realmaster42");
- }
- }
- else if (msgA[0] == "doomester")
- {
- con.Send("say", "[Sommelier] Doomester has doomed you... Nubbo.");
- }
- else if (msgA[0] == "wizard")
- {
- con.Send("say", "[Sommelier] Wizard was a good guy, but one day, he was killed. The Killer's name is Excoluss!");
- }
- else if (msgA[0] == "benedanika")
- {
- con.Send("say", "[Sommelier] Benedanika loves kitties. Bene - Meow");
- }
- else if (msgA[0] == "polak")
- {
- con.Send("say", "[Sommelier] Polak loves autocorrecting. Maybe that's why Doomester hates him?");
- }
- else if (msgA[0] == "realmaster42")
- {
- con.Send("say", "[Sommelier] Realmaster42 is founder of EBE. Wait. What? I think it's fake...");
- }
- else if (msgA[0] == "help")
- {
- con.Send("say", "/pm " + username + " [Sommelier] List of commands: kill, hello, answer, usernames.");
- if (msg.EndsWith("answer"))
- {
- con.Send("say", "/pm " + username + " [Sommelier] All possible comebacks from !answer: I think no. Everything is possible. Yes of course!! Don't ask me. I dunno. Will my answer change anything? Never! Well. Yeah? Sort of.");
- }
- }
- else if (msgA[0] == "orko")
- {
- con.Send("say", "[Sommelier] There is a myth about legendary golden oreo, which is hidden under the ocean. Orko will find it.");
- }
- else if (msgA[0] == "seb")
- {
- con.Send("say", "[Sommelier] Snek is always opened for Seb, but not for us.");
- }
- else if (msgA[0] == "usernames")
- {
- con.Send("say", "/pm " + username + " [Sommelier] Some commands using various users: anatoly, doomester, wizard, benedanika, polak, realmaster42, seb, orko, lee77.");
- }
- else if (msgA[0] == "lee77")
- {
- con.Send("say", "[Sommelier] There is a spy, called Lee77. He knows most of the EBE secrets, which even Realmaster42 doesn't know!");
- }
- else if (msgA[0] == "kick")
- {
- if (adminlist.Contains("excoluss"))
- {
- con.Send("say", "/kick" + msg);
- Thread.Sleep(10);
- con.Send("say", "[Sommelier] I have kicked " + msg);
- }
- else
- {
- con.Send("say", "[Sommelier] Nice try, " + username);
- }
- }
- }
- }
- }
- #endregion
- #region Rain/Snake
- if (m.Type == "b")
- {
- int layer = m.GetInt(0), x = m.GetInt(1), y = m.GetInt(2), blockid = m.GetInt(3), userid = m.GetInt(4);
- if (blockid == 79)
- {
- Thread.Sleep(10);
- con.Send("b", 0, x, y, 0);
- con.Send("b", 0, x, y + 1, 79);
- }
- if (blockid == 219)
- {
- con.Send("b", 0, x, y, 218);
- Thread.Sleep(20);
- con.Send("b", 0, x, y, 0);
- }
- if (blockid == 218)
- {
- con.Send("b", 0, x, y, 0);
- }
- }
- #endregion
- #region stalk
- if (m.Type == "m")
- {
- if (adminlist.Contains("excoluss"))
- {
- int pid = m.GetInt(0), xm = m.GetInt(1), ym = m.GetInt(2), hspeed = m.GetInt(3), vspeed = m.GetInt(4), hmod = m.GetInt(5), vmod = m.GetInt(6), hdirection = m.GetInt(7), vdirection = m.GetInt(8);
- bool sp = m.GetBoolean(9), sjp = m.GetBoolean(10);
- con.Send("m", xm, ym, hspeed, vspeed, hmod, vmod, hdirection, vdirection, 1, sp, sjp, true);
- }
- else
- {
- }
- }
- #endregion
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement