Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- if args[1] == nil then
- print("Need a phrase!")
- error(r)
- end
- str = args[1].." "
- function findMonitor()
- local e = peripheral.getNames()
- for i=1,#e do
- if peripheral.getType(e[i]) == "monitor" then
- local m = peripheral.wrap(e[i])
- return m
- end
- end
- print("Need monitor!")
- error(r)
- end
- function wrt(s)
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clearLine()
- term.write(s)
- term.setCursorPos(1,2)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.clearLine()
- term.write(s)
- end
- function main()
- term.clear()
- term.setCursorPos(1,1)
- --print("Touch the screen to select application")
- local monitor = findMonitor()
- monitor.setTextScale(5)
- term.redirect(monitor)
- term.setCursorPos(1,2)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- --local timer = 0
- while true do
- --timer = os.startTimer(1/2)
- term.clear()
- wrt(str)
- --local event, arg1, arg2, arg3 = os.pullEvent()
- --[[if event == "monitor_touch" then
- break
- elseif event == "timer" and arg1 == timer then
- str = string.sub(str,2,string.len(str))..string.sub(str,1,1)
- end]]--
- str = string.sub(str,2,string.len(str))..string.sub(str,1,1)
- sleep(0.5)
- end
- --[[term.setBackgroundColor(colors.black)
- term.clear()
- term.redirect(term.native())
- shell.run("reboot")]]--
- end
- main() --Start application
Advertisement
Add Comment
Please, Sign In to add comment