Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- Pc1 = 260
- Pc2 = 266
- Pc3 = 264
- Pc4 = 265
- cursorPos = 0
- cursorPosEnd = 0
- sleepTime = 0.3
- function main()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- term.write("> ")
- text = read()
- cursorPos = 66
- cursorPosEnd = 0 - string.len(text)
- while true do
- rednet.send(Pc1, "1".."$"..cursorPos.."%"..text)
- rednet.send(Pc2, "2".."$"..cursorPos.."%"..text)
- rednet.send(Pc3, "3".."$"..cursorPos.."%"..text)
- rednet.send(Pc4, "4".."$"..cursorPos.."%"..text)
- cursorPos = cursorPos - 1
- if cursorPos <= cursorPosEnd then
- os.run({},shell.getRunningProgram())
- end
- sleep(sleepTime)
- end
- end
- end
- function sleeper()
- while true do
- term.setCursorPos(1,2)
- term.write("< "..sleepTime.." >")
- term.setCursorPos(3,1)
- event, side, x, y = os.pullEvent("mouse_click")
- if x == 1 and y == 2 then
- if sleepTime >= 0.2 then
- sleepTime = sleepTime - 0.1
- end
- elseif x == (4 + string.len(tostring(sleepTime))) and y == 2 then
- if sleepTime <= 0.9 then
- sleepTime = sleepTime + 0.1
- end
- end
- end
- end
- parallel.waitForAny(main,sleeper)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement