Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- term.setCursorPos(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function start ()
- term.setBackgroundColor(colors.magenta)
- term.setTextColor(colors.white)
- term.clear ()
- if not fs.exists (".core/Ikon.nft") then
- shell.run("pastebin get cwfciQxe .core/Ikon.nft")
- start()
- end
- local image = paintutils.loadImage(".core/Ikon.nft")
- paintutils.drawImage(image, 18, 4)
- prc ("Setting", 16)
- sleep (1)
- setupmenu ()
- end
- function setupmenu ()
- local myWindow = window.create(term.current(),16,1,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- if not fs.exists (".core/logo.nft") then
- shell.run("pastebin get u5hbXtBq .core/logo.nft")
- setupmenu()
- end
- local image = paintutils.loadImage(".core/logo.nft")
- paintutils.drawImage(image, 22, 5)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- myWindow.setCursorPos(20,17)
- print" Pepek"
- myWindow.setCursorPos(28,17)
- print"Soft "
- myWindow.setCursorPos(22,18)
- term.setTextColor(colors.black)
- print"2014-2019"
- myWindow.setCursorPos(27,17)
- myWindow.setTextColor(colors.lime)
- print"@"
- local myWindow = window.create(term.current(),1,1,16,19)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,19)
- myWindow.setBackgroundColor(colors.green)
- myWindow.clear()
- term.setBackgroundColor (colors.green)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- print "Setting"
- term.setTextColor(colors.white)
- term.setCursorPos(2,5)
- print "Info"
- term.setCursorPos(2,7)
- print ""
- term.setCursorPos(2,9)
- print "Network"
- term.setCursorPos(2,11)
- print ""
- term.setCursorPos(2,13)
- print "Updates"
- term.setCursorPos(2,15)
- print ""
- term.setCursorPos(2,17)
- print ""
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 5 and button == 1 then
- info ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- network ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- elseif x >= 2 and x <= 16 and y == 15 and button == 1 then
- elseif x >= 2 and x <= 16 and y == 17 and button == 1 then
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setCursorPos (51,1)
- print "*"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- plocha ()
- else
- setupmenu ()
- end
- end
- break
- end
- end
- end
- function info ()
- local myWindow = window.create(term.current(),16,1,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,16,19)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,19)
- myWindow.setBackgroundColor(colors.green)
- myWindow.clear()
- term.setBackgroundColor (colors.green)
- term.setTextColor(colors.lime)
- print "< Info"
- term.setCursorPos(2,3)
- local myWindow = window.create(term.current(),17,1,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(colors.green)
- term.setCursorPos(1,1)
- print " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- print " "
- myWindow.setTextColor(colors.blue)
- myWindow.setCursorPos(9, 18)
- print "Pepek@Soft"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(20, 18)
- print "Software"
- myWindow.setTextColor(colors.lime)
- myWindow.setCursorPos(14, 18)
- print "@"
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 3)
- print "Pepdroll 7"
- myWindow.setCursorPos(12, 3)
- myWindow.setTextColor(colors.green)
- print " Nuclear Edition"
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 6)
- print "Nuclear edition for easy control "
- myWindow.setCursorPos(2, 7)
- print "for IC2 reactor with project red "
- myWindow.setCursorPos(2, 8)
- print "Bundled Cable. "
- myWindow.setCursorPos(2, 11)
- print ("Current version "..verze)
- internetcon = ""
- myWindow.setCursorPos(2, 13)
- if fs.exists ("/online") then
- myWindow.setTextColor(colors.black)
- internetcon = "Internet access"
- else
- myWindow.setTextColor(colors.red)
- internetcon = "No internet access"
- end
- myWindow.setCursorPos(12, 13)
- print (internetcon)
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 13)
- print ("Network : ")
- myWindow.setCursorPos(2, 14)
- if os.getComputerLabel() == nil then
- print ("Label : None")
- else
- print ("Label : "..(os.getComputerLabel()))
- end
- term.setBackgroundColor (colors.green)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- print "< Info"
- term.setTextColor(colors.white)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- plocha ()
- elseif x == 50 and y == 1 then
- setupmenu ()
- else
- info ()
- end
- end
- end
- end
- end
- function network ()
- if not fs.exists (".core/network.nfp") then
- shell.run("pastebin get 8zkYBLPE .core/network.nfp")
- network()
- end
- local image = paintutils.loadImage(".core/network.nfp")
- paintutils.drawImage(image, 17, 1)
- local myWindow = window.create(term.current(),1,1,16,19)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,19)
- myWindow.setBackgroundColor(colors.green)
- myWindow.clear()
- term.setBackgroundColor (colors.green)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- print "< Network"
- term.setTextColor(colors.white)
- term.setCursorPos(2,5)
- print "Modem"
- term.setCursorPos(2,7)
- print "Label"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- modem ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- plocha ()
- elseif x == 50 and y == 1 then
- setupmenu ()
- else
- network ()
- end
- end
- end
- end
- end
- function modem ()
- term.setBackgroundColor(colors.green)
- term.setCursorPos(1,1)
- print " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- if not fs.exists (".core/modem") then
- back = "0"
- left = "0"
- right = "0"
- top = "1"
- bottom = "0"
- else
- data = fs.open (".core/modem", "r")
- back = data.readLine ()
- left = data.readLine ()
- right = data.readLine ()
- top = data.readLine ()
- bottom = data.readLine ()
- data.close ()
- end
- if back == "1" then
- local function openRednet()
- for _,side in ipairs({"back"}) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
- rednet.open(side)
- return side
- end
- end
- back = "0"
- end
- modemSide = openRednet()
- if modemSide == nil then
- back = "0"
- else
- print("Opened modem on "..modemSide)
- end
- end
- if left == "1" then
- local function openRednet()
- for _,side in ipairs({"left"}) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
- rednet.open(side)
- return side
- end
- end
- left = "0"
- end
- modemSide = openRednet()
- if modemSide == nil then
- left = "0"
- else
- print("Opened modem on "..modemSide)
- end
- end
- if right == "1" then
- local function openRednet()
- for _,side in ipairs({"right"}) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
- rednet.open(side)
- return side
- end
- end
- right = "0"
- end
- modemSide = openRednet()
- if modemSide == nil then
- right = "0"
- else
- print("Opened modem on "..modemSide)
- end
- end
- if top == "1" then
- local function openRednet()
- for _,side in ipairs({"top"}) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
- rednet.open(side)
- return side
- end
- end
- top = "0"
- end
- modemSide = openRednet()
- if modemSide == nil then
- top = "0"
- else
- print("Opened modem on "..modemSide)
- end
- end
- if bottom == "1" then
- local function openRednet()
- for _,side in ipairs({"bottom"}) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
- rednet.open(side)
- return side
- end
- end
- bottom = "0"
- end
- modemSide = openRednet()
- if modemSide == nil then
- bottom = "0"
- else
- print("Opened modem on "..modemSide)
- end
- end
- term.setTextColor(colors.blue)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (2,2)
- print "Modem connection"
- term.setCursorPos(22, 7)
- term.setTextColor(colors.black)
- print ("Back")
- term.setCursorPos(37, 7)
- if back == "0" then
- stavback = "No"
- else
- stavback = "Yes"
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- print (" "..stavback.." ")
- if stavback == "Yes" then
- paintutils.drawPixel (37, 7, colors.lime)
- elseif stavback == "No" then
- paintutils.drawPixel (43, 7, colors.red)
- paintutils.drawPixel (37, 7, colors.lightGray)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(22, 9)
- print ("Left")
- term.setCursorPos(37, 9)
- if left == "0" then
- stavleft = "No"
- else
- stavleft = "Yes"
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- print (" "..stavleft.." ")
- if stavleft == "Yes" then
- paintutils.drawPixel (37, 9, colors.lime)
- elseif stavleft == "No" then
- paintutils.drawPixel (43, 9, colors.red)
- paintutils.drawPixel (37, 9, colors.lightGray)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(22, 11)
- print ("Right")
- term.setCursorPos(37, 11)
- if right == "0" then
- stavright = "No"
- else
- stavright = "Yes"
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- print (" "..stavright.." ")
- if stavright == "Yes" then
- paintutils.drawPixel (37, 11, colors.lime)
- elseif stavright == "No" then
- paintutils.drawPixel (43, 11, colors.red)
- paintutils.drawPixel (37, 11, colors.lightGray)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(22, 13)
- print ("Top")
- term.setCursorPos(37, 13)
- if top == "0" then
- stavtop = "No"
- else
- stavtop = "Yes"
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- print (" "..stavtop.." ")
- if stavtop == "Yes" then
- paintutils.drawPixel (37, 13, colors.lime)
- elseif stavtop == "No" then
- paintutils.drawPixel (43, 13, colors.red)
- paintutils.drawPixel (37, 13, colors.lightGray)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(22, 15)
- print ("Bottom")
- term.setCursorPos(37, 15)
- if bottom == "0" then
- stavbottom = "No"
- else
- stavbottom = "Yes"
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- print (" "..stavbottom.." ")
- if stavbottom == "Yes" then
- paintutils.drawPixel (37, 15, colors.lime)
- elseif stavbottom == "No" then
- paintutils.drawPixel (43, 15, colors.red)
- paintutils.drawPixel (37, 15, colors.lightGray)
- end
- local myWindow = window.create(term.current(),1,1,16,19)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,19)
- myWindow.setBackgroundColor(colors.green)
- myWindow.clear()
- term.setBackgroundColor (colors.green)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- print "< Network"
- term.setTextColor(colors.white)
- term.setCursorPos(2,5)
- print "Modem"
- term.setCursorPos(2,7)
- print "Label"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 37 and x <= 43 and y == 7 and button == 1 then
- if back == "1" then
- back = "0"
- rednet.close ("back")
- elseif back == "0" then
- back = "1"
- end
- data = fs.open (".core/modem", "w")
- data.writeLine (back)
- data.writeLine (left)
- data.writeLine (right)
- data.writeLine (top)
- data.writeLine (bottom)
- data.close ()
- modem ()
- elseif x >= 37 and x <= 43 and y == 9 and button == 1 then
- if left == "1" then
- left = "0"
- rednet.close ("left")
- elseif left == "0" then
- left = "1"
- end
- data = fs.open (".core/modem", "w")
- data.writeLine (back)
- data.writeLine (left)
- data.writeLine (right)
- data.writeLine (top)
- data.writeLine (bottom)
- data.close ()
- modem ()
- elseif x >= 37 and x <= 43 and y == 11 and button == 1 then
- if right == "1" then
- right = "0"
- rednet.close ("right")
- elseif right == "0" then
- right = "1"
- end
- data = fs.open (".core/modem", "w")
- data.writeLine (back)
- data.writeLine (left)
- data.writeLine (right)
- data.writeLine (top)
- data.writeLine (bottom)
- data.close ()
- modem ()
- elseif x >= 37 and x <= 43 and y == 13 and button == 1 then
- if top == "1" then
- top = "0"
- rednet.close ("top")
- elseif top == "0" then
- top = "1"
- end
- data = fs.open (".core/modem", "w")
- data.writeLine (back)
- data.writeLine (left)
- data.writeLine (right)
- data.writeLine (top)
- data.writeLine (bottom)
- data.close ()
- modem ()
- elseif x >= 37 and x <= 43 and y == 15 and button == 1 then
- if bottom == "1" then
- bottom = "0"
- rednet.close ("bottom")
- elseif bottom == "0" then
- bottom = "1"
- end
- data = fs.open (".core/modem", "w")
- data.writeLine (back)
- data.writeLine (left)
- data.writeLine (right)
- data.writeLine (top)
- data.writeLine (bottom)
- data.close ()
- modem ()
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- modem ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- plocha ()
- elseif x == 50 and y == 1 then
- network ()
- else
- modem ()
- end
- end
- end
- end
- end
- function label ()
- local myWindow = window.create(term.current(),17,1,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(colors.green)
- term.setCursorPos(1,1)
- print " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- print " "
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 9)
- print("Set label: ")
- myWindow.setCursorPos(2, 11)
- print("Label clear: ")
- term.setBackgroundColor(colors.lightGray)
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(14, 9)
- print " "
- myWindow.setCursorPos(14, 9)
- if os.getComputerLabel() == nil then
- print "None"
- else
- print(os.getComputerLabel())
- end
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos(15, 11)
- print " Clear "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 29 and x <= 39 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos(14, 9)
- print " "
- myWindow.setCursorPos(14, 9)
- propojeni = read ()
- os.setComputerLabel(propojeni)
- label ()
- elseif x >= 30 and x <= 37 and y == 11 and button == 1 then
- myWindow.setCursorPos(14, 9)
- shell.run ("label clear")
- label ()
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- modem ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- plocha ()
- elseif x == 50 and y == 1 then
- network ()
- else
- label ()
- end
- end
- end
- end
- end
- function plocha()
- nuclear()
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement