Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --connect
- rednet.open("left")
- m = peripheral.wrap("right")
- --Clear
- m.setTextScale(1)
- m.setCursorPos(1,1)
- m.setBackgroundColor(colors.black)
- m.clear()
- --ID
- print(os.getComputerID())
- --listes
- listes_pc = {}
- --Variables
- page = "1"
- pageMax = (math.floor(#listes_pc/10))+1
- ecran = "ecranMain"
- --Function draw
- function drawBarreNav()
- local x
- for x = 1, 82 do
- m.setCursorPos(x,1)
- m.setBackgroundColor(colors.gray)
- m.write(" ")
- end
- m.setCursorPos(78,1)
- m.setBackgroundColor(colors.lightGray)
- m.write("home")
- end
- function drawMain()
- local n,y,x
- for n = 1,2 do
- for x = 5,35 do
- for y = 4, 10 do
- m.setCursorPos(x+((40*n)-40),y)
- m.setBackgroundColor(colors.red)
- m.write(" ")
- end
- end
- end
- local n,y,x
- for n = 1,2 do
- for x = 5,35 do
- for y = 17,23 do
- m.setCursorPos(x+((40*n)-40),y)
- m.setBackgroundColor(colors.red)
- m.write("")
- end
- end
- end
- m.setCursorPos(15,6)
- m.write("PC CONNECTE")
- end
- function drawPcCo()
- m.setCrusorPos(1,2)
- m.write("ID")
- m.setCrusorPos(9,2)
- m.write("|")
- m.setCrusorPos(10,2)
- m.write("Type")
- m.setCrusorPos(20,2)
- m.write("|")
- m.setCrusorPos(21,2)
- m.write("Etat")
- m.setCrusorPos(30,2)
- m.write("|")
- m.setCrusorPos(40,2)
- m.write("|")
- m.setCrusorPos(50,2)
- m.write("|")
- m.setCrusorPos(60,2)
- m.write("|")
- m.setCrusorPos(70,2)
- m.write("|")
- m.setCrusorPos(71,2)
- m.write("Delete")
- end
- function drawPcCo()
- end
- while true do
- --Draw
- drawBarreNav()
- if ecran == "ecranMain" then
- drawMain()
- end
- if ecran == "ecranPcCo" then
- drawPcCo()
- end
- local event, e1, e2, e3 = os.pullEvent()
- --event rednet
- if event == "rednet_message" then
- end
- --event monitor
- if event == "monitor_touch" then
- if x >= 78 and x <= 82 then
- if y >= 1 and y <= 1 then
- ecran = "ecranMain"
- end
- end
- --MainMenu
- if ecran == "ecranMain" then
- --Bouton Haut Gauche
- if x >= 5 and x <= 35 then
- if y >= 4 and y <= 10 then
- ecran = "ecranPcCo"
- end
- end
- --Bouton Haut Droite
- if x >= 45 and x <=75 then
- if y >= 4 and y <= 10 then
- end
- end
- --Bouton bas gauche
- if x >= 5 and x <= 35 then
- if y >= 17 and y <= 23 then
- end
- end
- --Bouton bas droite
- if x >= 45 and x <= 75 then
- if y >= 17 and y <= 23 then
- end
- end
- end
- if ecran == "ecranPcCo" then
- end
- end
- --event key
- if event == "key" then
- if ecran == "ecranMain" then
- end
- if ecran == "ecranPcCo" then
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement