Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Plazter and Pizzamanden12---
- -- Credit given to: kreezxil for Helping out with the code --
- -- Thanks to all on CCForum that tryed to help aswell --
- local tArgs = {...}
- if tArgs[1] == nil or tArgs[1] == "help" then
- term.clear()
- term.setCursorPos(1,1)
- print("<program> <side>, you adjust the timer on arrow up/down")
- return
- end
- local side = tArgs[1]
- local tid = 1
- local key = 0
- function testKey()
- _, key = os.pullEvent("key")
- if key == keys.up then
- tid = tid+1
- elseif key == keys.down and tid == 1 then
- tid = tid+1
- print("You have tryed to do the impossible!")
- sleep(5)
- elseif key == keys.down then
- tid = tid-1
- end
- end
- function speed()
- term.clear()
- term.setCursorPos(1,1)
- print("Delay is now: ".. tid)
- end
- function timer()
- rs.setOutput(side, true)
- sleep(0.3)
- rs.setOutput(side, false)
- sleep(tid)
- end
- while key ~= keys.left do
- speed()
- -- using the parallel api we should be able to allow the program run all the time
- parallel.waitForAny(timer,testKey)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement