Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --pastebin get zMtrhwZT startup
- --pastebin get zMtrhwZT redtransposer
- --shell.run("redtransposer r f b")
- --shell.run("redtransposer r t b")
- --shell.run("redtransposer r t rf")
- local tArgs = { ... }
- local sTrigger, sInput, sOutput, nDelay = tArgs[1], tArgs[2], tArgs[3], tArgs[4]
- local nSlots = tArgs[5]
- local filename = shell.getRunningProgram()
- if not trans then
- os.loadAPI("trans")
- if not trans then
- shell.run("pastebin get 68xNzDAV trans")
- os.loadAPI("trans")
- if not trans then
- error("Unable to load 'trans' API")
- end
- end
- end
- sTrigger = trans.fixSide(sTrigger)
- sInput = trans.fixSide(sInput)
- sOutput = trans.fixSide(sOutput)
- if sTrigger == nil or sInput == nil or sOutput == nil then
- print( "Usage: " .. filename .. " <signal side> <input side> <output side> [Delay Time]" )
- print( "Side values are Top, Bottom, Front, and None" )
- print( "The turtle will pull from the input side and push into the output side." )
- print( "None can be specified if the turtle is expected to deal with items moving on their own." )
- print( "Slots: Maximum number of stacks to pull at one time.")
- return
- end
- if nDelay ~= nil then
- nDelay = tonumber(nDelay)
- end
- if nDelay == nil then
- nDelay = 0.5
- end
- if nSlots ~= nil then
- nSlots = tonumber(nSlots)
- end
- if nSlots == nil then
- nSlots = 15
- end
- if nSlots < 1 or nSlots > 16 then
- nSlots = 15
- end
- print( "Transposing from " .. trans.displaySide(sInput) .. " to " .. trans.displaySide(sOutput) .. " with a delay of " .. nDelay .. " seconds and loading up to " .. nSlots .. " slots while signal from " .. trans.displaySide(sTrigger) .. "." )
- while true do
- if trans.readSide(sTrigger) then
- trans.load(sInput, 1, nSlots)
- trans.unload(sOutput, "n")
- end
- sleep(nDelay)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement