Portl

Untitled

Oct 12th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. public class Bind
  2. extends Command {
  3. public Bind() {
  4. super("Bind", "U fucked up!", new String[]{"b"}, "<mod> <key>", "Binds a mod to a key.");
  5. }
  6.  
  7. @EventTarget
  8. public void onChatSend(EventTick event) {
  9. if (this.getState()) {
  10. try {
  11. String modd = EventChatSend.getMessage().split(" ")[1];
  12. String key = EventChatSend.getMessage().split(" ")[2];
  13. Cheese.getInstance();
  14. Module mod = Cheese.moduleManager.getModbyName(modd);
  15. Cheese.getInstance();
  16. Module alias = Cheese.moduleManager.getModByAlias(modd);
  17. if (key == "" || modd == "") {
  18. Logger.logChat("U fucked up! bind <mod> <key>");
  19. }
  20. if (mod == null && alias == null) {
  21. Logger.logChat("That module does not exist!");
  22. } else if (modd != "" && key != "") {
  23. if (mod != null && alias == null) {
  24. mod.setKeybind(Keyboard.getKeyIndex(key.toUpperCase()));
  25. Logger.logChat("\u00a7e" + mod.getName() + "'s" + "\u00a77 bind set to key:" + "\u00a7a " + Keyboard.getKeyName(mod.getKeybind()));
  26. } else if (alias != null && mod == null) {
  27. alias.setKeybind(Keyboard.getKeyIndex(key.toUpperCase()));
  28. Logger.logChat("\u00a7e" + alias.getName() + "'s" + "\u00a77 bind set to key:" + "\u00a7a " + Keyboard.getKeyName(alias.getKeybind()));
  29. }
  30. }
  31. }
  32. catch (Exception e) {
  33. Logger.logChat("U fucked up! Bind <mod> <key>");
  34. }
  35. Cheese.getInstance();
  36. Cheese.fileManager.saveFiles();
  37. this.Toggle();
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment