Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SJNOS redstonemgr.exe by MC403
- local red_active = true
- local slc = 0
- outputs = {"Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off","Off"}
- color = {colors.red,colors.orange,colors.yellow,colors.lime,colors.green,colors.cyan,colors.lightBlue,colors.blue,colors.purple,colors.magenta,colors.pink,colors.brown,colors.white,colors.lightGray,colors.gray,colors.black}
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function drawIcon(x,y,color)
- term.setBackgroundColor(color)
- for i=0,3 do
- term.setCursorPos(x,y+i)
- print(" ")
- end
- end
- function drawIcons()
- local result = 0
- for i=0,1 do
- for j=0,7 do
- drawIcon(j*6+2,i*4+3,color[i*8+(j+1)])
- if outputs[i*8+(j+1)]=="On" then
- result = result + color[i*8+(j+1)]
- end
- end
- end
- rs.setBundledOutput("back",result)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- for i=0,1 do
- for j=0,7 do
- term.setCursorPos(j*6+3,i*4+4)
- print(outputs[i*8+(j+1)])
- end
- end
- term.setCursorPos(20,16)
- term.setTextColor(colors.cyan)
- term.setBackgroundColor(colors.white)
- print("Select all ")
- term.setCursorPos(20,17)
- print("Select none")
- term.setCursorPos(20,18)
- print("Lightshow ")
- end
- function drawTitle()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.cyan)
- term.clearLine()
- print(" Redstone")
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- term.setCursorPos(51,1)
- print("X")
- term.setBackgroundColor(colors.white)
- end
- function showStartMenu()
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.setCursorPos(1,2)
- print(" Exit ")
- print(" Help ")
- print(" Info ")
- end
- function drawDialog()
- term.setBackgroundColor(colors.white)
- clear()
- drawIcons()
- drawTitle()
- end
- function closeDialog()
- red_active = false
- shell.run("start")
- end
- function showHelp()
- clear()
- drawTitle()
- print("Select a color to blablabal")
- print("Blablabbalballbalblablal")
- print("Diverse.informationen")
- end
- function showInfo()
- end
- drawDialog()
- sleep(0.5)
- while red_active do
- local event, button, x, y = os.pullEventRaw()
- if slc==0 then
- if event=="mouse_click" then
- if x>=2 and x<=7 and y==1 and button==1 then
- --Startmenu
- slc = 1
- showStartMenu()
- break
- elseif x==51 and y==1 and button==1 then
- --Close (X)
- closeDialog()
- end
- --NOW THE COLOR ICONS
- for i=0,1 do
- for j=0,7 do
- if x>=(j*6+2) and x<=(j*6+8) and y>=(i*4+3) and y<=(i*4+6) and button==1 then
- term.setCursorPos((j*6+3),(i*4+4))
- if outputs[i*8+(j+1)]=="On" then
- outputs[i*8+(j+1)] = "Off"
- else
- outputs[i*8+(j+1)] = "On"
- end
- drawIcons()
- --
- term.setCursorPos((j*6+3),(i*4+4))
- print(i*8+(j+1))
- --
- else
- drawDialog()
- end
- end
- end
- end
- elseif slc==1 then
- if event=="mouse_click" then
- if x<=10 and button==1 then
- if y==2 then
- --Exit
- closeDialog()
- elseif y==3 then
- --Help
- slc = 2
- showHelp()
- elseif y==4 then
- --Info
- showInfo()
- else
- slc = 0
- drawDialog()
- end
- else
- slc = 0
- drawDialog()
- end
- end
- elseif slc==2 then
- if event=="mouse_click" then
- if x==51 and y==1 and button==1 then
- slc = 0
- drawDialog()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement