Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitors = {
- peripheral.wrap("monitor_0");
- peripheral.wrap("monitor_1");
- }
- for o=1,#monitors do
- monitors[o].setBackgroundColor(colors.black)
- monitors[o].clear()
- end
- liste1 = {}
- function buildgui()
- for p=1,#monitors do
- actmonitor = p
- color("b","black")
- monitors[p].clear()
- local w,h = monitors[p].getSize()
- --Default GUI
- monitors[p].setCursorPos(1,1)
- color("b","blue")
- monitors[p].setCursorPos(1,1)
- for i=0,w do
- monitors[p].write(" ")
- end
- monitors[p].setCursorPos(1,1)
- monitors[p].write(" CodersOS - CID:"..os.getComputerID())
- monitors[p].setCursorPos(1,2)
- for i=2,h do
- monitors[p].setCursorPos(1,i)
- monitors[p].write(" ")
- end
- monitors[p].setCursorPos(1,h)
- for i=1,w do
- monitors[p].write(" ")
- end
- --END basic
- --INHALT
- inhalt()
- color("b","blue")
- monitors[p].setCursorPos(w,1)
- for i=1,h do
- monitors[p].setCursorPos(w,i)
- monitors[p].write(" ")
- end
- end
- end
- function color(tb,clr)
- if tb=="b" then
- if clr=="black" then
- monitors[actmonitor].setBackgroundColor(colors.black)
- elseif clr=="blue" then
- monitors[actmonitor].setBackgroundColor(colors.blue)
- elseif clr=="white" then
- monitors[actmonitor].setBackgroundColor(colors.white)
- elseif clr=="green" then
- monitors[actmonitor].setBackgroundColor(colors.green)
- elseif clr=="red" then
- monitors[actmonitor].setBackgroundColor(colors.red)
- end
- elseif tb=="t" then
- if clr=="black" then
- monitors[actmonitor].setTextColor(colors.black)
- elseif clr=="blue" then
- monitors[actmonitor].setTextColor(colors.blue)
- elseif clr=="white" then
- monitors[actmonitor].setTextColor(colors.white)
- elseif clr=="green" then
- monitors[actmonitor].setTextColor(colors.reen)
- elseif clr=="red" then
- monitors[actmonitor].setBackgroundColor(colors.red)
- end
- end
- end
- function inhalt()
- color("b","black")
- monitors[actmonitor].setCursorPos(3,3)
- color("b","white")
- color("t","black")
- monitors[actmonitor].write(" Pinnwand ".."Anzahl:"..#liste1)
- color("b","black")
- color("t","white")
- for i=1,#liste1 do
- monitors[actmonitor].setCursorPos(3,i+4)
- monitors[actmonitor].write(i..". "..liste1[i])
- end
- end
- function additem()
- term.write("Neues Item: ")
- inpt = io.read()
- liste1[(#liste1+1)]= inpt
- end
- function removeitem()
- term.write("Welche Nummer?:")
- inpt = io.read()
- help=""
- --for i=inpt,#liste1 do
- --liste1[i]=tostring(liste1[i+1])
- --end
- table.remove(liste1,inpt)
- end
- function menu()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Was wollen sie tuen(add/remove/clear):")
- sel =io.read()
- if sel=="add" then
- additem()
- elseif sel =="remove" then
- removeitem()
- buildgui()
- elseif sel =="clear" then
- for i=1,#liste1 do
- table.remove(liste1,#liste1)
- end
- buildgui()
- end
- end
- function getvalues()
- end
- while true do
- buildgui()
- menu()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement