Exemple #1
0
        public override void Use(Player p, string message)
        {
            if (p == null) { Player.SendMessage(p, "This command can only be used in-game!"); return; }
            if (!Directory.Exists("extra/copy"))
                Directory.CreateDirectory("extra/copy");

            if (!File.Exists("extra/copy/nyancat.copy"))
            {
                Player.SendMessage(p, "Nyan Cat copy doesn't exist. Downloading...");
                try
                {
                    using (WebClient WEB = new WebClient())
                        WEB.DownloadFile("http://mcforge.net/uploads/copy/nyancat.copy", "extra/copy/nyancat.copy");
                    }
                    catch
                    {
                        Player.SendMessage(p, "Sorry, downloading failed. Please try again later.");
                        return;
                    }
                }
                Command.all.Find("retrieve").Use(p, "nyancat");
                Command.all.Find("paste").Use(p, "");
                ushort[] loc = p.getLoc(false);
                Command.all.Find("click").Use(p, loc[0] + " " + loc[1] + " " + loc[2]);
        }