Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color={2^0,2^1,2^2,2^3,2^4,2^5,2^6,2^7,2^8,2^9,2^10,2^11,2^12,2^13,2^14,2^15}
- side="left" -- Seite fuer die Kabel
- m=peripheral.wrap("back") -- Seite fuer den Monitor
- names={"redstone 1","redstone 2","redstone 3","redstone 4","redstone 5","redstone 6","redstone 7","redstone 8","redstone 9","redstone 10","redstone 11","redstone 12","redstone 13","redstone 14","redstone 15","redstone 16",}
- print("edit startup eingeben um Monitor und Kabel seiten zu aendern")
- if fs.exists("status")==false then
- fp=fs.open("status","w")
- fp.writeLine("0")
- fp.close()
- end
- function saveBundled()
- fp=fs.open("status","w")
- fp.writeLine(tostring(rs.getBundledOutput(side)))
- fp.close()
- end
- function setBundled()
- fp=fs.open("status","r")
- rs.setBundledOutput(side,tonumber(fp.readLine()))
- fp.close()
- end
- function toggleBundledOutput()
- if color[yPos]~=nil then
- if rs.testBundledInput(side,color[yPos]) == true then
- rs.setBundledOutput(side,colors.subtract(rs.getBundledOutput(side),color[yPos]))
- else
- rs.setBundledOutput(side,colors.combine(rs.getBundledOutput(side),color[yPos]))
- end
- end
- if yPos==i then
- rs.setBundledOutput(side,4095)
- saveBundled()
- end
- if yPos==i+1 then
- rs.setBundledOutput(side,0)
- saveBundled()
- end
- end
- setBundled()
- while true do
- i=1
- m.clear()
- while color[i]~=nil do
- m.setCursorPos(1,i)
- if redstone.testBundledInput(side,color[i]) then
- m.setBackgroundColor(colors.green) else m.setBackgroundColor(colors.red)
- end
- m.write(" ")
- m.setBackgroundColor(colors.black)
- m.setCursorPos(2,i)
- m.setTextColor(color[i])
- m.write(names[i])
- i=i+1
- end
- m.setTextColor(colors.green)
- m.setCursorPos(2,i)
- m.write("Redstone All On")
- m.setTextColor(colors.red)
- m.setCursorPos(2,i+1)
- m.write("Redstone All Off")
- event, monSide, xPos, yPos = os.pullEvent("monitor_touch")
- toggleBundledOutput()
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement