Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Easy redstone timer for minecraft used with a computer.
- -- String Input
- term.clear() term.setCursorPos(1,1)
- textutils.slowPrint("Input at what side you want to emit the redstone signal:")
- a = read()
- -- functions
- function left()
- while true do
- redstone.setOutput("left", true)
- sleep(1)
- redstone.setOutput("left", false)
- sleep(1)
- end
- end
- function right()
- while true do
- redstone.setOutput("right", true)
- sleep(1)
- redstone.setOutput("right", false)
- sleep(1)
- end
- end
- function top()
- while true do
- redstone.setOutput("top", true)
- sleep(1)
- redstone.setOutput("top", false)
- sleep(1)
- end
- end
- function bottom()
- while true do
- redstone.setOutput("bottom", true)
- sleep(1)
- redstone.setOutput("bottom", false)
- sleep(1)
- end
- end
- function back()
- while true do
- redstone.setOutput("back", true)
- sleep(1)
- redstone.setOutput("back", false)
- sleep(1)
- end
- end
- -- main program
- if a == "left" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Emiting redstone signal at left side!")
- left()
- else if a == "right" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Emiting redstone signal at right side!")
- right()
- else if a == "top" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Emiting redstone signal at top side!")
- top()
- else if a == "bottom" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Emiting redstone signal at bottom side!")
- bottom()
- else if a == "back" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Emiting redstone signal at the back of the computer!")
- back()
- else
- textutils.slowPrint("That isn't a valid side!")
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement