Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get YmbkBRWU yourname
- -- if you want to add this programm to the startup, then you have to write: edit startup , shell.run("your name of the programm") , push CTRLG or STRG save , then again CTRLG or STRG exit /\ ADDED /\
- -- if you want to changed somthing take the text and go to create new paste with(-out) login then you can download this to computercraft per pastebin get (your code)
- local cableSide = "left" -- Or where ever your cable is. (rednet cable)
- local mon = peripheral.wrap("top") -- Or where ever your colour monitor is.
- mon.setTextColor(colours.white)
- mon.setBackgroundColor(colours.black)
- mon.clear()
- local xLen, yLen = mon.getSize()
- local myEvent
- -- Menu items.
- -- Add as desired, but don't exceed 16 entries.
- local switches = {
- ["Me System"] = {colour = colours.white, screenRow = 1}, -- can change name (it´s colour of rednet cable)
- ["Laser Drills"] = {colour = colours.orange, screenRow = 4}, -- can change name (__)
- ["EnderQuarrys"] = {colour = colours.magenta, screenRow = 8}, -- can change name
- ["UU Matter Production"] = {colour = colours.lightBlue, screenRow = 12}, -- can change name
- ["Extractor <1>"] = {colour = colours.yellow, screenRow = 16},
- ["Extractor <2>"] = {colour = colours.lime, screenRow = 20},
- ["Strom Item Tesseract"] = {colour = colours.pink, screenRow = 24},
- ["Hydropneumatischeangel"] = {colour = colours.gray, screenRow = 28}}
- -- you can change this for more lever or rename this you have to change this } , and the lines (15)
- -- Initial menu render:
- for key,value in pairs(switches) do
- mon.setBackgroundColor(colours.black)
- mon.setCursorPos(2,value.screenRow)
- mon.write(key)
- mon.setCursorPos(xLen-5,value.screenRow)
- if colours.test(rs.getBundledOutput(cableSide),value.colour) then
- mon.setBackgroundColor(colours.green)
- mon.write(" On ")
- else
- mon.setBackgroundColor(colours.red)
- mon.write(" Off ")
- end
- end
- -- Main program loop.
- while true do
- myEvent = {os.pullEvent("monitor_touch")}
- for key,value in pairs(switches) do if myEvent[4] == value.screenRow then
- mon.setCursorPos(xLen-5,value.screenRow)
- if not colours.test(rs.getBundledOutput(cableSide),value.colour) then
- mon.setBackgroundColor(colours.green)
- mon.write(" On ")
- rs.setBundledOutput(cableSide,colours.combine(rs.getBundledOutput(cableSide),value.colour))
- else
- mon.setBackgroundColor(colours.red)
- mon.write(" Off ")
- rs.setBundledOutput(cableSide,colours.subtract(rs.getBundledOutput(cableSide),value.colour))
- end
- break
- end end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement