• 0

    posted a message on Macro / Keybind mod scripts!
    I've searched the main thread for information regarding this, but after sorting through 100+ posts using the search feature, I've determined that it hasn't been answered. I posted this in the main thread, but no response, so I'm hoping someone here might know a bit more about scripts.


    I'm trying to make a crafting macro that takes into consideration items you currently have in your inventory (i.e. using mixed materials), as well as use prompts to set the total quantity you want. What I've been using to make bookshelves is:
    $${CRAFTANDWAIT(339,144);CRAFTANDWAIT(340,48);CRAFTANDWAIT(5,96);CRAFTANDWAIT(47,16)}$$
    but it makes 144 paper regardless of if you already had paper in your inventory, 48 books regardless of inventory, and 96 wood planks (again) regardless of inventory. It also only makes bookshelves in quantities of 16.

    So I'm trying to make a script that will first prompt you for the quantity you want, but if you type "help" as the quantity, I want it to tell the amount of most-raw materials are needed per unit of final product. I think I have the prompting part down correctly (it's terribly incomplete).
    $${
    PROMPT(&quantity,"$$[quantity]","How many do you want to make?");
    		 IF(&quantity = "help");
    					 LOG("9 Sugarcane, 3 Leather, and 1.5 Logs are needed for each unit");
    		 ELSE;


    From there, I am wanting to determine the amount of materials present in the player's inventory (i.e. # of paper, books, and wood planks) and temporarily save those values (like A, B, C, etc. on a graphing calculator). But I can't figure out how to determine the quantity of an item you have in your inventory and how to save the value.

    For example, if someone has a stack of 34 oak wood planks (ID=5) and a stack of 7 jungle wood planks (ID=5:3), I can't figure out how to get the quantity unless it's in my hotbar using the GETSTACK command. As for the GETSLOTITEM command, I really can't figure out if it's relevant or what the various values it can find are.

    But once we've determined that the player has 41 wood planks, I would like to save the value as [planks] for referencing later in the script. I'm wanting to do the same with the sugarcane, leather, books, and logs so it can calculate if you will be able to make the quantity prompted and return a message stating more of what you need. I came up with a rough code for it, but I'm not 100% on how the mod does order of operations calculations or how flags SET/UNSET work. I'm also running on the assumption that if something is between %s, it is run as a calculation and only the final result is displayed to the user. If I knew how to save values, it'd be a lot more compact.
    //Assuming:
    //Logs = 'logs'
    //Wood planks = 'planks'
    //Sugarcane = 'sugarcane'
    //Paper = 'paper'
    //Books = 'books'
    //Leather = 'leather'
    
    
    		 IF(((4*&logs)+&planks) < (6*&quantity);
    					 LOG("You need %(((6*&quantity)-((4*&logs)+&planks))/4)% more logs.");
    		 ELSE;
    					 SET(enough_logs);
    		 IF(((3*&sugarcane)+(3*&paper)+&books) < (3*$quantity));
    					 LOG("You need %((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))% more sugarcane.");
    		 ELSE;
    					 SET(enough_sugarcane);
    		 IF(&books < (3*&quantity));
    					 IF(&leather < ((((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))+&sugarcane))/3)
    								 LOG("You need %(((((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))+&sugarcane))/3)-&leather)% more leather.");
    					 ELSE;
    								 SET(enough_leather);
    		 ELSE;
    					 SET(enough_leather);
    
    
    
    //Assuming
    //Flags work like true/false variables
    //Having a pipe between flags means all must be true to return a 'true' IF value
    		
    
    		 IF(enough_logs | enough_sugarcane | enough_leather);
    					 CRAFT(5,((6*&quantity)-&planks));
    					 CRAFT(339,(3*((3*&quantity)-((&paper/3)+*&books))));
    					 CRAFT(340,((3*&quantity)-&books));
    					 CRAFT(47,(&quantity));
    					 UNSET(enough_logs | enough_sugarcane | enough_leather);
    					 LOG("You have sucessfully crafted %&quantity% bookshelves!");
    		 ELSE;
    ENDIF;
    }$$


    If there is a rounding function, I'd love to know about it; in several of those overly complex equations, having a quantity of paper that is not a multiple of 3 would cause the resulting value to be a fraction, and I don't know if/how the mod might round those.

    I really have no idea what I'm doing and am just making code based off what I have seen in other people's posts as an example, since there's no mentioning of a lot of things in the readme.txt and not a whole lot of documentation on features added since it was written.


    Any help would be greatly appreciated!
    Posted in: Mods Discussion
  • 0

    posted a message on Macro / Keybind Mod
    I've searched this thread for information regarding this, but after sorting through 100+ posts using the search feature, I've determined that it hasn't been answered.


    I'm trying to make a crafting macro that takes into consideration items you currently have in your inventory (i.e. using mixed materials), as well as use prompts to set the total quantity you want. What I've been using to make bookshelves is:
    $${CRAFTANDWAIT(339,144);CRAFTANDWAIT(340,48);CRAFTANDWAIT(5,96);CRAFTANDWAIT(47,16)}$$
    but it makes 144 paper regardless of if you already had paper in your inventory, 48 books regardless of inventory, and 96 wood planks (again) regardless of inventory. It also only makes bookshelves in quantities of 16.

    So I'm trying to make a script that will first prompt you for the quantity you want, but if you type "help" as the quantity, I want it to tell the amount of most-raw materials are needed per unit of final product. I think I have the prompting part down correctly (it's terribly incomplete).
    $${
    PROMPT(&quantity,"$$[quantity]","How many do you want to make?");
    		 IF(&quantity = "help");
    					 LOG("9 Sugarcane, 3 Leather, and 1.5 Logs are needed for each unit");
    		 ELSE;


    From there, I am wanting to determine the amount of materials present in the player's inventory (i.e. # of paper, books, and wood planks) and temporarily save those values (like A, B, C, etc. on a graphing calculator). But I can't figure out how to determine the quantity of an item you have in your inventory and how to save the value.

    For example, if someone has a stack of 34 oak wood planks (ID=5) and a stack of 7 jungle wood planks (ID=5:3), I can't figure out how to get the quantity unless it's in my hotbar using the GETSTACK command. As for the GETSLOTITEM command, I really can't figure out if it's relevant or what the various values it can find are.

    But once we've determined that the player has 41 wood planks, I would like to save the value as [planks] for referencing later in the script. I'm wanting to do the same with the sugarcane, leather, books, and logs so it can calculate if you will be able to make the quantity prompted and return a message stating more of what you need. I came up with a rough code for it, but I'm not 100% on how the mod does order of operations calculations or how flags SET/UNSET work. I'm also running on the assumption that if something is between %s, it is run as a calculation and only the final result is displayed to the user. If I knew how to save values, it'd be a lot more compact.
    //Assuming:
    //Logs = 'logs'
    //Wood planks = 'planks'
    //Sugarcane = 'sugarcane'
    //Paper = 'paper'
    //Books = 'books'
    //Leather = 'leather'
    
    
    		 IF(((4*&logs)+&planks) < (6*&quantity);
    					 LOG("You need %(((6*&quantity)-((4*&logs)+&planks))/4)% more logs.");
    		 ELSE;
    					 SET(enough_logs);
    		 IF(((3*&sugarcane)+(3*&paper)+&books) < (3*$quantity));
    					 LOG("You need %((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))% more sugarcane.");
    		 ELSE;
    					 SET(enough_sugarcane);
    		 IF(&books < (3*&quantity));
    					 IF(&leather < ((((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))+&sugarcane))/3)
    								 LOG("You need %(((((3*&quantity)-((&sugarcane/3)+(&paper/3)+&books))+&sugarcane))/3)-&leather)% more leather.");
    					 ELSE;
    								 SET(enough_leather);
    		 ELSE;
    					 SET(enough_leather);
    
    
    
    //Assuming
    //Flags work like true/false variables
    //Having a pipe between flags means all must be true to return a 'true' IF value
    		
    
    		 IF(enough_logs | enough_sugarcane | enough_leather);
    					 CRAFT(5,((6*&quantity)-&planks));
    					 CRAFT(339,(3*((3*&quantity)-((&paper/3)+*&books))));
    					 CRAFT(340,((3*&quantity)-&books));
    					 CRAFT(47,(&quantity));
    					 UNSET(enough_logs | enough_sugarcane | enough_leather);
    					 LOG("You have sucessfully crafted %&quantity% bookshelves!");
    		 ELSE;
    ENDIF;
    }$$


    If there is a rounding function, I'd love to know about it; in several of those overly complex equations, having a quantity of paper that is not a multiple of 3 would cause the resulting value to be a fraction, and I don't know if/how the mod might round those.

    I really have no idea what I'm doing and am just making code based off what I have seen in other people's posts as an example, since there's no mentioning of a lot of things in the readme.txt and not a whole lot of documentation on features added since it was written.


    Any help would be greatly appreciated!
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.5] Hitemcraft [16x]
    Quote from Balduran

    In how many ways can you spell "Keylogger"?

    You've every right to be skeptical, but my friends are incompetent at installing mods. So I had to make it a 'push the button' kind of install. Feel free to unpack it with Winrar and you'll see it's just mod files.
    Posted in: Resource Packs
  • 0

    posted a message on [1.5] Hitemcraft [16x]
    I know this is a pretty ignored thread, but I've come up with a pseudo-modpack due to the incompetence of my friends at installing mods. It's an SFX archive (.exe), and all you have to do is have Minecraft already installed and click 'run'; it will make the necessary changes. It replaces the existing minecraft.jar with one that has ModLoader and LiteLoader in it, as well as MCPatcher connected textures. I don't know how it will respond if you add mods to the .jar itself, but it should be fine if they are loaded via a 'mods' folder, it should just add these to the existing ones.

    Make sure to back up your entire .minecraft folder, since it will replace your options.txt and server.dat files when it installs, meaning you'll lose any custom key binds and saved servers. You can just add them back in after the install if you need.

    Hitbox
    Posted in: Resource Packs
  • 0

    posted a message on Macro / Keybind Mod
    Quote from chattahippie

    The KEY command requires one of a few different key binds (attack, sneak, use, etc.). Since by default the G key is not used in any of these specific key binds, you need to use the PRESS command. So PRESS(G) should work. What Mumfrey is saying is that KEY doesn't inject into the raw buffer, but PRESS and TYPE do.


    I tried to with PRESS and TYPE first, but I just copied the text out and forgot to change it. Silly me. :P
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    While on the topic of planned features, are you considering adding custom crafting recipe support? The server I play on has recently added the CraftMe plugin, which allows for custom crafting recipes to be added. The one I'm interested in makes cobweb from wool surrounded by 8 string.

    I'm not 100% on this, but since the mod already supports slots 1-9, and there are slot numbers for the rest of
    the inventory, surely the crafting table GUI has slot numbers for it as well.


    I don't know how the CRAFT and CRAFTANDWAIT commands determine the crafting recipe, but I'm assuming they use info from the vanilla Minecraft files. So I'm thinking that a custom crafting recipe (using the cobweb one as an example) would go more or less along the lines of:
    $${DRAGANDPLACE(1-[287,1];[287,2];[287,3];[287,4];[35,5];[1287,6];[287,7];[287,8];[287,9])|GRAB(30,0)}$$


    Using the formula:
    $$DRAGANDPLACE(<quantity>-[<itemcode>,<craftingslot>];.......;[<itemcode>,<craftingslot>])|GRAB(<itemcode>,<craftingslot>)}$$

    I'm assuming the slot numbering would go something like this:

    (I made that myself using info I got from wiki.vg/Inventory, so it might be inaccurate)

    This would be assuming you could make a command (DRAGANDPLACE) that could select an item by ID # from your general inventory and either drag it or the equivalent of SHIFT-click it into the specific crafting table slot. It also might require a command (GRAB) that only SHIFT-clicks the slot if the specified item is present and just goes into any empty slot in your inventory.


    I know this is a bit presumptuous of me, but I think the DRAGANDPLACE and GRAB commands would also be great for quick-filling and emptying dispensers, hoppers, droppers, brew stands, furnaces, etc.

    I realize that you are one of the mod makers that actually help the people that use your mod, and have other things in your life, but I think adding commands that perform functions similar to these would greatly improve the game for people that set them up, and I can only imagine the possibilities were this able to work with Tekkit.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mumfrey

    It's possible that the mod is actually looking at the literal state of the shift keys rather than using SNEAK (if it were using sneak then KEYDOWN would work) in which case there currently isn't a way to inject that type of key state (which is what would be required).

    Basically the KEYDOWN and such commands activate the binding (so in this case, sneak) rather than simulating the key being pressed. The PRESS and TYPE commands on the other hand, do literally inject raw keystrokes into the buffer, but only at a rate of 1 key per tick, so there's no way to simultaneously inject both SHIFT and G at the moment.

    On my to-do list is to allow PRESS to take modifiers so that SHIFT, ALT and CTRL can be injected along with a specific event, but I haven't got around to implementing it yet. Sorry about that.

    If it's possible to configure the gammabright mod to use a single key, then you should be able to activate it with PRESS, but macros isn't advanced enough yet for injecting multiple keys at once.


    Thanks for the fast reply!

    Before I confuse the hell out of anyone reading this, Gammabright toggles the fullbright function when you hit the activation key (default 'G'), and some text indicating the current brightness appears on the screen. You can hide the text by holding 'SHIFT' and pressing 'G' (I just found out it's only bound to 'SNEAK' and whatever you have the activation key set as).

    I looked at the Gammabright mod thread, and way back in the change logs, and found
    Quote from kymaster
    - Added: Shift click (or sneak key) support! Allows toggling without text.
    So I changed my 'SNEAK' key to CTRL and it still lets me change it that way, so the mod is dependent on the actual 'SNEAK' key and not just 'SHIFT'.

    I tried substituting 'SNEAK' in the scriptand replacing the PRESS with sets of KEYDOWN and KEYUP, but it still won't work for me.
    $${KEYDOWN(34)|WAIT(100ms)|KEYUP(34)|WAIT(100ms)|KEYDOWN(SNEAK)|KEYDOWN(34)|WAIT(100ms)|KEYUP(SNEAK)|KEYUP(34)}$$


    What I can't figure out, though, is why something as simple as binding
     $${KEY(34)}$$ 

    to another key (I'm using H as an example) isn't causing it to toggle the fullbrightness, since you say it injects it into the raw key buffer.
    EDIT: I meant to say PRESS, but I also tried it with KEY and TYPE.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    I'm having difficulties making a macro to press keys. I have the Gammabright mod installed, and since it resets on joining a game, I'm trying to make a macro that presses 'G', holds 'SHIFT', presses 'G', then releases 'SHIFT'. I'm wanting to put it on the onJoinGame event, but I can't even get it to work, even when I tried to bind it to a normal key (it gets tiresome repeatedly exiting and re-loading a map).

    According to the Wiki, the LWJGL code for 'G' is 34 and 'SHIFT' is 42, so that's what I've been using. I also tried just putting "G" and "SHIFT" in, but that didn't work either.
    $${KEY(34)|WAIT(100ms)|KEYDOWN(42)|WAIT(100ms)|KEY(34)|KEYUP(42)}$$

    I tried other variants using PRESS and TYPE, but those didn't work either.



    Anyone know what I'm doing wrong with it?
    Posted in: Minecraft Mods
  • 0

    posted a message on OptiFine HD (FPS Boost, Dynamic Lights, Shaders and much more)
    I'm working on updating my custom texture pack to 1.5+ compatibility, and I was wanting to know how Optifine is going to handle the connected textures file for 1.5, since I customized the connected texture for glass.

    Is it still going to use the same ctm.png, or will each of the different textures included be a different file (i.e. glass, chests, etc be a different file)?
    Posted in: Minecraft Mods
  • 0

    posted a message on [16x][1.2.3]Assistcraft!(Updated 3/13/12!)
    I think this thread is pretty much deadpooled at this point, but I've more or less continued the great features of this texture pack, if anyone was wondering.
    http://www.minecraftforum.net/topic/1546721-15-hitemcraft-16x/
    Posted in: Resource Packs
  • 0

    posted a message on [1.5] Hitemcraft [16x]
    Transferred into 1.5 format, made bats visible, made trap chests look like presents, made tripwire flash several different colors, and made wither hearts more visible.
    http://www.mediafire.com/?h76ex210r06p56n


    Version without animated string: http://www.mediafire.com/?dxom6d3qlo05ddm
    Posted in: Resource Packs
  • 0

    posted a message on Macro / Keybind Mod
    So I'm having some issues making a .txt script to switch to seeds/carrots/potatoes, place them, switch to bonemeal, use it, then break it, and repeat. I came up with this script, but it doesn't recognize potatoes nor carrots, and when spamming wheat, doesn't apply the bonemeal before breaking it. It also won't toggle off when I press the key again.

    I bound the script to the 'O' key with $${EXEC(cropspam.txt)}$$
    if(cropspam);
        log("&2[Macro] &fCropspam stopped.");
        unset(cropspam);
        stop();
    else;
        set(cropspam);
        if(ITEM=295);
            log("&2[Macro] &fWheat spam will commence, press %KEYNAME% to abort.");
            do;
                pick(295);
                key(use);
                wait(15ms);
                pick(351.15);
                key(use);
                wait(15ms);
                key(attack);
                loop;
            while(ITEM=295);
        elseif(item=391);
            log("&2[Macro] &fCarrot spam will commence, press %KEYNAME% to abort.");
            do;
                pick(391);
                key(use);
                wait(15ms);
                pick(351.15);
                key(use);
                wait(15ms);
                key(attack);
                loop;
            while(ITEM=391);
        elseif(item=392);
            log("&2[Macro] &fPotato spam will commence, press %KEYNAME% to abort.");
            do;
                pick(392);
                key(use);
                wait(15ms);
                pick(351.15);
                key(use);
                wait(15ms);
                key(attack);
                loop;
            while(ITEM=392);
        else;
            log("&2[Macro] &fYou did not order any seeds or fertilizer. It looks like you will go hungry.");
        endif;
        log("&2[Macro] &fCropspam stopped.");
        unset(cropspam);
    endif;


    When it spams wheat, it gives the message, but instead of saying the key it's bound to (O), it just says "Wheat spam will commence, press MACRO5 to abort.". Every time I hit the macro key to toggle it off, it repeats the message, but with the MACRO5 replaced with 'MACRO6', and increases in # each time.
    Posted in: Minecraft Mods
  • 0

    posted a message on Macro / Keybind Mod
    Quote from Mumfrey

    Yes, yes alright. :D



    Put this in a file called armour.txt in your macros directory:
    SET(#material,$$[Material[334,265,266,264]i]);
    IF(#material=334); //leather
    CRAFTANDWAIT(298,1);
    CRAFTANDWAIT(299,1);
    CRAFTANDWAIT(300,1);
    CRAFTANDWAIT(301,1);
    ELSE;
    CRAFTANDWAIT(%#material%,24);
    #material=#material+41;
    IF(#material=307);#material=314;ENDIF;
    IF(#material=305);#material=310;ENDIF;
    #max=#material+3;
    FOR(#id,%#material%,%#max%);
    CRAFTANDWAIT(%#id%,1);
    NEXT;
    ENDIF;
    GUI();

    Then bind a key to:
    $${$$<armour.txt>}$$

    You'll need to be aiming at a crafting bench for it to work though since the recipes require a 3x3 grid.

    EDIT: Took too long to work this out and got beaten to the punch. The script posted above won't work anyway since it uses CRAFT instead of CRAFTANDWAIT, so only the last item will be crafted since it will overwrite the earlier requests.


    I'm wanting to make a macro to make lapis/iron/gold/diamonds/glowstone dust into blocks, so I'm a bit confused by things like the:

    CRAFTANDWAIT(%#material%,24);
    #material=#material+41;
    IF(#material=307);#material=314;ENDIF;
    IF(#material=305);#material=310;ENDIF;
    #max=#material+3;

    I take it the 24 is the # of a material required to make that item, but how do you set it if there were multiple materials (like making picks)?
    307 is an iron chestplate and 314 is a gold helmet, so even though it's making all the armor pieces, that would span 3 types of armor.
    305 is chain boots and 310 is a diamond helmet, so same issue.
    And I'm clueless about the #material+3.

    Is there any way you could post a template?
    And how do you open the GUI editor so that you drag the item to the corresponding slots, and then save it like a template? I can't get it to open at all.
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.5] Hitemcraft [16x]
    Updated to 1.4.5 and fixed connected textures.
    http://www.mediafire.com/?dr2dm1in179nnnh
    Posted in: Resource Packs
  • 0

    posted a message on Gammabright - Advanced Brightness/Fullbright Mod [200,000+ Downloads!]
    Quote from kymaster


    - Known Bug: Mod will not turn off and reset when exiting worlds.


    Please don't fix this "bug". I love it.
    When Minecraft updates but Gammabright/ModLoader hasn't, if you check your video settings, your brightness is set to 1000%, and you get the Gammabright lighting even without the mod!

    So if you do get around to 'fixing' it, can you make it an option to not toggle on exit?
    Posted in: Minecraft Mods
  • To post a comment, please or register a new account.