Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- rSide = "back"
- function getType(str)
- if str == "logic" or str == "l" then
- return 2
- elseif str == "calculation" or str == "c" then
- return 3
- elseif str == "engineering" or str == "e" then
- return 4
- end
- end
- function inscribe(slot, num)
- insertPress(1)
- insertMaterials(5, num)
- removeProduct(9, num)
- grabPress(1)
- insertPress(slot)
- insertMaterials(slot+4, num)
- removeProduct(slot+8, num)
- grabPress(slot)
- craftMatrix(slot+8, num)
- removeProduct(slot+12, num)
- print("Completed!")
- end
- function insertMaterials(slot, num)
- if num == 1 then
- print("Inserting " .. num .. " material in slot " .. slot)
- else
- print("Inserting " .. num .. " materials in slot " .. slot)
- end
- turtle.select(slot)
- for i = 1, num do
- while not turtle.drop() do
- end
- end
- end
- function removeProduct(slot, num)
- if num == 1 then
- print("Removing " .. num .. " product to slot " .. slot)
- else
- print("Removing " .. num .. " products to slot " .. slot)
- end
- turtle.select(slot)
- for i = 1, num do
- while not turtle.suck(1) do
- end
- end
- end
- function insertPress(slot)
- print("Inserting press in slot " .. slot)
- turtle.select(slot)
- turtle.dropUp()
- end
- function grabPress(slot)
- print("Retrieving press to slot " .. slot)
- turtle.select(slot)
- rs.setAnalogOutput(rSide, 15)
- while not turtle.suckUp() do
- end
- rs.setAnalogOutput(rSide, 0)
- end
- function craftMatrix(slot, num)
- if num == 1 then
- print("Crafting " .. num .. " type " .. (slot-8) .. " matrix")
- else
- print("Crafting " .. num .. " type " .. (slot-8) .. " matrices")
- end
- turtle.select(9)
- turtle.dropDown()
- turtle.select(slot)
- turtle.dropUp()
- turtle.select(13)
- for i = 1, num do
- while not turtle.drop() do
- end
- end
- end
- for i = 1, #tArgs/2 do
- inscribe(getType(tArgs[2*i-1]), tArgs[2*i])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement