Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- Pc1 = 4733
- Pc2 = 4734
- Pc3 = 4735
- cursorPos = 0
- cursorPosFre = 0
- cursorPosEnd = 0
- sleepTime = 0.3
- selection = ""
- mode = "Slide"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- term.clear()
- function drawScreen()
- bground = paintutils.loadImage(".bground")
- paintutils.drawImage(bground,1,1)
- end
- function main()
- drawScreen()
- while true do
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1,3)
- term.write(" ")
- term.setCursorPos(1,4)
- term.write(" ")
- term.setCursorPos(1,5)
- term.write(" ")
- term.setCursorPos(1,6)
- term.write(" ")
- term.setCursorPos(1,7)
- term.write(" ")
- term.setCursorPos(1,8)
- term.write(" ")
- term.setCursorPos(1,9)
- term.write(" ")
- term.setCursorPos(1,10)
- term.write(" ")
- term.setCursorPos(1,3)
- term.write("Z1 > ")
- term.setCursorPos(1,4)
- term.write("Z2 > ")
- term.setCursorPos(1,5)
- term.write("Z3 > ")
- term.setCursorPos(1,6)
- term.write("Z4 > ")
- term.setCursorPos(1,7)
- term.write("Z5 > ")
- term.setCursorPos(1,8)
- term.write("Z6 > ")
- term.setCursorPos(1,9)
- term.write("Z7 > ")
- term.setCursorPos(6,3)
- textLineOne = read()
- term.setCursorPos(6,4)
- textLineTwo = read()
- term.setCursorPos(6,5)
- textLineThree = read()
- term.setCursorPos(6,6)
- textLineFour = read()
- term.setCursorPos(6,7)
- textLineFive = read()
- term.setCursorPos(6,8)
- textLineSix = read()
- term.setCursorPos(6,9)
- textLineSeven = read()
- if mode == "Slide" then
- if string.len(textLineOne) < string.len(textLineTwo) then
- selection = string.len(textLineTwo)
- else
- selection = string.len(textLineOne)
- end
- if string.len(textLineThree) < selection then
- selection = selection
- else
- selection = string.len(textLineThree)
- end
- if string.len(textLineFour) < selection then
- selection = selection
- else
- selection = string.len(textLineFour)
- end
- if string.len(textLineFive) < selection then
- selection = selection
- else
- selection = string.len(textLineFive)
- end
- if string.len(textLineSix) < selection then
- selection = selection
- else
- selection = string.len(textLineSix)
- end
- cursorPos = 50
- cursorPosEnd = 0 - selection
- while cursorPos >= cursorPosEnd do
- rednet.send(Pc1, "1".."$"..cursorPos.."&1%"..textLineOne)
- rednet.send(Pc2, "2".."$"..cursorPos.."&1%"..textLineOne)
- rednet.send(Pc3, "3".."$"..cursorPos.."&1%"..textLineOne)
- rednet.send(Pc1, "1".."$"..cursorPos.."&2%"..textLineTwo)
- rednet.send(Pc2, "2".."$"..cursorPos.."&2%"..textLineTwo)
- rednet.send(Pc3, "3".."$"..cursorPos.."&2%"..textLineTwo)
- rednet.send(Pc1, "1".."$"..cursorPos.."&3%"..textLineThree)
- rednet.send(Pc2, "2".."$"..cursorPos.."&3%"..textLineThree)
- rednet.send(Pc3, "3".."$"..cursorPos.."&3%"..textLineThree)
- rednet.send(Pc1, "1".."$"..cursorPos.."&4%"..textLineFour)
- rednet.send(Pc2, "2".."$"..cursorPos.."&4%"..textLineFour)
- rednet.send(Pc3, "3".."$"..cursorPos.."&4%"..textLineFour)
- rednet.send(Pc1, "1".."$"..cursorPos.."&5%"..textLineFive)
- rednet.send(Pc2, "2".."$"..cursorPos.."&5%"..textLineFive)
- rednet.send(Pc3, "3".."$"..cursorPos.."&5%"..textLineFive)
- rednet.send(Pc1, "1".."$"..cursorPos.."&6%"..textLineSix)
- rednet.send(Pc2, "2".."$"..cursorPos.."&6%"..textLineSix)
- rednet.send(Pc3, "3".."$"..cursorPos.."&6%"..textLineSix)
- rednet.send(Pc1, "1".."$"..cursorPos.."&7%"..textLineSeven)
- rednet.send(Pc2, "2".."$"..cursorPos.."&7%"..textLineSeven)
- rednet.send(Pc3, "3".."$"..cursorPos.."&7%"..textLineSeven)
- cursorPos = cursorPos - 1
- if cursorPos <= cursorPosEnd then
- os.run({},shell.getRunningProgram())
- end
- sleep(sleepTime)
- end
- elseif mode == "Freeze" then
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&1%"..textLineOne)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&1%"..textLineOne)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&1%"..textLineOne)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&2%"..textLineTwo)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&2%"..textLineTwo)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&2%"..textLineTwo)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&3%"..textLineThree)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&3%"..textLineThree)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&3%"..textLineThree)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&4%"..textLineFour)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&4%"..textLineFour)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&4%"..textLineFour)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&5%"..textLineFive)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&5%"..textLineFive)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&5%"..textLineFive)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&6%"..textLineSix)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&6%"..textLineSix)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&6%"..textLineSix)
- rednet.send(Pc1, "1".."$"..cursorPosFre.."&7%"..textLineSeven)
- rednet.send(Pc2, "2".."$"..cursorPosFre.."&7%"..textLineSeven)
- rednet.send(Pc3, "3".."$"..cursorPosFre.."&7%"..textLineSeven)
- end
- end
- end
- function changeSleep()
- while true do
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1,18)
- term.write("Speed")
- term.setCursorPos(1,19)
- term.write("< "..sleepTime.." >")
- term.setCursorPos(6,3)
- event, side, x, y = os.pullEvent("mouse_click")
- if x == 1 and y == 19 then
- if sleepTime >= 0.2 then
- sleepTime = sleepTime - 0.1
- end
- elseif x == (4 + string.len(tostring(sleepTime))) and y == 19 then
- if sleepTime <= 0.9 then
- sleepTime = sleepTime + 0.1
- end
- end
- end
- end
- function changeMode()
- while true do
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1,15)
- term.write("Mode")
- term.setBackgroundColor(colors.red)
- term.setCursorPos(1,16)
- term.write(mode)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(1,12)
- term.write("Cursor Position")
- term.setCursorPos(1,13)
- term.write("< "..cursorPosFre.." > ")
- term.setCursorPos(6,3)
- event, side, x, y = os.pullEvent("mouse_click")
- if x >= 1 and x <= 5 and y == 16 then
- if mode == "Slide" then
- term.setCursorPos(1,16)
- term.write(" ")
- mode = "Freeze"
- else
- term.setCursorPos(1,16)
- term.write(" ")
- mode = "Slide"
- end
- elseif x == 1 and y == 13 then
- if cursorPosFre >= 1 then
- cursorPosFre = cursorPosFre - 1
- end
- elseif x == (4 + string.len(tostring(cursorPosFre))) and y == 13 then
- if cursorPosFre <= 64 then
- cursorPosFre = cursorPosFre + 1
- end
- end
- end
- end
- function clearMonitor()
- while true do
- term.setBackgroundColor(colors.red)
- term.setCursorPos(1,1)
- term.write("Clear")
- term.setBackgroundColor(colors.white)
- term.setCursorPos(6,3)
- event, side, x, y = os.pullEvent("mouse_click")
- if x >= 1 and x <= 5 and y == 1 then
- rednet.send(Pc1, "$clear")
- rednet.send(Pc2, "$clear")
- rednet.send(Pc3, "$clear")
- end
- end
- end
- parallel.waitForAny(main,changeSleep,changeMode,clearMonitor)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement