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 pastebin ()
- local f=fs.open("system/.core/colors","r")
- local cnt=f.readAll()
- f.close()
- local nastaveni=textutils.unserialize(cnt)
- local nastaveni=textutils.unserialize(cnt)
- term.setBackgroundColor(colors.white)
- term.clear ()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- print " "
- term.setTextColor(colors.white)
- prc ("Pastebin Manager", 1)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(5,4)
- print "- Run "
- term.setCursorPos(5,6)
- print "- Get "
- term.setCursorPos(5,8)
- print "- Put "
- term.setBackgroundColor(colors.red)
- term.setCursorPos(51, 1)
- print " "
- term.setTextColor(colors.white)
- term.setCursorPos(51, 1)
- print "*"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- while true do
- local event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" then
- if x >= 5 and x <= 10 and y == 4 and button == 1 then
- spustit ()
- elseif x >= 5 and x <= 10 and y == 6 and button == 1 then
- ulozit ()
- elseif x >= 5 and x <= 10 and y == 8 and button == 1 then
- nahrat ()
- elseif x == 51 and y == 1 and button == 1 then
- plocha ()
- end
- end
- end
- end
- function spustit ()
- term.setCursorPos(4,12)
- print "enter the code"
- term.setCursorPos(4,13)
- term.setBackgroundColor(colors.lightBlue)
- print " "
- term.setCursorPos(4,13)
- kod1 = io.read ()
- if kod1 == "" then
- pastebin ()
- else
- shell.run ("pastebin run",kod1)
- plocha ()
- end
- while true do
- if x == 51 and y == 1 and button == 1 then
- plocha ()
- end
- end
- end
- function ulozit ()
- term.setCursorPos(4,12)
- print "enter the code"
- term.setCursorPos(4,13)
- term.setBackgroundColor(colors.lightBlue)
- print " "
- term.setCursorPos(4,13)
- kod1 = io.read ()
- if kod1 == "" then
- pastebin ()
- else
- term.setBackgroundColor(colors.white)
- term.setCursorPos(4,12)
- print "Name: |Path: /system/downloads/.."
- print " "
- end
- term.setCursorPos(4,13)
- term.setBackgroundColor(colors.lightBlue)
- print " "
- term.setCursorPos(4,13)
- kod2 = io.read ()
- if kod2 == "" then
- pastebin ()
- else
- shell.run ("pastebin get",kod1,"/system/downloads/"..kod2)
- prohlizec ()
- end
- while true do
- if x == 51 and y == 1 and button == 1 then
- plocha ()
- end
- end
- end
- function nahrat ()
- term.setCursorPos(4,12)
- print "enter the path"
- term.setCursorPos(4,13)
- term.setBackgroundColor(colors.lightBlue)
- print " "
- term.setCursorPos(4,13)
- kod1 = io.read ()
- if kod1 == "" then
- pastebin ()
- else
- shell.run ("pastebin put",kod1)
- end
- pokr = io.read ()
- if pokr == "" then
- plocha ()
- else
- plocha ()
- end
- while true do
- if x == 51 and y == 1 and button == 1 then
- plocha ()
- end
- end
- end
- function plocha ()
- shell.run ("/system/desktop")
- end
- pastebin ()
Add Comment
Please, Sign In to add comment