Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function start()
- m = peripheral.wrap("right")
- m.clear()
- m.setCursorPos(1,1)
- m.write("Select Floor:")
- writeAllLevels()
- while true do
- parallel.waitForAny(touch, wireless)
- end
- end
- function touch()
- event,side,x,y = os.pullEvent()
- rednet.open('top')
- if y == 3 then
- rednet.broadcast('6')
- writeAllLevels()
- writeLevel(3, true, "4 - Autocrafting")
- else if y == 4 then
- rednet.broadcast('5')
- writeAllLevels()
- writeLevel(4, true, "3 - AE Control")
- else if y == 5 then
- rednet.broadcast('4')
- writeAllLevels()
- writeLevel(5, true, "2 - AE Control")
- else if y == 6 then
- rednet.broadcast('3')
- writeAllLevels()
- writeLevel(6, true, "L - Lobby ")
- else if y == 7 then
- rednet.broadcast('2')
- writeAllLevels()
- writeLevel(7, true, "B1 - Mine lvl 40")
- else if y == 8 then
- rednet.broadcast('1')
- writeAllLevels()
- writeLevel(8, true, "B2 - Bedrock")
- end
- end
- end
- end
- end
- end
- end
- function wireless()
- rednet.open("top")
- ID, msg, distance = rednet.receive()
- if msg == '5' then
- writeAllLevels()
- writeLevel(3, true, "3 - Resource Processing")
- else if msg == '4' then
- writeAllLevels()
- writeLevel(4, true, "2 - AE Control")
- else if msg == '3' then
- writeAllLevels()
- writeLevel(5, true, "L - Lobby ")
- else if msg == '2' then
- writeAllLevels()
- writeLevel(6, true, "B1 - Mine lvl 40")
- else if msg == '1' then
- writeAllLevels()
- writeLevel(7, true, "B2 - Bedrock")
- end
- end
- end
- end
- end
- end
- function writeAllLevels()
- m.setBackgroundColor(colors.black)
- writeLevel(3, false, "4 - Autocrafting")
- writeLevel(4, false, "3 - Resource Processing")
- writeLevel(5, false, "2 - AE Control")
- writeLevel(6, false, "L - Lobby ")
- writeLevel(7, false, "B1 - Mine lvl 40")
- writeLevel(8, false, "B2 - Bedrock")
- end
- function writeLevel(level, current, string)
- if current then
- m.setBackgroundColor(colors.blue)
- m.setCursorPos(1,level)
- m.write(string)
- else
- m.setBackgroundColor(colors.black)
- m.setCursorPos(1,level)
- m.write(string)
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement