[Mod] Macro Crafting Manager [macro]

User avatar
sorcerykid
Member
 
Posts: 1135
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

[Mod] Macro Crafting Manager [macro]

by sorcerykid » Sun Aug 19, 2018 23:11

Image

Macro Crafting Manager v2.0
macro (by sorcerykid)

Macro Crafting Manager provides a streamlined drag-and-drop interface for dividing and arranging item stacks within the craft-grid. This mod is intended to be compatible with all versions of Minetest 0.4.14+. It has been in continuous use on the Just Test Tribute server since August 2017 with only minor revisions and no known bugs.

Repository:

https://bitbucket.org/sorcerykid/macro

Download Archive (.zip)
Download Archive (.tar.gz)

Dependencies:

Default Mod
https://github.com/minetest/minetest_game

ActiveFormspecs Mod
https://bitbucket.org/sorcerykid/formspecs

Inventory Plus Mod (optional)
https://github.com/cornernote/minetest-inventory_plus

Source Code License:

Copyright (c) 2017-2018, Leslie Krause
GNU Lesser General Public License v3 (LGPL-3.0)

Media License:

Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)

Usage Instructions:

Now even the most complex crafts like stairs, ladders, chests, rails, and fences are a breeze. What used to be a tiresome and mundane task of moving stacks endlessly around a craft grid, is literally as simple as dragging and dropping -- and voila! Here is what you need to know:

    (A) Macro Bar
    The Macro Bar provides 16 predefined macros to simplify the most common crafting tasks. Drag any item from your Main Inventory into the appropriate slot, and the stack will be arranged automatically within the Craft Grid.

    (B) Main Inventory
    The Main Inventory consists of 32 slots, including the hotbar. As usual, this is where you store your items after crafting.

    (C) Trash Can
    The Trash Can's sole purpose is the same as always: to expunge items. Its usage is self-explanatory.

    (D) Surplus Stack
    This slot holds the surplus stack from the previous macro operation. If you close the Macro Crafting Manager prematurely, these items will drop. Be sure to move them into your Main Inventory, otherwise they may be lost.

    (E) Output Stack
    Once the items within the Craft Grid conform to a recipe, this slot serves as a preview of the output stack. To actually perform the craft, the output stack must be moved into the Main Inventory or Craft Grid.

    (F) Craft Grid
    The Craft Grid is a secondary inventory intended for crafting items according to recipes found within the Craft Guide. Drag items from the Main Inventory directly into one of the 9 slots or use the Macro Bar.
If you have inventory_plus installed, you can access the the Macro Crafting Manager by clicking the "Macro" button from within your main inventory. Otherwise, you can simply use the "/x" chat command as a shortcut. In the near future I will add support for Unified Inventory.

For game developers, the Macro Crafting Manager also extends the default mod with the following helper function:

    default.drop_item( pos, item, horz, vert )
    Spawn item with a vertical velocity, vert, and a random horizontal velocity ranging between 0 and horz from the position, pos. The item may be specified as either an itemstring or an ItemStack object.
Unlike minetest.item_drop( ), this function is suitable for incidental drops that are independent of the player, such as tnt explosions or mob drops. An example would be:

Code: Select all
-- the mob should drop items with drop.chance probability in quantities between drop.min and drop.max
for _, drop in ipairs( self.drops ) do
        if math.random( 1, drop.chance ) == 1 then
                default.drop_item( pos, drop.name .. " " .. math.random( drop.min, drop.max ), 1, 5 )
        end
end
 

User avatar
bosapara
Member
 
Posts: 538
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] Macro Crafting Manager [macro]

by bosapara » Mon Aug 20, 2018 14:17

+ Craft all and exit buttons

Image
Attachments
macro.zip
(10.21 KiB) Downloaded 10 times
 

User avatar
sorcerykid
Member
 
Posts: 1135
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: [Mod] Macro Crafting Manager [macro]

by sorcerykid » Fri Aug 24, 2018 17:25

Just a quick note,

There is longstanding bug in which worn tools can be instantly repaired by dragging them into the Macro Bar. This will be fixed in the next version. For the time being, I'd recommend changing lines 118-119 to read

Code: Select all
                -- check that extra slot is empty and stack is a non-worn tool
                if not extra:is_empty( "main" ) or stack:get_wear( ) > 0 then

I successfully tested the code above with both a variety of items, including worn and non-worn tools, and it prevents the exploit.
 

User avatar
ShallowDweller
Member
 
Posts: 59
Joined: Thu Nov 02, 2017 22:23

Re: [Mod] Macro Crafting Manager [macro]

by ShallowDweller » Sun Aug 26, 2018 03:56

I'm currently using unified inventory, but I would like to know if that arrow near the crafting output is meant for sending the results to the inventory in a single click (like uiplus "all" button does) or for browsing the multiple possible outputs for the same recipe (like 2 mods using the same recipe for 2 different items).
There was a minecraft crafting manager mod featuring the last one and I've been searching a similar one for minetest.
 

User avatar
bosapara
Member
 
Posts: 538
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara

Re: [Mod] Macro Crafting Manager [macro]

by bosapara » Sun Aug 26, 2018 06:48

ShallowDweller wrote:I'm currently using unified inventory, but I would like to know if that arrow near the crafting output is meant for sending the results to the inventory in a single click (like uiplus "all" button does) or for browsing the multiple possible outputs for the same recipe (like 2 mods using the same recipe for 2 different items).
There was a minecraft crafting manager mod featuring the last one and I've been searching a similar one for minetest.



For unified inventory already exist similar macro crafting mod - Unified Inventory Plus
Image
 

User avatar
ShallowDweller
Member
 
Posts: 59
Joined: Thu Nov 02, 2017 22:23

Re: [Mod] Macro Crafting Manager [macro]

by ShallowDweller » Mon Sep 03, 2018 20:06

bosapara wrote:
ShallowDweller wrote:I'm currently using unified inventory, but I would like to know if that arrow near the crafting output is meant for sending the results to the inventory in a single click (like uiplus "all" button does) or for browsing the multiple possible outputs for the same recipe (like 2 mods using the same recipe for 2 different items).
There was a minecraft crafting manager mod featuring the last one and I've been searching a similar one for minetest.



For unified inventory already exist similar macro crafting mod - Unified Inventory Plus

Well... that wasn't my question, but thanks for the quick answer (and sorry for taking so long to reply).
My question was if the "<<" button was a "next page" button (for when a single recipe has 2 or more different outputs) OR an "all" button (like in the mod you mentioned).

I made a poor choice of words that left my question unclear. Sorry about that.
 

User avatar
sorcerykid
Member
 
Posts: 1135
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: [Mod] Macro Crafting Manager [macro]

by sorcerykid » Mon Sep 03, 2018 20:31

The mod above is not called "macro crafting", it is called Unified Inventory Plus. This is the only mod that has ever used the word macro crafting to describe its functionality, and hence also its name.

https://github.com/minetest/minetest/is ... -286500704

The arrow buttons move items in bulk from the Surplus Stack and the Craft Grid into the main inventory. Hope that clarifies :)
 

User avatar
ShallowDweller
Member
 
Posts: 59
Joined: Thu Nov 02, 2017 22:23

Re: [Mod] Macro Crafting Manager [macro]

by ShallowDweller » Mon Sep 03, 2018 21:33

sorcerykid wrote:The mod above is not called "macro crafting", it is called Unified Inventory Plus. This is the only mod that has ever used the word macro crafting to describe its functionality, and hence also its name.

https://github.com/minetest/minetest/is ... -286500704

The arrow buttons move items in bulk from the Surplus Stack and the Craft Grid into the main inventory. Hope that clarifies :)

I see... Thanks for clarifying that :)
And sorry about the silly questions I asked x_X
 

User avatar
sorcerykid
Member
 
Posts: 1135
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: [Mod] Macro Crafting Manager [macro]

by sorcerykid » Mon Sep 03, 2018 23:05

Nothing silly about your question. It was my oversight for not documenting what those buttons actually do xD

I'll fix the first post to be more descriptive. Thanks for the heads up!
 


Return to WIP Mods



Who is online

Users browsing this forum: ElCeejo and 5 guests