Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package se.proxus.mods.list;
- import java.util.ArrayList;
- import org.lwjgl.input.Keyboard;
- import se.proxus.events.*;
- import se.proxus.events.misc.*;
- import se.proxus.events.player.*;
- import se.proxus.events.render.*;
- import se.proxus.events.world.*;
- import se.proxus.mods.*;
- import se.proxus.utils.*;
- public class ModMacros extends BaseMod {
- protected ArrayList<ArrayHelper<String, String>> loadedMacros;
- public ModMacros() {
- super("Macros", new ModInfo(new String[]{"Macros, bitch"},
- "Oliver", "NONE", true), ModType.NONE, true);
- getInfo().setMod(this);
- getInfo().setToggleable(false);
- getConfig().loadConfig();
- setLoadedMacros(new ArrayList<ArrayHelper<String, String>>());
- }
- @Override
- public void initMod() {
- this.getEvent().registerEvent(EventKeyPressed.class);
- }
- @Override
- public void onEnabled() {
- }
- @Override
- public void onDisabled() {
- }
- @Override
- public void onEvent(Event event) {
- if(getState()) {
- if(event instanceof EventKeyPressed) {
- EventKeyPressed eventKeyPressed = (EventKeyPressed)event;
- for(ArrayHelper macros : getLoadedMacros()) {
- if(eventKeyPressed.getKeyName().equalsIgnoreCase((String)macros.getObject()[1])) {
- utils.sendMessage((String)macros.getObject()[0]);
- }
- }
- }
- }
- }
- @Override
- public boolean onCommand(String msg, String[] arg) {
- if(arg[0].equalsIgnoreCase(getName()) && arg[1].equalsIgnoreCase("add")) {
- if(!(getLoadedMacros().contains(new ArrayHelper(arg[2], arg[3].toUpperCase())))) {
- getLoadedMacros().add(new ArrayHelper(arg[2], arg[3].toUpperCase()));
- utils.addMessage("Added the macro " + Colours.YELLOW + arg[2] + ", "
- + arg[3] + Colours.WHITE + ".");
- }
- return true;
- } if(arg[0].equalsIgnoreCase(getName()) && arg[1].equalsIgnoreCase("remove")) {
- if(getLoadedMacros().contains(new ArrayHelper(arg[2], arg[3].toUpperCase()))) {
- getLoadedMacros().remove(getLoadedMacros().indexOf(new ArrayHelper(arg[2], arg[3].toUpperCase())));
- utils.addMessage("Removed the macro " + Colours.YELLOW + arg[2] + ", "
- + arg[3] + Colours.WHITE + ".");
- }
- return true;
- }
- return super.onCommand(msg, arg);
- }
- public ArrayList<ArrayHelper<String, String>> getLoadedMacros() {
- return loadedMacros;
- }
- public void setLoadedMacros(ArrayList<ArrayHelper<String, String>> loadedMacros) {
- this.loadedMacros = loadedMacros;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement