[Open Source] ScarabCoder's Free Macros - LWC, Lotto, Pumpkin Farming, More!

Discussion in 'Basic Tutorials' started by ScarabCoder, Nov 21, 2015.

  1. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Open Source!
    Check it out on GitHub here: https://github.com/scarabcoder/macros
    That is my entire macros folder, containing every bit of macro code I've written. You can pick and choose things to change if you like, or, if you are a GitHub wizard, you could probably just make a separate instance of Minecraft using MultiMC and install my entire macros folder into your blank instance and edit it easier that way.
    Everything that might happen is your own fault though; use at your own risk!
    Hello!
    As some of you may know, I program macro scripts. There any many things on ECC that can be made easier with macros, and I have taken advantage of this by (legally) automating many tasks that you would normally put off or forget. I've gotten quite skilled with the macro mod, and my macros are becoming much more complex then they were before.

    Instructions for installing the macro mod:
    https://www.ecocitycraft.com/forum/...install-macro-mod-and-the-ecc-minimap.112961/
    Macro List:

    LWC Removal Request Generator

    Auto-Lotto Macro

    Pumpkin Farming Macro

    Trade Sign Generator

    Durability and Repair Macro

    Friend List - COMING SOON (TM)

    Details Per Macro:
    LWC Removal Request Generator
    The LWC Removal Request Generator does what the name suggests; it generates a .txt file that has a form filled out that can be copy and pasted to a forum post, with some minor tweaks.

    Simply look at the locked block that you need removed, and do the command "/lwc file". It's that easy!

    UPDATE: The macro has changed to comply with the new LWC Removal Request format!
    -----------------BEGIN AUTO-GENERATED TEXT----------------
    What is your in-game name?
    ScarabCoder

    Have you read the in-depth instructions for this application?
    Yes

    What world is this protection in:
    rising

    Are we removing LWC Protections or trade signs?
    LWC Protection

    What town is this protection in?
    They are in buildtopia application URL here

    Whose is this protection?
    Owner: rfmRuckys (65fcb4a5-c077-4d0c-a081-da60be4eed44)

    Is the player who owns this inactive? Have you tried contacting them about removing the lock?
    Player inactive

    Where is this protection?
    /tppos 2249 66 5098 95 10
    (Note to admins: The above command can be copied and pasted ingame. Includes directional TP

    Is this protection in a PvP area?
    No

    Why are you requesting this to be removed?
    Protection is in the way and I am cleaning up
    --------------------END AUTO-GENERATED TEXT---------------
    Open the macro mod GUI by doing Shift+~ (by default. ~ is in the top-left corner of the keyboard), and at the top where it says "Macro Bindings: Keys" press the little arrow pointing right. It will go to the events page. Now, press the button that says onSendChatMessage. In the text field, add this:
    $$<lwc.txt>
    Then, press Edit File... and type lwc.txt and press enter. Then, in the large text field, paste this code:
    Code:
    $${
    if(%KEYNAME% == "onSendChatMessage")
    if(%CHAT% == "/lwc file")
    wait("1")
    
    @#blocklwc = 1
    @#click = 1
    log(&aLeft click the protection)
    echo("/lwc info")
    
    
    endif()
    endif()
    }$$
    Now, press "Save" and "Save" again to save the file and event code. Then, in the top-left corner, press the little tab. From the dropdown menu, select Edit Chat Filter. At the end of whatever code may be there, paste this code:

    Code:
    if(@#blocklwc == 1)
    if(%CHATCLEAN% == "/lwc")
    @#blocklwc = 0
    filter()
    endif()
    endif()
    
    if(@#click == 1)
    ifcontains(%CHATCLEAN%, "Punch a protection")
    FILTER()
    endif()
    if(%CHATCLEAN% == "")
    filter()
    endif()
    ifcontains(%CHATCLEAN%, "Owner: ")
    @&owner = %CHATCLEAN%
    replace(&owner, "Owner: ")
    FILTER()
    
    endif()
    ifcontains(%CHATCLEAN%, "Protection type:")
    @#click = 0
    @#world = 1
    echo("/whereami")
    FILTER()
    endif()
    endif()
    if(@#world == 1)
    ifcontains(%CHATCLEAN%, "Current World: ")
    @&world = %CHATCLEAN%
    replace(@&world, "Current World: ")
    
    endif()
    
    ifcontains(%CHATCLEAN%, "Pitch: ")
    @#world = 0
    @#rg = 1
    echo("/rg i")
    endif()
    filter()
    endif()
    if(@#rg == 1)
    ifcontains(%CHATCLEAN%, "Region: ")
    @&region = %CHATCLEAN%
    replace(@&region, " (type=cuboid, priority=0)")
    replace(@&region, "Region: ")
    
    endif()
    ifcontains(%CHATCLEAN%, "Bounds: ")
    @#rg = 0
    logto("lwcremove.txt","1. What is your in-game name?")
    logto("lwcremove.txt", %PLAYER%)
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "2. Have you read the in-depth instructions for this application?")
    logto("lwcremove.txt", "Yes")
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "3. Are we removing LWC Protections or trade signs?")
    logto("lwcremove.txt", "LWC Protection")
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "4. What town is this protection in?")
    
    logto("lwcremove.txt", "They are in %@&region% application URL here")
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "5. What world is this protection in?")
    logto("lwcremove.txt", %@&world%)
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "6. Whose is this protection?")
    logto("lwcremove.txt", %@&owner%)
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "7. Is the player who owns this inactive? Have you tried contacting them about removing the lock?")
    
    logto("lwcremove.txt", "Player inactive")
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "8. Where is this protection?")
    logto("lwcremove.txt", "/tppos %XPOS% %YPOS% %ZPOS%")
    
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "9. Is this protection in a PvP area?")
    
    logto("lwcremove.txt", "No")
    logto("lwcremove.txt", "")
    logto("lwcremove.txt", "10. Why are you requesting this to be removed?")
    logto("lwcremove.txt", "Protection is in the way and I am cleaning up")
    logto("lwcremove.txt","--------------------END AUTO-GENERATED TEXT---------------")
    logto("lwcremove.txt","")
    logto("lwcremove.txt","")
    logto("lwcremove.txt","")
    log(&aRemoval request generated! Go to your minecraft folder, .minecraft/liteconfig/commmon/macromod/logs/lwcremove.txt)
    log(&aYou will need to scroll to the bottom to copy the text)
    log(&aClick this link to file a report:)
    log("https://www.ecocitycraft.com/forum/forums/staff-requests.44/create-thread")
    endif()
    FILTER()
    endif()
    
    Now, simply run the command "/lwc file" and left click a protection. Please do note that the protection CANNOT BE YOUR OWN. If it is, then you will need to restart Minecraft as chat will be muted.
    First, it uses the "onSendChatMessage" event to catch the /lwc file command. It then runs the /lwc info command, and hides the chat message it gives. Then, when you left click a protection, the chat filter catches the result, stores the protection's owner's username and stores it in a variable. It then runs the /whereami command to tell what world you are in. Finally, it runs the /rg i command to tell what town you are in, and saves it into a variable.

    It then writes to lwcremove.txt all the data that needs to be filled in, and fills the coordinates with the internal macro variables. It also generates a command, /tppos (thanks idkhowtoplay for helping out here), that admins can copy-and-paste into Minecraft. It even includes pitch and yaw, meaning that they will teleport looking at the protection that needs removing!

    Auto-Lotto Macro
    This one is for you people who have like 400k in your bal, and go AFK while you lotto.
    It's fairly simple. It automatically buys a custom amount of tickets a custom amount of time before lotto ends. Not only that, but it features custom commands! It can also buy tickets, even up to 1 second before lotto ends! Here is what it does, in a simple picture (the chat only, not my random GUI stuff at the top corners):
    [​IMG]
    If you ever have tried coding anything accurate related to the /lotto command, you wil know that there is a command cooldown. This means that you have to execute the /lot command only about every 4 seconds at the least. This isn't good, considering you want your macro to be extremely exact. So, instead of getting the time left using the /lot command, it starts a 15 minute counter when lottery ends, and runs off of that. The downside is, the automatic lottery buying won't kick in until the lottery has ended at least once.
    Pumpkin Farming Macro
    Out of all the macros I sell, this is the simplest in design, and the most used out of all my macros. Very simply, you can toggle pumpkin farming mode on with a keybind. Every 60 seconds, it will sell all the pumpkins in your inventory. It also keeps sprint on, so you only need to hold the break button and W key. Unfortunately, unless you have feed, you will also have to stop to eat.
    Ingame, open the macro mod GUI by doing SHIFT+~ (~ is in the top-left corner of the keyboard). Then, press the key you want to toggle the pumpkin farming mode with. It will show you a text field. In the text field, paste this in:
    $${EXEC("toggle.txt")}$$
    Then, on the side, there is a button "Edit File...". Click it. In the text field that shows up, type toggle.txt and press enter. It will open up a larger text field. Paste this code there:

    Code:
    if(@#pump == 0)
    @#pump = 1
    LOG("Pumpkin Farming On")
    elseif(@#pump == 1)
    @#pump = 0
    LOG("Pumpkin Farming Off")
    ECHO("/sell pumpkin")
    else
    @#pump = 0
    endif()


    And press Save, then Save again. At the top, you will see this text: "Macro Binding: Keys".
    Press the arrow to the right of the text. Then, press the text button that says "onJoinGame". In the text field, paste this code:

    $${EXEC("pump.txt")}$$$${EXEC("sprint.txt")}$$

    Then, press "Edit File..." and in the text field type pump.txt
    Paste this code in the large text field:

    Code:
    DO()
    if(@#pump = 1)
    ECHO("/sell pumpkin")
    
    endif()
    WAIT(60)
    LOOP()


    And press Save. Then, press "Edit File..." again and in the text field type sprint.txt
    In the big text field, paste this code:


    Code:
    DO()
    IF(@#pump == 1)
    sprint()
    endif()
    loop()

    And you are done! Press the key you set for toggling, and pumpkin mode will toggle on/off!
    Coming Soon, to threads near you!
    Trade Sign Generator
    Once again, a title that basically explains what the macro does.
    Simply have signs in your hotbar, hold what you want to sell in the sign, and press a key. It will ask you to input how much you want to sell of the item per sign click, and then how much you want to stock. Finally, it will ask how much you want to sell the item(s) for.
    Press SHIFT+~ to open the macro mod GUI. Navigate to the main keyboard section if not already there. Press the onscreen key that you want to use when you create a trade sign. In the text field, paste this: $$<tradesign.txt>
    Now, press Edit File... and type tradesign.txt and press enter. In the large text field, paste this code:
    Code:
    $${
    &tradetext = "[Trade]"
    &line3 = %ITEM%
    prompt(&itemamount,$$?,"How many units are you selling per buy?")
    prompt(&line3am,$$?,"How much of the item you are selling do you want to stock? (Example: 5)")
    prompt(&line2,$$?,"How much will this unit cost? (example:$20, 1 dirt)")
    &line3 = %&itemamount% %&line3%:%&line3am%
    
    placesign(%&tradetext%,%&line2%,%&line3%,"",true)
    GUI()
    }$$
    And press "Save", then "Save" again to save the settings. You are done! To use, hold the item you want to sell in your hand and make sure there are signs in your hotbar. Press the key you bound, and answer the questions asked.
    NOTE: THIS DOES NOT WORK ON ITEMS WITH SUB-IDS. FOR EXAMPLE, SAPLINH

    Durability and Repair Macro
    Everytime the durability on whatever tool you are using gets below 100 (100 blocks to break before the tool breaks), it does the /erepair command. It's extremely simple.
     
    • Like Like x 1
    • Winner Winner x 1
    • List
    #1 ScarabCoder, Nov 21, 2015
    Last edited: Dec 24, 2015
  2. ThomasVerth

    ThomasVerth Builder
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Oct 3, 2015
    Messages:
    406
    Trophy Points:
    33,360
    Gender:
    Male
    Ratings:
    +615
    grat job on this migh get one later on
     
  3. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Awesome, hope ya do :)
     
  4. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    This is something I have a question about; does it show which watched players are online right now or whether they joined? (If the first one, I am very interested as I have been unable to find an efficient way to see when a player logs off and is thus no longer a part of the online friends list.)


    On a side note: We will see who will win - 314's open source macros or your commercial macros. Good luck. :)
     
    #4 314, Nov 22, 2015
    Last edited: Nov 22, 2015
  5. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    I actually haven't started on this one yet, but I have thought quite a lot about it. I'm thinking that using /seen wold be a good method as to see whether they left, by simple executing it periodically. Probably not the best way to do it, however. Especially seeing as you might have multiple players on the friend list, however, that's a lot of /seen commands executed (*cough chough* Jamie decrease the sensitivity of command spam *cough cough*).

    Otherwise, I don't see quite how. Maybe the macro mod has some function that requires a player, and can tell if that player is online?

    And yes, I'll be watching that. I might just release these for free in the end, but not sure. I'm still proud of the fact that I created a macro that everyone said was impossible to make, and should cost a good 40k to buy (the LWC Removal Request Generator).
     
  6. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Ah. Feel free to keep me informed about that project. :p
    About that - it basically generates a full LWC that only needs to be copied and pasted into a thread? I really want to know how you did the town apps, but I can't afford that. D:
    Also, you said 40k - but your thread says 10k. :p
     
  7. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    I, ah, didn't. That is something the user has to do. Which is why they can modify the code so it generates with their town app in it. Otherwise, everything else works fine. And the 40k was suggested by another user when I was still making it, but he basically said it was impossible. It isn't. I coded the macro twice, in fact.
     
    • Optimistic Optimistic x 1
    • List
  8. ThomasVerth

    ThomasVerth Builder
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Oct 3, 2015
    Messages:
    406
    Trophy Points:
    33,360
    Gender:
    Male
    Ratings:
    +615
    Subject: [Macro] pumpkin Farming Macro
    Will you need help installing the macro mod (not macro script): yes i have no clue how to install it
    What Operating System are you using: windos 7
    Do you agree NOT to use the macro before paying for it (you can test it): yes
     
  9. spentza

    spentza Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Dec 21, 2014
    Messages:
    62
    Trophy Points:
    14,370
    Gender:
    Male
    Ratings:
    +23
    Subject: [Macro] Pumpkin farming macro
    Will you need help installing the macro mod (not macro script): Yes
    What Operating System are you using: I'm using window vista
    Do you agree NOT to use the macro before paying for it: i agree
     
  10. scotalot100

    scotalot100 Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Mar 15, 2013
    Messages:
    77
    Trophy Points:
    25,550
    Gender:
    Male
    Ratings:
    +10
    Since ECC is on 1.8, how do you get macro to work?
     
  11. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Sorry for any confusion, but you need to forum PM me with this info. Thank you!

    It's an early beta of the macro mod that came out a while ago.
     
  12. ze7707

    ze7707 Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Feb 5, 2014
    Messages:
    1,365
    Trophy Points:
    25,640
    Ratings:
    +442
    Can I look at the LWC Removal macro but, I might not buy it. If I get the code and try it and don't buy it I won't use it anymore by the way.
     
  13. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    For a second there, I thought you were zr (I get confused between you two a lot).

    Sure, just forum PM me. You can try it out if you like.
     
  14. scotalot100

    scotalot100 Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Mar 15, 2013
    Messages:
    77
    Trophy Points:
    25,550
    Gender:
    Male
    Ratings:
    +10
    If you find one, could you give link? Assuming its not too much trouble..
     
  15. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
  16. scotalot100

    scotalot100 Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Mar 15, 2013
    Messages:
    77
    Trophy Points:
    25,550
    Gender:
    Male
    Ratings:
    +10
  17. scotalot100

    scotalot100 Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Mar 15, 2013
    Messages:
    77
    Trophy Points:
    25,550
    Gender:
    Male
    Ratings:
    +10
    Subject: [Macro] Auto pumpkin thing
    Will you need help installing the macro mod (not macro script): Yeah.. There are several issues
    What Operating System are you using: Mac OSX El Capitan
    Do you agree NOT to use the macro before paying for it (you can test it): Yeah..
     
  18. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Sorry, but could you forum PM me with this instead? Thanks!
     
  19. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Attention anyone who cares! My macros will be free from now on, just let me go and update this thread with instructions + code.
    @Moderator Can a moderator move this to the Tutorial forum section (or wherever this might belong now) and rename the title to "ScarabCoder's Free Macros - LWC, Lotto, Pumpkin Farming, More!"
    Thank you!
     
  20. ScarabCoder

    ScarabCoder Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Sep 12, 2015
    Messages:
    305
    Trophy Points:
    15,790
    Gender:
    Male
    Ratings:
    +235
    Hmm, didn't tag moderators properly. @ze7707 @Bashdash100 For a few, not sure if they can rename/move threads though.