Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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