Macro Compilation and Tutorials

Discussion in 'Basic Tutorials' started by SionainnSun, Jul 17, 2016.

  1. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    A compilation of macros (written by me along with links to other threads), a compilation of macro mod tutorials, and you can request free custom macros :)

    [​IMG]
    I'll be making custom macros for free for anyone who asks :) I don't mind if you post my macros elsewhere, but I do ask that I (and anyone else involved in writing it, noted in pink text) am given credit (thanks lol).


    [​IMG]
    Before the list of macros, I wanted to have a few basic tutorials to get started with the mod. Tutorials I currently have:
    • How to install the mod
    • How to bind a script to an event/key
    • How to add a label
    • How to add a button
    • How to add/play a custom sound.
    If you would like a different tutorial, just let me know and I'll do my best to add it :D

    1. Install LiteLoader. The actual Macro / Keybind Mod itself is dependent on LiteLoader (a mod loader), so you need to install that first. The first post on this page, which is by Mumfrey, is super helpful to install LiteLoader, especially if you're using Forge/Optifine/Shaders:http://tinyurl.com/installLiteLoader. If you don't feel like visiting that page, you can download LiteLoader from here: http://www.liteloader.com/download, either as a .jar or .exe file. Once you download the file, run it (double click on it in File Explorer on PC) and choose to create a profile/which profile to extend from. Make sure the Minecraft launcher is closed when you do this! I use LiteLoader, Forge, and Optifine, so if you have any questions about using two or all of those, just pm me or leave a comment :)
    2. Install the Macro / Keybind Mod. Once you have that installed, you need to download the mod itself, which you can get here: http://tinyurl.com/macrokeybindmod. This should download as a .litemod file, but some browsers turn it into a .zip file instead (such as IE.) If that happens, just edit the file name to end in .litemod instead of .zip. Once the .litemod file is downloaded, move it to the mods folder in your .minecraft folder (can be found by following this file path, usually: C:\Users\YourNameHere\AppData\Roaming\.minecraft\mods). When you do this step, Minecraft and the Minecraft launcher should be closed; however, nothing bad will happen if they're not--you'll just need to relaunch Minecraft.
    Now you should be good to go! You can check if it actually installed by going to the "Controls" menu in Minecraft and seeing if there are options there for Macro / Keybind Mod.

    1. Open the Macro/Keybind mod config screen. The default key combination to open it is SHIFT+~. The screen will most likely look like this: [​IMG]
    2. Click on the arrow at the top of the screen to scroll through the different pages that have things you can bind scripts to. If you want to bind to a key, skip to step 4.[​IMG]
    3. Clicking once should bring you to the Events screen, which contains a list of events that you can bind scripts to. The screen looks like this: [​IMG]
    4. Click on whichever event you want to bind the script to. In my example, I clicked on "onXPChange". If you want to bind to a key, click on the desired key in the screen seen in step 1, and follow steps 5-9. [​IMG]
    5. To create a file to bind or edit an existing one, you need to click on the "Edit File" button: [​IMG]
    6. That will bring you to a screen with a list of all your macros. If you want to edit an existing script, just double-click it on the list. To create a new script, enter the name in the box. In my example, I named mine "testing": [​IMG]
    7. Click "OK" in the bottom right corner, and you'll be brought to a screen where you can either wrote or copy/paste some code: [​IMG]
    8. Once you have all the code there, click "Save" in the bottom right corner, which will bring you back to the screen in step 5. To actually bind the script you just made to the event, you type in its name in this form: $$<filename.txt>. You NEED to have the .txt extension adter your file name! Since I named my example script "testing", I entered $$<testing.txt> into the box.[​IMG]
    9. Once again, click on "Save" in the bottom right corner, and you're done!
    By binding a script to an event, the script will be run every time that event occurs. For instance, I bound my example script that outputted: "Hi there, SionainnSun!" to the "onXPChange" event. That means that every time my xp changes (not my level, just the amount of xp I have), this script will be run and will output "Hi there, SionainnSun!"

    If you bind a script to a key, the script will be run every time the key is pressed.

    If you want to bind two scripts to the same event/key, you need only to separate them with a pipe character "|", as shown in this picture: [​IMG]

    1. Start by opening the config screen by using SHIFT+~. You should be brought to this screen: [​IMG]
    2. If you hover over the icon in the top left corner, a menu should be brought up that looks like this: [​IMG]
    3. Click on "GUI Editor" to add a label or a button, and you will be brought to this screen: [​IMG]
    4. If you are creating a label, you'll want to go to the "ingame" screen by double clicking on it in the list on the left of the screen. ("ingame" shows up while you're on the default game screen, without chat open and not in a GUI. "inchat" shows up when you have chat open. Since usually, you won't have chat open, you should generally put labels on the "ingame" screen.) You'll be brought to this screen: [​IMG]
    5. As you can see, I already have several labels made. If you click on he plus sign in the bottom let corner, a menu with several options will come up: [​IMG]
    6. Click on the "Add Label" button in that menu, and then click on the rectangle that you want to add the label to. A menu that looks like this will come up: [​IMG]
    7. The label has several parts, each described below:
    • "Control Name" is what the label can be accessed as in scripts.
    • "Label text" is the text the label actually displays.
    • "Binding" is used if you want the label to display a variable.
    • "Foreground Color" is the color of the label text.
    • "Background Color" is the color of the background of the box the label is in; I usually set mine to be completely transparent.
    • "Text Align" is what side of the box the text will be aligned to.

    1. Start by opening the config screen by using SHIFT+~. You should be brought to this screen: [​IMG]
    2. If you hover over the icon in the top left corner, a menu should be brought up that looks like this: [​IMG]
    3. Click on "GUI Editor" to add a label or a button, and you will be brought to this screen: [​IMG]
    4. If you are creating a button, you'll want to go to the "inchat" screen by double clicking on it in the list on the left of the screen. ("ingame" shows up while you're on the default game screen, without chat open and not in a GUI. "inchat" shows up when you have chat open. Since to click on anything, chat has to be open, you should put buttons on the "inchat" screen.) You'll be brought to this screen: [​IMG]
    5. As you can see, I already have a few buttons. To add one is simple. If you click on the plus sign in the bottom left corner, a menu will come up. Click on "Add Button" in that menu: [​IMG]
    6. Now click on the rectangle you want to put the button in. A menu with several parts will come up: [​IMG]
    7. The meaning of all the parts will be explained at the end of this tutorial (so still inside this spoiler.)
    8. When you have set everything to your satisfaction, click on "OK." Now, to actually bind a script to the button. First, you'll have to click on the button in the GUI editor screen: [​IMG]
    9. You should be brought to a screen that looks fairly familiar at this point. In this screen, you can either put in code or bind a sccript, and the button will execute that ode or script whenever it is clicked on. The screen you will be brought to looks like this: [​IMG]
    10. When you're done with that, click on "Save" in the lower right corner, and you should be good to go! Whenever you open chat, your new button will show up on the screen, and clicking on it will run the script or code you added earlier.
    Now, for the parts of the button. I couldn't put this earlier because the forums don't like having bulleted lists inside numbered lists.
    • Control Name: This is what the button can be accessed as in scripts.
    • Display Text: This is the text that will actually be displayed on the button.
    • Hide when unbound: If checked, this option will prevent the button from being shown unless there i code or a script bound to it.
    • Don't close GUI on click: This prevents your current GUI (in this case, chat, since we put the button on the inchat screen) from being closed when you click on the button.
    • Foreground Color: The color of the text on the button.
    • Background Color: The color of the box that is the button (the button's background.)
    • Hotkey: I actually don't know :( If someone does know, just tell me please :)

    Getting an .ogg file:
    1. The mod can play any .ogg file, so go crazy! :p Either find a sound that you would like to use (and are able to download) or you can use a sound you already have. Generally, sounds are in .mp3 format, no matter where they come from.
    2. To convert the .mp3 (or most any other file extension) file to .ogg, there are a bunch of online converters out there; I use this one: http://audio.online-convert.com/convert-to-ogg
    3. Download the converted file that should now be in .ogg format.
    Adding a custom sound:
    1. Locate your \macros\sounds folder, which can be found by following this file path (usually): C:\Users\YourNameHere\AppData\Roaming\.minecraft\liteconfig\common\macros\sounds . Then, place the sound file into this folder. (Note: It must be an .ogg file.)
    Playing the custom sounds you have added (useful for writing your own scripts):
    1. Use the PLAYSOUND() command in macro coding language.
    2. Any custom sounds that are in the correct folder can be accessed using PLAYSOUND(custom.filename). For instance, in my folder, I have these two files:[​IMG] They can be accessed using PLAYSOUND(custom.alert) and PLAYSOUND(custom.playerJoin), respectively.
    In any macro of mine that plays a sound, I'll include a link to listen to/download it if you want to use the same one I have :)


    [​IMG]
    There are also a bunch of threads that already exist that have awesome macros. You can visit them to get more macros or to look at the code and learn from it. These are ones I have seen and that stick out to me, but if you have other threads you think should be added, just let me know!


    [​IMG]
    And finally, documentation is also incredibly useful for coding, no? There are a couple places with decent documentation, but none of them are fully up-to-date because apparently, there's a cosmic law of some kind that prevents up-to-date documentation of this mod... :mad:
    The developer's YouTube channel with video tutorials: https://www.youtube.com/user/therealeq2/videos
    The official thread (with changelogs for each update): http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1275039-macro-keybind-mod
    A list of built-in sounds in Minecraft that can be played via the macromod using the PLAYSOUND() command: http://www.theredengineer.com/1.9-playsound-list.html
    A list of variables that are available to use in the mod (a little outdated): http://mkb.bplaced.net/wiki/variables
    A list of commands that can be used in the mod (a little outdated): http://mkb.bplaced.net/wiki/commands
    The readme.txt: http://eq2.co.uk/minecraft/mods/mod_macros_0.8.5_readme.txt


    [​IMG]
    Now, assuming you know how to do the things described in the tutorials, on to the macros!
    I've made several macros already, which are posted here:
    Friend List Macro
    Written by @SionainnSun and @314
    Required Features: None
    General Purpose: General Purpose: Creates a friend list that is manipulated by chat commands, and sends a chat message (and optionally plays a sound) when a player on the friend list joins the server.
    List of Commands: Do "/help friendlist" (minus the quotes) once the macro is installed.
    Event: onSendChatMessage (Important: This first script only; the second is bound to a different event.)
    Code:
    $${
    &prefix = "&4[Friend List] &3";
    IFMATCHES(%CHAT%, "^/help friendlist$");
        LOG("&e---- &6Help: Friend List &e-- &6Page: &c1 &6of &c1 &e----");
        LOG("&5&lFriend List Macro");
        LOG("&5&oDeveloped by SionainnSun and 314");
        LOG("&3/help friendlist: &7Displays a list of commands for the friend list macro.");
        LOG("&3/watch &5<playername>&3: &7Adds specified player to the friend list.");
        LOG("&3/unwatch &5<playername>&3: &7Removes specified player from the friend list.");
        LOG("&3/friendlist: &7Displays all the players on the friend list.");
        LOG("&3/clear friendlist: &7Clears all players from the friend list.");
        FILTER();
    ENDIF;
    
    //The "/watch <playername>" command:
    IFMATCHES(%CHAT%, "^/watch (.+)$");
        MATCH(%CHAT%, "^/watch (.+)",{&tempfriend});
        IFMATCHES(%@&thefriendlist%, "\b%&tempfriend%\b");
            LOG("&4[Friend List] &3Error: %&tempfriend% is already on your friend list.");
        ELSEIF(%@&thefriendlist% == "");
            @&thefriendlist = %&tempfriend%;
            LOG("%&prefix%%&tempfriend% has been added. The friend list now has these people: %@&thefriendlist%.");
        ELSE;
            @&thefriendlist = "%@&thefriendlist%|%&tempfriend%";
            &readable = %@&thefriendlist%;
            REPLACE(&readable, "|", ", ");
            LOG("%&prefix%%&tempfriend% has been added. The friend list now has these people: %&readable%.");
        ENDIF;
        FILTER();
    ENDIF;
    
    //The "/unwatch <playername>" command:
    IFMATCHES(%CHAT%, "^/unwatch (.+)$");
        MATCH(%CHAT%, "^/unwatch (.+)",{&unfriend});
        //The removal of <playername> from the strings.
        IFMATCHES(%@&thefriendlist%, "\b%&unfriend%\b");
            REPLACE(@&thefriendlist, "%&unfriend%", "");
        ELSE;
            LOG("%&prefix%Error: %&unfriend% is not on your friend list.");
        ENDIF;
    
        //If @&thefriendlist begins with a pipe, it is removed.
        IFMATCHES(%@&thefriendlist%, "^\|(.+)");
            MATCH(%@&thefriendlist%, "^\|(.+)",{&newlist});
            @&thefriendlist = %&newlist%;
        ENDIF;
    
        //If there are two pipes in a row in @&thefriendlist, one is removed.
        IFMATCHES(%@&thefriendlist%, "(.+)\|\|(.+)");
            REPLACE(@&thefriendlist, "||", "|");
        ENDIF;
    
        //If @&thefriendlist ends with a pipe, it is removed.
        IFMATCHES(%@&thefriendlist%, "(.+)\|$")
            MATCH(%@&thefriendlist%, "(.+)\|$",{&newfriendlist});
            @&thefriendlist = %&newfriendlist%;
        ENDIF;
    
        &readable = %@&thefriendlist%;
        REPLACE(&readable, "|", ", ");
        LOG("%&prefix%%&unfriend% was removed, and the friend list is now: %&readable%.");
        FILTER();
    ENDIF;
    
    //The "/friendlist" command:
    IFMATCHES(%CHAT%, "^/friendlist$");
        IFMATCHES(%@&thefriendlist%, "");
            LOG("%&prefix%There are currently no players on the friendlist.");
        ELSE;
            &readable = %@&thefriendlist%;
            REPLACE(&readable, "|", ", ");
            LOG("%&prefix%The players currently on the friend list are: %&readable%.");
        ENDIF;
        FILTER();
    ENDIF;
    
    //The "/clear friendlist" command:
    IFMATCHES(%CHAT%, "^/clear friendlist$");
        LOG("%&prefix%The friend list has been cleared.");
        @&thefriendlist = "";
        FILTER();
    ENDIF;
    }$$
    
    Event: onPlayerJoin (Important: This second script only, the first script is bound to a separate event.)
    Code:
    $${
    IFMATCHES(%@&thefriendlist%, "\b%JOINEDPLAYER%\b");
        LOG("&4[Friend List] &3%JOINEDPLAYER% joined the server.")
        PLAYSOUND(custom.playerJoin);
    ENDIF;
    }$$
    The sound file I used is located here: tinyurl.com/playerJoinSound

    Auto-Sell Macro
    Written by @SionainnSun
    Required Features: None
    General Purpose: Allows user to input any item, its worth, and what amount they want to sell via chat commands. There is then a display that shows how many of that the user has and their total worth.
    List of Commands: Do "/help autosell" (minus the quotes) once the macro is installed.
    Event: onSendChatMessage (Important: This first script only, other scripts are bound to other events.)
    Other Important Notes:
    • It is important that when you use the /sellitem command, you enter the full name of the item (for example, netherrack instead of nrack.) Otherwise, the macro mod will not be able to track when you pick up the item, although it will still be able to automatically sell them.
    Code:
    $${
    &prefix = "&4[Auto Selling Macro] &3";
    //The "/help autosell" command.
    IFMATCHES(%CHAT%, "^/help autosell$");
        LOG("&e---- &6Help: Automatic Selling &e-- &6Page: &c1 &6of &c1 &e----");
        LOG("&5&lAutomatic Selling Macro");
        LOG("&5&oDeveloped by SionainnSun.");
        LOG("&3/help autosell: &7Displays a list of commands for the automatic selling macro.");
        LOG("&3/sellitem &5<itemname> <worth>&3: &7Sets the item that will be sold to the specified item, and its worth to the specified worth (or 0 if no worth is specified.) It is important that if the worth is a multiple of ten (such as 40 cents), you enter it with a zero (i.e. \".40\" instead of \".4\".) The ID used should be the non-numerical one that you would use with the /worth command.");
        LOG("&3/sellamount &5<amount>&3: &7Sets the amount of items you must have in order for the macro to sell them.");
        LOG("&3/sellon: &7Turn on automatic selling.");
        LOG("&3/selloff: &7Turn off automatic selling.");
        LOG("&3/clear: &7Clears all entered data (item name, worth, sell amount, if selling is enabled, etc.)");
        LOG("&3/autosellinfo: &7Displays all current info (item name, worth, sell amount, if selling is enabled, etc.)");
        FILTER();
    ENDIF;
    
    //The "/sellitem <itemname> <worth>" command.
    IFMATCHES(%CHAT%, "^/sellitem (.+)");
        @#roundworth = 0;
        @#decworth = 0;
        IFMATCHES(%CHAT%, "/sellitem ([a-zA-Z]+) ([0-9]+)$");
            MATCH(%CHAT%, "/sellitem ([a-zA-Z]+) ([0-9]+)",{@&item,@#roundworth});
        ENDIF;
        IFMATCHES(%CHAT%, "/sellitem ([a-zA-Z]+) \.([0-9]+)");
            MATCH(%CHAT%, "/sellitem ([a-zA-Z]+) \.([0-9]+)",{@&item,@#decworth});
        ENDIF;
        IFMATCHES(%CHAT%, "/sellitem ([a-zA-Z]+) ([0-9]+)\.([0-9]+)");
            MATCH(%CHAT%, "/sellitem ([a-zA-Z]+) ([0-9]+)\.([0-9]+)",{@&item,@#roundworth,@#decworth});
        ENDIF;
        LOG("%&prefix%Your item is now &5%@&item% &3and its worth is &5$%@#roundworth%.%@#decworth%&3. If this is incorrect, please enter the command again with the correct item/worth.");
        FILTER();
    ENDIF;
    
    //The "/sellamount" command.
    IFMATCHES(%CHAT%, "^/sellamount ([0-9]+)$");
        MATCH(%CHAT%, "/sellamount ([0-9]+)",{@#sellamount});
        IF(@sell);
            LOG("%&prefix%Every &5%@#sellamount% &3items will be sold and selling is currently &5enabled&3. If you would like to change either of these things, see \"/help autosell\" for commands.");
        ELSE;
            LOG("%&prefix%Every &5%@#sellamount% &3items will be sold, but selling is currently &5disabled&3. If you would like to change either of these things, see \"/help autosell\" for commands.");
        ENDIF;
        FILTER();
    ENDIF;
    
    //The "/sellon" command.
    IFMATCHES(%CHAT%, "^/sellon$");
        SET(@sell);
        LOG("%&prefix%Items will now be sold. Use \"/selloff\" to disable automatic selling.");
        FILTER();
    ENDIF;
    
    //The "/selloff" command.
    IFMATCHES(%CHAT%, "^/selloff$");
        UNSET(@sell);
        LOG("%&prefix%Items will no longer be sold. Use \"/sellon\" to enable automatic selling.");
        FILTER();
    ENDIF;
    
    //The "/clear" command.
    IFMATCHES(%CHAT%, "^/clear$");
        @#roundworth = 0;
        @#decworth = 0;
        @&item = "";
        @#sellamount = 0;
        @#amount = 0;
        @#roundsellworth = 0;
        @#decsellworth = 0;
        SETLABEL(item, "Items: No item being tracked.");
        SETLABEL(worth, "Worth: $0.00);
        LOG("%&prefix%All data has been cleared. Use commands found in \"/help autosell\" to set it again.");
        FILTER();
    ENDIF;
    
    //The "/autosellinfo" command.
    IFMATCHES(%CHAT%, "^/iteminfo$");
        LOG("%&prefix%The current item is &5%@&item%&3.");
        LOG("%&prefix%The current worth is &5%@#roundworth%.%@#decworth%&3.");
        LOG("%&prefix%The current sell amount is &5%@#sellamount%&3.");
        IF(@sell);
            LOG("%&prefix%Automatic selling is currently &5enabled&3.");
        ELSE;
            LOG("%&prefix%Automatic selling is currently &5disabled&3.");
        ENDIF;
        LOG("%&prefix%Use the commands found in \"/help autosell\" to change any of these values.");
        FILTER();
    ENDIF;
    
    //If the item is sold, it clears the current value of it.
    IFMATCHES(%CHAT%, "^/sell %@&item%$");
        @#roundsellworth = 0;
        @#decsellworth = 0;
        @#amount = 0;
         SETLABEL(item, "%@&item%: 0");
         SETLABEL(worth, "Worth: $0.00")
    ENDIF;
    }$$

    Event: onPickupItem (Important: This second script only, the first script is bound to a different event.)
    Code:
    $${
    IFMATCHES(%PICKUPID%, "%@&item%");
        @#amount = %@#amount% + %PICKUPAMOUNT%;
        @#roundsellworth = %@#roundworth% * %@#amount%;
        @#decsellworth = %@#decworth% * %@#amount%;
    
        //Properly formats the worth (so we don't get a worth of $1.1000, for example.)
        DO;
            IF(%@#decsellworth% >= 100);
                @#roundsellworth = %@#roundsellworth% + 1;
                @#decsellworth = %@#decsellworth% - 100;
            ENDIF;
        UNTIL(@#decsellworth < 100);
    
        //Sells the items if selling is enabled.
        IF(@sell);
            IF(%@#amount% >= %@#sellamount%);
                ECHO("/sell %@&item%");
                @#amount = 0;
                @#roundsellworth = 0;
                @#decsellworth = 0;
            ENDIF;
        ENDIF;
    
        //Sets the labels.
        SETLABEL(item, "%@&item%: %@#amount%");
        IF(%@#decsellworth% = 0);
            SETLABEL(worth, "Worth: $%@#roundsellworth%.00");
        ELSEIF(%@#decsellworth% = 5);
            SETLABEL(worth, "Worth: $%@#roundsellworth%.05");
        ELSE;
            SETLABEL(worth, "Worth: $%@#roundsellworth%.%@#decsellworth%");
        ENDIF;
    ENDIF;
    }$$

    You also need to create two labels, with these specifications:
    The first is to display how many of the specific item you have.
    • Control Name: item
    • Label text: Leave it blank.
    • Binding: Leave it blank.
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!
    The second is to display the worth of the specified items you have.
    • Control Name: worth
    • Label text: Leave it blank.
    • Binding: Leave it blank.
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!

    PM Sound Macro
    Written by @SionainnSun
    Required Features: None
    General Purpose: Plays a custom sound whenever the player receives a pm.
    List of Commands: There are none.
    Event: onChat
    Code:
    $${
    IFBEGINSWITH(%CHATCLEAN%, "From");
        PLAYSOUND(custom.alert);
    ENDIF;
    }$$
    The sound file I used is here: http://tinyurl.com/PMAlertSound

    Coordinate Display Macro
    Written by @SionainnSun
    Required Features: None
    General Purpose: Displays the player's XYZ coordinates on the screen.
    List of Commands: There are none.
    Event: onJoinGame
    Code:
    $${
    DO;
        SETLABEL(Position,XYZ: %XPOS% / %YPOS% / %ZPOS%);
    LOOP(1);
    }$$
    You also need to create a label for this script. Fill in the parts of the label like so:
    • Control Name: Position
    • Label text: Leave it blank.
    • Binding: Leave it blank.
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!

    Custom AFK Command Macro
    Written by @SionainnSun
    Required Features: Back (can easily be modified to not include this feature)
    General Purpose: When the "/afk" command is entered, the player is automatically tp'ed home and their /ch afk message is automatically set. When it is entered again, the player is tp'ed back and their /ch afk message is turned off.
    List of Commands: "/afk" (minus the quotes) is the only available command, and toggles each time it is used. Its current state is displayed by a label.
    Event: onSendChatMessage
    Code:
    $${
    IF(%CHAT% = "/afk");
        IF(afk);
            LOG("&4[AFK Macro] &3AFK Mode inactive.");
            UNSET(afk);
            SETLABEL(AFK, "AFK Mode inactive,");
            ECHO("/ch afk");
            WAIT(2);
            ECHO("/back"); //remove this line if you do not have the back feature
        ELSE;
            LOG("&4[AFK Macro] &3AFK Mode active.");
            SET(afk);
            SETLABEL(AFK, "AFK Mode active.");
            ECHO("/ch afk"); //If you would like to add a custom afk message, do it here--make sure it's not too long!
            WAIT(2);
            ECHO("/home"); //You may want to remove this line if you do not have the back feature, or else you will not be able to get back to where you were. Also, if you have multihome, enter your desired home name as well.
        ENDIF;
    ENDIF;
    }$$
    You also need to create a label for this macro. The parts should be like this:
    • Control Name: AFK
    • Label text: Leave it blank.
    • Binding: Leave it blank.
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!

    Automatic Fly Macro
    Written by @SionainnSun and edited by @314
    Required Features: Fly/Fly+
    General Purpose: Attempts to enable flying whenever the player enters a new world (ex. rising, legacy, mining, nether, end, etc.) It does so regardless of whether flying is allowed in that world (such as the End.)
    List of Commands: There are none.
    Event: onWorldChange
    Code:
    $${
    IF(%SERVER% = "mc.ecocitycraft.com");
        WAIT(2);
        ECHO("/fly on");
    ENDIF;
    }$$
    This macro will attempt to turn on fly mode every time you enter a new world, regardless of whether or not you can fly in that world.

    Note: I've noticed that sometimes when you first join the server, fly mode doesn't get activated, but sometimes it does. Since it seems to be random whether it works on not, I think it's the fault of the mod itself and not my code :confused:

    Chat Channel Display Macro
    Written by @SionainnSun
    Required Features: None
    General Purpose: Displays the player's current chat channel on the screen.
    List of Commands: There are none.
    Event: onChat
    Code:
    $${
    IFMATCHES(%CHATCLEAN%, "Now chatting in (.+)");
        SET(chat);
        MATCH(%CHATCLEAN%, "Now chatting in (.+)\.",{@&channel});
    ENDIF;
    
    IFMATCHES(%CHATCLEAN%, "You are already in (.+)");
        SET(chat);
        MATCH(%CHATCLEAN%, "You are already in (.+)\.",{@&channel});
    ENDIF;
    
    IFMATCHES(%CHATCLEAN%, "Party Chat only (On|Off)");
        SET(chat);
        MATCH(%CHATCLEAN%, "Party Chat only (.+)",{&partychat});
        IFMATCHES(%&partychat%, "On");
            SET(&party, "On");
        ENDIF;
        IFMATCHES(%&partychat%, "Off");
            SET(&party, "Off");
        ENDIF;
    ENDIF;
    
    //Sets the color for global.
    IFMATCHES(%@&channel%, "Global");
        &color = "&f";
    ENDIF;
    
    //Sets the color for local.
    IFMATCHES(%@&channel%, "Local");
        &color = "&e";
    ENDIF;
    
    //Sets the color for trade.
    IFMATCHES(%@&channel%, "Trade");
        &color = "&7";
    ENDIF;
    
    //Sets the color for auction.
    IFMATCHES(%@&channel%, "Auction");
        &color = "&b";
    ENDIF;
    
    //Sets the color for VIP.
    IFMATCHES(%@&channel%, "VIP");
        &color = "&a";
    ENDIF;
    
    //Sets the color for mining.
    IFMATCHES(%@&channel%, "Mining");
        &color = "&e";
    ENDIF;
    
    //Sets the color for nether.
    IFMATCHES(%&channel%, "Nether");
        &color = "&d";
    ENDIF;
    
    //Sets the color for end.
    IFMATCHES(%@&channel%, "End");
        &color = "&d";
    ENDIF;
    
    //Sets the color for sg.
    IFMATCHES(%@&channel%, "SG");
        &color = "&5";
    ENDIF;
    
    //Sets the color for party chat (depending on whether or not it is on.)
    IFMATCHES(%&party%, "On");
        &partycolor = "&a";
    ELSE;
        &partycolor = "&c";
    ENDIF;
    
    IF(chat);
        SETLABEL(Party, "Party chat is currently %&partycolor%%&party%");
        SETLABEL(Channel, "Currently chatting in %&color%%@&channel%");
    ENDIF;
    }$$
    You also need to create a label with the following information:
    • Control Name: Channel
    • Label text: Leave it blank
    • Binding: Leave it blank
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!
    And then another label with this information:
    • Control Name: Party
    • Label text: Leave it blank
    • Binding: Leave it blank
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!

    EXP Display Macro
    Written by @SionainnSun and edited by @314 (the same script is probably posted many times under different authors; this is a common way to do an xp display.)
    Required Features: None
    General Purpose: Displays the player's experience on the screen.
    List of Commands: There are none.
    There isn't any code at all for this macro :) All you need to do is create a label, with the parts of it like so:
    • Control Name: Whatever you want! I would suggest "Experience" or something similar.
    • Label text: Experience: %%
    • Binding: TOTALXP
    • Foreground Color: Whatever you want!
    • Background Color: Whatever you want!
    • Text Align: Whatever you want!
    Sometimes, the label seems to be slightly slow at updating your experience, but it usually does do it eventually. If you notice it not working, let me know and I'll post the script I had before (even though it's somewhat inefficient compared to this method.)

    If you have any custom macro you want made, send me a forum pm or comment below! I'll be happy to try anything, and (for now, anyway) every macro I make will be free. I'll also post them here in this thread (I'll edit it each time I write a new macro that's worth adding.)

    If you have any questions about the macros I've posted on here, please feel free to let me know, either on this thread or via forum pm :) I'll be glad to help!
     
    #1 SionainnSun, Jul 17, 2016
    Last edited: Oct 1, 2016
  2. Samurai_N

    Samurai_N Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 2, 2016
    Messages:
    202
    Trophy Points:
    11,740
    Gender:
    Male
    Ratings:
    +87
    Multiple questions:
    1. Can I have that fly macro that you have?
    2. Can I have that noise when someone pms you macro?
    3. The idea that I have for a macro is like this:
      1. I use a command like /watch <username> and it adds the usernames to this list
      2. And when I log off and log on later or tomorrow it tells me who on the list is online with a message like <username>, <username>, and <username> are online.
      3. And when I'm online and someone on the list logs on then it gives me a message like <username> has logged on.
    That's all I can think of for now
     
  3. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    1. See my original post, I edited it :p
    2. Ditto
    3. I'll work on that and get back to you when I'm done :)
     
  4. ScopicX

    ScopicX Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Jan 19, 2016
    Messages:
    1,233
    Trophy Points:
    17,290
    Gender:
    Male
    Ratings:
    +854
    I'm still stuck on how to install the macros. My computer is unable to open ".zip" files. Instead of buying a macro, Id like to buy help on how to install mumfreys macro thing xD
     
  5. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    Ok so the actual macro mod is dependent on LiteLoader (a mod loader), so you need to install that first. The first post on this page, which is by Mumfrey, is super super helpful to install LiteLoader, especially if you're using Forge/Optifine/Shaders: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1290155-liteloader. If you don't feel like visiting that page, you can download LiteLoader from here: http://www.liteloader.com/download, either as a .jar or .exe file. Once you download the file, run it (double click on it in File Explorer on PC) and choose to create a profile/which profile to extend from. Make sure the Minecraft launcher is closed when you do this!

    Once you have that installed, you need to download the mod itself, which you can get here: http://tinyurl.com/macrokeybindmod. This should download as a .litemod file, but some browsers turn it into a .zip file instead, which seems to be what's happening to you. If that happens, just edit the file name to end in .litemod instead of .zip. Once the .litemod file is downloaded, move it to the mods folder ni your .minecraft folder (can be found by following this file path, usually: C:\Users\YourNameHere\AppData\Roaming\.minecraft\mods).

    Now relaunch Minecraft and you should be good to go! You can check if it actually installed by going to the "Controls" menu in Minecraft and seeing if there are options there for Macro / Keybind Mod.

    If you still have questions or something didn't work, feel free to let me know :D
     
    • Friendly Friendly x 1
    • Useful Useful x 1
    • List
  6. ScopicX

    ScopicX Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Jan 19, 2016
    Messages:
    1,233
    Trophy Points:
    17,290
    Gender:
    Male
    Ratings:
    +854
    This was super helpful. Thank you so much!!!
     
  7. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    I'm glad I could help!! Let me know if you need anything else :D
     
  8. ScopicX

    ScopicX Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Jan 19, 2016
    Messages:
    1,233
    Trophy Points:
    17,290
    Gender:
    Male
    Ratings:
    +854
    Can you make an auto-chat macro (automatically advertise in tr)? I know it's definitely possible :p I would really appreciate it if you could take the time to try it :)
     
  9. ChefCraft19

    ChefCraft19 Microsoft Excel Certified
    Mythic ⚔️ I ⚔️ President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ VII ⭐ Gameplay Architect Premium Upgrade

    Joined:
    Mar 6, 2012
    Messages:
    2,168
    Trophy Points:
    72,410
    Gender:
    Male
    Ratings:
    +433
    #9 ChefCraft19, Jul 20, 2016
    Last edited: Jul 20, 2016
  10. Samurai_N

    Samurai_N Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 2, 2016
    Messages:
    202
    Trophy Points:
    11,740
    Gender:
    Male
    Ratings:
    +87
    is it done
     
  11. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    @BaseballIsGolden of course :) This script will sell all the melons in your inventory once every minute:
    Code:
    $${
    if(sellmelons)
        log("&4[Melon Macro] &3Automatic melon selling has been stopped.");
        unset(sellmelons);
        stop;
    elseif(!sellmelons);
        log("&4[Melon Macro] &3Automatic melon selling has been activated.");
        set(sellmelons);
        do;
            echo("/sell melon");
            wait(60);
        loop;
    endIf;
    }$$
    
    You can bind it to a key or a button, your choice :) When you press the key the first time, it will activate "melon selling mode" and automatically sell all the melons in your inventory every minute. When you press the key/button again, it will inactivate "melon selling mode" and the loop will no longer run. Basically, every time you press the key/button, it switches the state of "melon selling mode" to the opposite state (active to inactive and vice versa.) I hope that made sense :confused:

    You might want to go in and change the amount of time in the wait() command... I've never farmed with an msword before, so I don't really know how quickly your inventory fills up. (The number inside the parentheses of the wait() command is in seconds by default.)

    If there are any problems with it, let me know and I'll try to fix them :D

    @Samurai_N I have been working on the friend list macro you wanted, don't worry :p It's just about done now, I just want to add one more thing... It will be done sometime tomorrow I think. However, this part is a problem:
    Unfortunately, there's no way to access a list of online players in the macro mod, so I can't do that :( You would have to do /seen on them manually.
     
    #11 SionainnSun, Jul 20, 2016
    Last edited: Jul 20, 2016
  12. Samurai_N

    Samurai_N Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 2, 2016
    Messages:
    202
    Trophy Points:
    11,740
    Gender:
    Male
    Ratings:
    +87
    ok can you make me a macro that once i get less than 25% durability, the system gives me a message like STOP!!! every time i use it because i already broke 2 pump axes because i wasn't looking at the durability
     
  13. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    @Samurai_N RIP pump axes :p Here's the macro:
    Code:
    $${
    IF(%SERVER% = "mc.ecocitycraft.com");
        IF(%DURABILITY% <= %ITEMDAMAGE% / 4);
            LOG("&4[Durability Macro] STOP!!! Your tool is in DANGER!!! It has reached 25% of its durability. You need an erep.");
        ENDIF;
    ENDIF;
    }$$
    To use it, just copy/paste the code into a .txt file and bind it to the onDurabilityChange event.

    Let me know if there are any problems :)
     
  14. ChefCraft19

    ChefCraft19 Microsoft Excel Certified
    Mythic ⚔️ I ⚔️ President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ VII ⭐ Gameplay Architect Premium Upgrade

    Joined:
    Mar 6, 2012
    Messages:
    2,168
    Trophy Points:
    72,410
    Gender:
    Male
    Ratings:
    +433
    Works great, thank you so much!
     
  15. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    Awesome, I'm glad to hear it :D And np :) Would you mind telling me what you set the time to? I just want to know so I can edit my code that I'll post in my first post of this thread :happy:
     
  16. ChefCraft19

    ChefCraft19 Microsoft Excel Certified
    Mythic ⚔️ I ⚔️ President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ VII ⭐ Gameplay Architect Premium Upgrade

    Joined:
    Mar 6, 2012
    Messages:
    2,168
    Trophy Points:
    72,410
    Gender:
    Male
    Ratings:
    +433
    I currently have it set at 450. I usually have around 600 melons at that point. For a full inventory, it would be over double or almost 3 times that. I might just be a slow farmer :p Anyway it's really up to the user, if they like to sell more often or wait for a full inventory. Hopefully that helps!
     
  17. Samurai_N

    Samurai_N Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 2, 2016
    Messages:
    202
    Trophy Points:
    11,740
    Gender:
    Male
    Ratings:
    +87
    Is it possible to do /seen but only show me the online ones. If not can it just do /seen on everyone in the list.
     
  18. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    It does, thank you! :)

    I don't know how :( It's likely you would get kicked for spamming commands, anyway. @Samurai_N anyway, I finished coding what I could, here you go:
    This script needs to be bound to the "onSendChatMessage" event:
    Code:
    $${
    &prefix = "&4[Friend List]";
    IFMATCHES(%CHAT%, "^\.help friendlist$");
        LOG("&4[Macro] &3A list of commands for the Friend List macro will now be displayed.");
        LOG("&4[Friend List] &3.watch <playername>: Adds specified player to the friend list.");
        LOG("&4[Friend List] &3.unwatch <playername>: Removes the specified player from the friend list.");
        LOG("&4[Friend List] &3.friendlist: Displays all the players on the friend list.");
        LOG("&4[Friend List] &3.clear friendlist: Clears all players from the friend list.");
        FILTER();
    ENDIF;
    
    //The ".watch <playername>" command:
    IFMATCHES(%CHAT%, "^\.watch (.+)$");
        MATCH(%CHAT%, "^\.watch (.+)",{&tempfriend});
        IFMATCHES(%@&thefriendlist%, "\b%&tempfriend%\b");
            LOG("&4[Friend List] &3Error: %&tempfriend% is already on your friend list.");
        ELSE;
            @&thefriendlist = "%@&thefriendlist%|%&tempfriend%";
        //Removes "N U L L" from the beginning of %@&thefriendlist% if it begins with that.
            IFMATCHES(%@&thefriendlist%, "^N U L L\b");
                MATCH(%@&thefriendlist%, "^N U L L(.+)",{&list});
                @&thefriendlist = %&list%;
                MATCH(%@&thefriendlist%, "^\|(.+)",{&newlist})
                @&thefriendlist = %&newlist%;
                &readablelist = "%&tempfriend%";
            ELSEIF(%&readablelist% = "");
                &readablelist = %&tempfriend%;
            ELSE
                &readablelist = "%&readablelist%, %&tempfriend%";
            ENDIF;
        LOG("&4[Friend List] &3%&tempfriend% has been added. The friend list now has these people: %&readablelist%);
        ENDIF;
        FILTER();
    ENDIF;
    
    //The ".unwatch <playername>" command:
    IFMATCHES(%CHAT%, "^\.unwatch (.+)$");
        MATCH(%CHAT%, "^\.unwatch (.+)",{&unfriend});
        //The removal of <playername> from the strings.
        IFMATCHES(%@&thefriendlist%, "\b%&unfriend%\b");
            MATCH(%@&thefriendlist%, "(.*)%&unfriend%(.*)",{&part1,&part2});
            MATCH(%&readablelist%, "(.*)%&unfriend%(.*)",{&readpart1,&readpart2});
            @&thefriendlist = "%&part1%%&part2%";
            log("before the name in the readlist is %&readpart1% and after is %&readpart2%");
            &readablelist = "%&readpart1%%&readpart2%";;
        ELSE;
            LOG("%&prefix% &3Error: %&unfriend% is not on your friend list.");
        ENDIF;
        //If @&thefriendlist begins with a pipe, it is removed.
        IFMATCHES(%@&thefriendlist%, "^\|(.+)");
            MATCH(%@&thefriendlist%, "^\|(.+)",{&newlist});
            @&thefriendlist = %&newlist%;
        ENDIF;
        //If there are two pipes in a row in @&thefriendlist, one is removed.
        IFMATCHES(%@&thefriendlist%, "(.+)\|\|(.+)");
            MATCH(%@&thefriendlist%, "(.+)\|\|(.+)",{&newlist1,&newlist2});
            @&thefriendlist = "%&newlist1%|%&newlist2%";
        ENDIF;
        //If @&thefriendlist ends with a pipe, it is removed.
        IFMATCHES(%@&thefriendlist%, "(.+)\|$")
            MATCH(%@&thefriendlist%, "(.+)\|$",{&newfriendlist});
            @&thefriendlist = %&newfriendlist%;
        ENDIF;
        //If &readablelist begins with a comma, it is removed.
        IFMATCHES(%&readablelist%, "^, (.+)");
            MATCH(%&readablelist%, "^, (.+)",{&newreadlist});
            log("the new readlist is %&newreadlist%");
            &readablelist = %&newreadlist%;
        ENDIF;
        //If &readablelist has two commas in a row, one is removed.
        IFMATCHES(%&readablelist%, "(.+), , (.+)");
            MATCH(%&readablelist%, "(.+), , (.+)",{&newread1,&newread2});
            &readablelist = "%&newread1%, %&newread2%";
        ENDIF;
        //If &readablelist ends with a comma, it is removed.
        IFMATCHES(%&readablelist%, "^(.+), $");
            MATCH(%&readablelist%, "^(.+), $",{&new});
            &readablelist = %&new%;
        ENDIF;
        LOG("%&prefix% &3%&unfriend% was removed, and the friend list is now: %&readablelist%.");
        FILTER();
    ENDIF;
    
    //The ".friendlist" command:
    IFMATCHES(%CHAT%, "^\.friendlist$");
        LOG("%&prefix% &3The players currently on the friend list are: %&readablelist%");
        FILTER();
    ENDIF;
    
    //The ".clear friendlist" command:
    IFMATCHES(%CHAT%, "^\.clear friendlist$");
    //This section is commented out because WAIT() isn't working for some reason.
    //    IF(!@clear);
    //        SET(@clear)
    //        LOG("&3Are you sure you want to clear your friend list? Type the command again within five seconds to confirm.");
    //        LOG("1 clear is now %@clear%");
    //        WAIT(5000ms);
    //        UNSET(@clear);
    //        LOG("2 clear is now %@clear%");
    //    ELSEIF(@clear);
            LOG("%&prefix% &3The friend list has been cleared.");  
            @&thefriendlist = "N U L L";
            &readablelist = "";
            FILTER();
    //    ELSE
    //        LOG("%&prefix% &3Clearing the friend list has been canceled.")
    //    ENDIF;
    //    UNSET(@clear);
        FILTER();
    ENDIF;
    }$$
    And this code needs to be bound to the "onPlayerJoined" event:
    Code:
    $${
    IFMATCHES(%@&thefriendlist%, "\b%JOINEDPLAYER%\b");
        LOG("&4[Friend List] &3%JOINEDPLAYER% joined the server.")
        PLAYSOUND(custom.playerJoin); //This is optional; if you don't want a sound, just remove this line
    ENDIF;
    }$$
    If you do want a sound, I had a tutorial in the PM sound macro spoiler on how to get one to play.
    I will be updating my first post on this thread soon with this code. I'll also add separate tutorials (under separate spoilers) on how to play a custom sound, event binding, and how to make labels, since the way I have it at the moment is pretty unclear.

    If you have any questions or issues, just let me know :D
     
    #18 SionainnSun, Jul 22, 2016
    Last edited: Jul 22, 2016
  19. Samurai_N

    Samurai_N Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 2, 2016
    Messages:
    202
    Trophy Points:
    11,740
    Gender:
    Male
    Ratings:
    +87
    Thanks so much. This was probably one of your hardest requests (out of like 3 requests in this thread). I'll try it out as soon as I get home.
     
  20. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    Yeah, definitely the hardest request :p It was a good learning experience, though :D

    Also, update: Added code for the friend list macro to the main post at the beginning of the thread. Will be organizing the tutorials shortly :)