Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GrL, GaL, SL, GrR, GaR, SR = 0, 0, 0, 0, 0, 0
- local function Numbers(X,H)
- if (H == 1) then
- term.setCursorPos(X,17)
- term.write("1")
- end
- if (H == 2) then
- term.setCursorPos(X,16)
- term.write("2")
- end
- if (H == 3) then
- term.setCursorPos(X,15)
- term.write("3")
- end
- if (H == 4) then
- term.setCursorPos(X,14)
- term.write("4")
- end
- if (H == 5) then
- term.setCursorPos(X,13)
- term.write("5")
- end
- if (H == 6) then
- term.setCursorPos(X,12)
- term.write("6")
- end
- if (H == 7) then
- term.setCursorPos(X,11)
- term.write("7")
- end
- if (H == 8) then
- term.setCursorPos(X,10)
- term.write("8")
- end
- if (H == 9) then
- term.setCursorPos(X,9)
- term.write("9")
- end
- if (H == 10) then
- term.setCursorPos((X-1),8)
- term.write("MAX")
- end
- end
- local function update(Direction)
- if Direction == "Right" then
- paintutils.drawFilledBox(2,8,4,17,colors.black)
- paintutils.drawFilledBox(2,(18-GrR),4,17,colors.lime)
- Numbers(3,GrR)
- sleep(1)
- paintutils.drawFilledBox(6,8,8,17,colors.black)
- paintutils.drawFilledBox(6,(18-GaR),8,17,colors.lime)
- Numbers(7,GaR)
- sleep(1)
- paintutils.drawFilledBox(10,8,12,17,colors.black)
- paintutils.drawFilledBox(10,(18-SR),12,17,colors.lime)
- Numbers(11,SR)
- sleep(1)
- end
- if Direction == "Left" then
- paintutils.drawFilledBox(18,8,20,17,colors.black)
- paintutils.drawFilledBox(18,(18-GrL),20,17,colors.lime)
- Numbers(19,GrL)
- sleep(1)
- paintutils.drawFilledBox(22,8,24,17,colors.black)
- paintutils.drawFilledBox(22,(18-GaL),24,17,colors.lime)
- Numbers(23,GaL)
- sleep(1)
- paintutils.drawFilledBox(26,8,28,17,colors.black)
- paintutils.drawFilledBox(26,(18-SL),28,17,colors.lime)
- Numbers(27,SL)
- sleep(1)
- end
- end
- local function Receive()
- id, message = rednet.receive()
- if message == "Left" then
- id, message = rednet.receive()
- GrL = message
- id, message = rednet.receive()
- GaL = message
- id, message = rednet.receive()
- SL = message
- update("Left")
- end
- if message == "Right" then
- id, message = rednet.receive()
- GrR = message
- id, message = rednet.receive()
- GaR = message
- id, message = rednet.receive()
- SR = message
- update("Right")
- end
- if message == "Stop" then
- paintutils.drawLine(12,2,18,2,colors.black)
- term.setCursorPos(14,2)
- term.setTextColour(colors.red)
- term.write("END")
- paintutils.drawFilledBox(2,8,28,19,colors.black)
- paintutils.drawFilledBox(1,18,29,19,colors.black)
- term.redirect(c)
- rednet.close(MdSide)
- error()
- end
- end
- print("Entrer l'ID du computer")
- local Comp = read()
- while true do
- print("Entrer le cote du Modem left/right/top/bottom ")
- MdSide = read()
- if (MdSide == "left") or (MdSide == "right") or (MdSide == "top") or (MdSide == "bottom") then
- break
- end
- end
- while true do
- print("Entrer le cote du Moniteur left/right/top/bottom")
- MnSide = read()
- if (MnSide == "left") or (MnSide == "right") or (MnSide == "top") or (MnSide == "bottom") then
- break
- end
- end
- term.clear()
- p = peripheral.wrap(MnSide)
- c = term.current()
- rednet.open(MdSide)
- term.redirect(p)
- term.setBackgroundColour(colors.black)
- term.clear()
- term.setCursorPos(11,1)
- term.setTextColour(colors.white)
- term.write("Grainator")
- term.setCursorPos(12,2)
- term.setTextColour(colors.yellow)
- term.write("running")
- term.setTextColour(colors.lightGray)
- paintutils.drawFilledBox(1,18,29,19,colors.green)
- paintutils.drawPixel(1,16,colors.white)
- paintutils.drawPixel(1,14,colors.white)
- paintutils.drawPixel(1,12,colors.white)
- paintutils.drawPixel(1,10,colors.white)
- paintutils.drawPixel(1,8,colors.white)
- paintutils.drawPixel(29,16,colors.white)
- paintutils.drawPixel(29,14,colors.white)
- paintutils.drawPixel(29,12,colors.white)
- paintutils.drawPixel(29,10,colors.white)
- paintutils.drawPixel(29,8,colors.white)
- while true do
- Receive()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement