Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://mcskill.net/mcforum/index.php?/topic/119757-opencomputers-%D0%B8%D0%B7%D0%B2%D0%BB%D0%B5%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-%D1%81%D1%83%D0%BC%D0%BE%D0%BA-%D0%B8-%D0%BF%D1%80%D0%BE%D1%87%D0%B5%D0%B3%D0%BE-%D1%85%D0%BB%D0%B0%D0%BC%D0%B0-%D1%81-%D0%BA%D1%83%D1%87%D0%B5%D0%B9-nbt-%D1%82%D0%B5%D0%B3%D0%BE%D0%B2-%D0%B8%D0%B7-%D0%BC%D1%8D/
- local component = require("component")
- local db = component.database
- local exportbus = component.me_exportbus
- local controller = component.me_controller
- local args = {...}
- local item = args[1]
- local function getDbSize()
- if not pcall(function() db.get(10) end) then
- return 9
- elseif not pcall(function() db.get(26) end) then
- return 25
- else
- return 81
- end
- end
- local function noneItemID()
- if item == nil then
- print("Enter the object ID as an argument. For example: rescue minecraft:axe")
- return true
- end
- end
- local function mainExport()
- for i = 1, getDbSize() do
- db.clear(i)
- end
- end
- local function setExportConfig()
- controller.store({name = item}, db.addres, 1, 1)
- for i=1,6 do
- if exportbus.setExportConfiguration(i, 1, db.address, 1) then
- break
- end
- end
- end
- checkItem = controller.getItemsInNetwork({name = item}).n
- if checkItem == 0 then
- print("You have 0 items. Programm stops. Cooldown is approx. 1 min.")
- else
- print("You have", checkItem, "items. Be patient... Export will start soon...")
- for i = 1, checkItem do
- if noneItemID() then break end
- setExportConfig()
- mainExport()
- end
- print("Check the storage.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement