KubaPL20935

EE Hex Clock

Dec 15th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using PlayerIOClient;
  6.  
  7. namespace EEHexClock
  8. {
  9.     class Program
  10.     {
  11.         public static class p
  12.         {
  13.             public static string pass { get; set; }
  14.         }
  15.  
  16.         static Connection con;
  17.         static Client client;
  18.  
  19.         static void Main(string[] args)
  20.         {
  21.             ConsoleKeyInfo key;
  22.  
  23.             Console.Title = "EE Hex Clock";
  24.             Console.WriteLine("\nThis bot will connect to your level and change bgcolor constantly based on your system time.\n");
  25.             Console.Write("\nEmail: ");
  26.             string email = Console.ReadLine();
  27.  
  28.             Console.Write("Password: ");
  29.  
  30.             do
  31.             {
  32.                 key = Console.ReadKey(true);
  33.  
  34.                 // Backspace Should Not Work
  35.                 if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter)
  36.                 {
  37.                     p.pass += key.KeyChar;
  38.                     Console.Write("*");
  39.                 }
  40.                 else
  41.                 {
  42.                     if (key.Key == ConsoleKey.Backspace && p.pass.Length > 0)
  43.                     {
  44.                         p.pass = p.pass.Substring(0, (p.pass.Length - 1));
  45.                         Console.Write("\b \b");
  46.                     }
  47.                 }
  48.             }
  49.             // Stops Receving Keys Once Enter is Pressed
  50.             while (key.Key != ConsoleKey.Enter);                
  51.  
  52.             Console.Write("\nWorld ID: ");
  53.             string worldid = Console.ReadLine();
  54.             Console.WriteLine("");
  55.  
  56.             client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", email, p.pass, null);
  57.             con = client.Multiplayer.CreateJoinRoom(worldid, "public", true, new Dictionary<string, string>(), new Dictionary<string, string>());
  58.             con.Send("init");
  59.  
  60.             p.pass = "";
  61.             email = "";
  62.  
  63.             while (true)
  64.             {
  65.                 int prep = DateTime.Now.Millisecond;
  66.               //  Console.WriteLine(prep);
  67.                 if (prep == 500) { break; }
  68.             }
  69.             Console.Clear();
  70.             while (true)
  71.             {
  72.                 System.Threading.Thread.Sleep(1000);
  73.                 int tHours = DateTime.Now.Hour;
  74.                 int tMinutes = DateTime.Now.Minute;
  75.                 int tSeconds = DateTime.Now.Second;
  76.  
  77.                 string sHours = tHours.ToString();
  78.                 string sMinutes = tMinutes.ToString();
  79.                 string sSeconds = tSeconds.ToString();
  80.                 if (sHours.Length == 1) { sHours = 0 + sHours; };           // if hour has 1 digit, add 0 at the beginning, for example,
  81.                 if (sMinutes.Length == 1) { sMinutes = 0 + sMinutes; };     // if hour is "2" then it will replace with "02"
  82.                 if (sSeconds.Length == 1) { sSeconds = 0 + sSeconds; };     // if hour is "22" then it will do nothing.
  83.  
  84.                 con.Send("say","/bgcolor #" + sHours + sMinutes + sSeconds);
  85.                 Console.Write("/bgcolor #" + sHours + sMinutes + sSeconds + "    ");
  86.             }
  87.  
  88.         }
  89.     }
  90. }
Add Comment
Please, Sign In to add comment