Compare commits

..

No commits in common. 'd30888cb69b67ddacbed8b169d9e19ab1c7898e4' and '06aee93cc7ec81500e64b1ad2cd04a8831dd48cb' have entirely different histories.

@ -326,9 +326,8 @@ end
---accepts a recipe table ---accepts a recipe table
---@param search string search for an craftable item ---@param search string search for an craftable item
---@param amount number how many items to craft
---@return boolean ---@return boolean
local function craft_item(search, amount) local function craft_item(search)
search = string.lower(search) -- convert to unified lowercase search = string.lower(search) -- convert to unified lowercase
local matches = {} local matches = {}
@ -375,13 +374,8 @@ local function craft_item(search, amount)
local recipe = recipes[selected] local recipe = recipes[selected]
print('Trying to craft ' .. amount .. 'x ' .. recipe.result) print('Trying to craft ' .. recipe.result)
local repeating = false
local count = math.ceil(amount / recipe.count)
for _ = 1, count do
local available_items = read_chest_contents() local available_items = read_chest_contents()
if not available_items then if not available_items then
print('Not facing a chest') print('Not facing a chest')
@ -408,39 +402,39 @@ local function craft_item(search, amount)
return false return false
end end
if not repeating then
if not confirm() then if not confirm() then
print('Operation cancelled') print('Operation cancelled')
return false return false
end end
end
-- print('\nCrafting in order:')
-- for i, rec in ipairs(crafting_order) do
-- print(i, rec.result)
-- end
-- if not confirm() then
-- print('Operation cancelled')
-- return false
-- end
-- proceed to crafting the things -- proceed to crafting the things
local steps = #crafting_order
for i, rec in ipairs(crafting_order) do for i, rec in ipairs(crafting_order) do
print('Step ' .. i .. '/' .. steps .. ' - ' .. rec.result) print('Step #' .. i .. ' - ' .. rec.result)
if not craft_single_recipe(rec, 1) then if not craft_single_recipe(rec, 1) then
print('Unexpected error') print('Unexpected error')
return false return false
end end
end end
repeating = true
end
return true return true
end end
local target, amount = ... local target = ...
if not target then if not target then
print("Usage: craft <item> [count]") print("Usage: craft <item>")
return return
end end
if not amount then craft_item(target)
amount = 1
end
craft_item(target, amount)

@ -844,54 +844,6 @@ return {
nil, 'opencomputers:material;5', 'minecraft:obsidian;0', nil, 'opencomputers:material;5', 'minecraft:obsidian;0',
} }
}, },
-- Data card (Tier 1)
['opencomputers:card;10'] = {
result = 'opencomputers:card;10;data card 1',
count = 1,
requires = {
['minecraft:iron_nugget;0'] = 1,
['opencomputers:material;10'] = 1, -- ALU
['opencomputers:material;8'] = 1, -- Microchip (Tier 2)
['opencomputers:material;5'] = 1, -- Card Base
},
shape = {
nil, nil, nil,
'minecraft:iron_nugget;0', 'opencomputers:material;10', 'opencomputers:material;8',
nil, 'opencomputers:material;5', nil,
}
},
-- Data card (Tier 2)
['opencomputers:card;11'] = {
result = 'opencomputers:card;11;data card 2',
count = 1,
requires = {
['minecraft:gold_nugget;0'] = 1,
['opencomputers:component;0'] = 1, -- CPU 1
['opencomputers:material;9'] = 1, -- Microchip (Tier 3)
['opencomputers:material;5'] = 1, -- Card Base
},
shape = {
nil, nil, nil,
'minecraft:gold_nugget;0', 'opencomputers:component;0', 'opencomputers:material;9',
nil, 'opencomputers:material;5', nil,
}
},
-- Data card (Tier 3)
['opencomputers:card;12'] = {
result = 'opencomputers:card;12;data card 3',
count = 1,
requires = {
['opencomputers:material;29'] = 1, -- Diamond Chip
['opencomputers:component;1'] = 1, -- CPU 2
['opencomputers:component;10'] = 1, -- RAM 3
['opencomputers:material;5'] = 1, -- Card Base
},
shape = {
nil, nil, nil,
'opencomputers:material;29', 'opencomputers:component;1', 'opencomputers:component;10',
nil, 'opencomputers:material;5', nil,
}
},
-- EEPROM -- EEPROM
['opencomputers:storage;0'] = { ['opencomputers:storage;0'] = {

Loading…
Cancel
Save