Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Bind
- extends Command {
- public Bind() {
- super("Bind", "U fucked up!", new String[]{"b"}, "<mod> <key>", "Binds a mod to a key.");
- }
- @EventTarget
- public void onChatSend(EventTick event) {
- if (this.getState()) {
- try {
- String modd = EventChatSend.getMessage().split(" ")[1];
- String key = EventChatSend.getMessage().split(" ")[2];
- Cheese.getInstance();
- Module mod = Cheese.moduleManager.getModbyName(modd);
- Cheese.getInstance();
- Module alias = Cheese.moduleManager.getModByAlias(modd);
- if (key == "" || modd == "") {
- Logger.logChat("U fucked up! bind <mod> <key>");
- }
- if (mod == null && alias == null) {
- Logger.logChat("That module does not exist!");
- } else if (modd != "" && key != "") {
- if (mod != null && alias == null) {
- mod.setKeybind(Keyboard.getKeyIndex(key.toUpperCase()));
- Logger.logChat("\u00a7e" + mod.getName() + "'s" + "\u00a77 bind set to key:" + "\u00a7a " + Keyboard.getKeyName(mod.getKeybind()));
- } else if (alias != null && mod == null) {
- alias.setKeybind(Keyboard.getKeyIndex(key.toUpperCase()));
- Logger.logChat("\u00a7e" + alias.getName() + "'s" + "\u00a77 bind set to key:" + "\u00a7a " + Keyboard.getKeyName(alias.getKeybind()));
- }
- }
- }
- catch (Exception e) {
- Logger.logChat("U fucked up! Bind <mod> <key>");
- }
- Cheese.getInstance();
- Cheese.fileManager.saveFiles();
- this.Toggle();
- }
- }
- }
Add Comment
Please, Sign In to add comment