Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PlayerIOClient;
  11. using System.Threading;
  12.  
  13. namespace WindowsFormsApp2
  14. {
  15. public partial class Form1 : Form
  16. {
  17. public string stalking = "";
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22. #region public variables
  23.  
  24. public Connection con;
  25. public Client client;
  26. public bool isConnected;
  27. public Dictionary<int, string> users = new Dictionary<int, string>();
  28. bool b = true;
  29.  
  30. #endregion
  31.  
  32. #region public voids
  33.  
  34. public void Say(string message)
  35. {
  36. if (isConnected)
  37. {
  38. con.Send("say", message);
  39. }
  40. }
  41.  
  42. #endregion
  43.  
  44. #region Connection
  45. private void Connect_Click(object sender, EventArgs e)
  46. {
  47. if (!isConnected)
  48. {
  49. try
  50. {
  51. client = PlayerIO.QuickConnect.SimpleConnect("eers-2-open-alpha-dq1cyz1b3ku5j7q16ej6vw", emailBox.Text, passBox.Text, null);
  52. con = client.Multiplayer.CreateJoinRoom(idBox.Text, "Everybuildexists221", true, new Dictionary<string, string>(), new Dictionary<string, string>());
  53.  
  54. con.Send("init");
  55. con.OnMessage += handlemsg;
  56. isConnected = true;
  57. Connect.Text = "Disconnect :(";
  58. }
  59. catch (Exception o)
  60. {
  61. MessageBox.Show(o.ToString(), "Error?");
  62. }
  63. }
  64. else
  65. con.Disconnect();
  66. isConnected = false;
  67. users.Clear();
  68. Connect.Text = "Connect again?";
  69. {
  70.  
  71. }
  72. }
  73. #endregion
  74.  
  75. public void handlemsg(object sender, PlayerIOClient.Message m)
  76. {
  77. string adminlist = "excoluss";
  78. #region init
  79. if (m.Type == "init")
  80. {
  81. con.Send("init2");
  82. con.Send("say", "[Sommelier] Connected!");
  83. Thread.Sleep(600);
  84. string isOwner = (m.GetString(0));
  85. {
  86. con.Send("say", "[Sommelier] World owner: " + isOwner);
  87. }
  88. }
  89. #endregion
  90.  
  91. #region add
  92. else if (m.Type == "add")
  93. {
  94. if (!users.ContainsKey(m.GetInt(0)))
  95. {
  96. users.Add(m.GetInt(0), m.GetString(1));
  97. }
  98. }
  99. #endregion
  100.  
  101. #region left
  102. else if(m.Type == "left")
  103. {
  104. if(users.ContainsKey(m.GetInt(0)))
  105. {
  106. users.Remove(m.GetInt(0));
  107. }
  108. }
  109. #endregion
  110.  
  111. #region Commands
  112. else if(m.Type == "say")
  113. {
  114. if(users.ContainsKey(m.GetInt(0)))
  115. {
  116. string msg = m.GetString(1);
  117. string username = users[m.GetInt(0)];
  118. if (msg.StartsWith("!"))
  119. {
  120. string[] msgA = msg.Remove(0, 1).Split(' ');
  121. if (msgA[0] == "hello")
  122. {
  123. con.Send("say", "[Sommelier] Hello there, " + username + "!");
  124. }
  125. else if (msgA[0] == "anatoly")
  126. {
  127. con.Send("say", "[Sommelier] Excoluss is a bad friend. But why then he made this command?");
  128. }
  129. else if (msgA[0] == "kill")
  130. {
  131. if (adminlist.Contains("excoluss"))
  132. {
  133. con.Send("say", "[Sommelier] Ouch! " + username + " killed" + msg + "!");
  134. }
  135. else
  136. {
  137. con.Send("say", "[Sommelier] Ouch! " + username + "tried to kill" + msg + "!");
  138. }
  139. }
  140. else if (msgA[0] == "answer")
  141. {
  142. 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." };
  143. if (msg.EndsWith("?"))
  144. {
  145. con.Send("say", outputs[new Random().Next(outputs.Length)]);
  146. }
  147. else if (!msg.EndsWith("?"))
  148. {
  149. con.Send("say", "/pm " + username + " [Sommelier] You must have '?' in your question. Credits: EBEbot by Realmaster42");
  150. }
  151. }
  152. else if (msgA[0] == "doomester")
  153. {
  154. con.Send("say", "[Sommelier] Doomester has doomed you... Nubbo.");
  155. }
  156. else if (msgA[0] == "wizard")
  157. {
  158. con.Send("say", "[Sommelier] Wizard was a good guy, but one day, he was killed. The Killer's name is Excoluss!");
  159. }
  160. else if (msgA[0] == "benedanika")
  161. {
  162. con.Send("say", "[Sommelier] Benedanika loves kitties. Bene - Meow");
  163. }
  164. else if (msgA[0] == "polak")
  165. {
  166. con.Send("say", "[Sommelier] Polak loves autocorrecting. Maybe that's why Doomester hates him?");
  167. }
  168. else if (msgA[0] == "realmaster42")
  169. {
  170. con.Send("say", "[Sommelier] Realmaster42 is founder of EBE. Wait. What? I think it's fake...");
  171. }
  172. else if (msgA[0] == "help")
  173. {
  174. con.Send("say", "/pm " + username + " [Sommelier] List of commands: kill, hello, answer, usernames.");
  175. if (msg.EndsWith("answer"))
  176. {
  177. 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.");
  178. }
  179. }
  180. else if (msgA[0] == "orko")
  181. {
  182. con.Send("say", "[Sommelier] There is a myth about legendary golden oreo, which is hidden under the ocean. Orko will find it.");
  183. }
  184. else if (msgA[0] == "seb")
  185. {
  186. con.Send("say", "[Sommelier] Snek is always opened for Seb, but not for us.");
  187. }
  188. else if (msgA[0] == "usernames")
  189. {
  190. con.Send("say", "/pm " + username + " [Sommelier] Some commands using various users: anatoly, doomester, wizard, benedanika, polak, realmaster42, seb, orko, lee77.");
  191. }
  192. else if (msgA[0] == "lee77")
  193. {
  194. con.Send("say", "[Sommelier] There is a spy, called Lee77. He knows most of the EBE secrets, which even Realmaster42 doesn't know!");
  195. }
  196. else if (msgA[0] == "kick")
  197. {
  198. if (adminlist.Contains("excoluss"))
  199. {
  200. con.Send("say", "/kick" + msg);
  201. Thread.Sleep(10);
  202. con.Send("say", "[Sommelier] I have kicked " + msg);
  203. }
  204. else
  205. {
  206. con.Send("say", "[Sommelier] Nice try, " + username);
  207. }
  208. }
  209. }
  210. }
  211. }
  212. #endregion
  213.  
  214. #region Rain/Snake
  215.  
  216. if (m.Type == "b")
  217. {
  218. int layer = m.GetInt(0), x = m.GetInt(1), y = m.GetInt(2), blockid = m.GetInt(3), userid = m.GetInt(4);
  219. if (blockid == 79)
  220. {
  221. Thread.Sleep(10);
  222. con.Send("b", 0, x, y, 0);
  223. con.Send("b", 0, x, y + 1, 79);
  224. }
  225. if (blockid == 219)
  226. {
  227. con.Send("b", 0, x, y, 218);
  228. Thread.Sleep(20);
  229. con.Send("b", 0, x, y, 0);
  230. }
  231. if (blockid == 218)
  232. {
  233. con.Send("b", 0, x, y, 0);
  234. }
  235. }
  236.  
  237. #endregion
  238.  
  239. #region stalk
  240. if (m.Type == "m")
  241. {
  242. if (adminlist.Contains("excoluss"))
  243. {
  244. 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);
  245. bool sp = m.GetBoolean(9), sjp = m.GetBoolean(10);
  246. con.Send("m", xm, ym, hspeed, vspeed, hmod, vmod, hdirection, vdirection, 1, sp, sjp, true);
  247. }
  248. else
  249. {
  250.  
  251. }
  252. }
  253.  
  254. #endregion
  255. }
  256. }
  257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement