Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local whoare = 1
- shell.run(".modderOS/einstellungen") --Einstellungsdatei Laden
- local function centerPrint(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- function reset()
- local x,y = term.getSize()
- term.setBackgroundColor(einstellungen[1]) --Farbe abfragen
- term.setTextColor(einstellungen[3]) --Farbe abfragen
- term.clear()
- term.setCursorPos(1, 1)
- paintutils.drawLine(1, 1, x, 1, einstellungen[2]) --Farbe abfragen
- term.setCursorPos(1, 1)
- print("ModderOS Programme Softwares [FREE BETA VERSION]")
- whoare = 1
- end
- reset()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if whoare == 1 then
- if event == "mouse_click" then
- if y == 1 and x > 0 and x < 10 then
- --term.setCursorPos(13, 2)
- term.setBackgroundColor(einstellungen[2]) --Farbe abfragen
- term.setCursorPos(1, 2)
- print(" ")
- print("exit ")
- print("reboot ")
- print("shutdown")
- term.setBackgroundColor(colors.black)
- whoare = 2
- end
- if y == 1 and x > 10 and x < 20 then
- term.setBackgroundColor(einstellungen[2]) --Farbe abfragen
- term.setCursorPos(10, 2)
- print(" ")
- term.setCursorPos(10, 3)
- print("Firewolf")
- term.setCursorPos(10, 4)
- print("Paint ")
- term.setCursorPos(10, 5)
- print("GPS ")
- term.setCursorPos(10, 6)
- print("P.Liste ")
- term.setBackgroundColor(colors.black)
- whoare = 3
- end
- if y == 1 and x > 20 and x < 30 then
- term.setBackgroundColor(einstellungen[2]) --Farbe abfragen
- term.setCursorPos(20, 2)
- print(" ")
- term.setCursorPos(20, 3)
- print("Install ")
- term.setCursorPos(20, 4)
- print("Start ")
- term.setCursorPos(20, 5)
- print("Entfernen")
- term.setBackgroundColor(colors.black)
- whoare = 4
- end
- end
- elseif whoare == 2 then
- if event == "mouse_click" then
- if y == 4 and x > 0 and x < 10 then
- os.reboot()
- end
- if y == 5 and x > 0 and x < 10 then
- os.shutdown()
- end
- if y == 3 and x > 0 and x < 10 then
- term.clear()
- term.setCursorPos(1, 1)
- print("CraftOS 1.5 (start by ModderOS)")
- break
- end
- if y == 1 and x > 0 and x < 10 then
- reset()
- end
- end
- elseif whoare == 3 then
- if y == 1 and x > 10 and x < 20 then
- reset()
- end
- if y == 3 and x > 10 and x < 20 then
- shell.run(".modderOS/firewolf")
- reset()
- end
- if y == 4 and x > 10 and x < 20 then
- reset()
- whoare=3
- local sx,sy = term.getSize()
- term.setCursorPos(1, sy)
- write("FileName> ")
- programm=read()
- reset()
- whoare=3
- shell.run("paint "..programm)
- reset()
- end
- if y == 5 and x > 10 and x < 20 then
- shell.run(".modderOS/gps")
- reset()
- end
- if y == 6 and x > 10 and x < 20 then
- shell.run(".modderOS/programmliste")
- reset()
- end
- elseif whoare == 4 then
- if y == 1 and x > 20 and x < 30 then
- reset()
- end
- if y == 3 and x > 20 and x < 30 then
- reset()
- whoare=4
- local sx,sy = term.getSize()
- term.setCursorPos(1, sy)
- write("Pastebin> ")
- programm=read()
- reset()
- whoare=4
- term.setCursorPos(1, sy)
- write("Installing ...")
- local response = http.get(
- "http://pastebin.com/raw.php?i="..textutils.urlEncode( programm )
- )
- reset()
- whoare=4
- term.setCursorPos(1, sy)
- write("Programmname> ")
- name=read()
- if fs.exists( ".modderOS/programme/"..name ) then
- reset()
- term.setCursorPos(1, sy)
- write("Diese Datei gibt es schon.")
- else
- local sResponse = response.readAll()
- response.close()
- local file = fs.open( ".modderOS/programme/"..name, "w" )
- file.write( sResponse )
- file.close()
- local file1 = fs.open( ".modderOS/programme/liste/"..name, "w" )
- file1.close()
- reset()
- end
- end
- if y == 4 and x > 20 and x < 30 then
- reset()
- whoare=4
- local sx,sy = term.getSize()
- term.setCursorPos(1, sy)
- write("Programmname> ")
- programm=read()
- if fs.exists( ".modderOS/programme/"..programm ) then
- shell.run(".modderOS/programme/"..programm)
- reset()
- else
- reset()
- term.setCursorPos(1, sy)
- print("Diese datei gibt es nicht!")
- end
- end
- if y == 5 and x > 20 and x < 30 then
- reset()
- whoare=4
- local sx,sy = term.getSize()
- term.setCursorPos(1, sy)
- write("Programmname> ")
- programm=read()
- if fs.exists( ".modderOS/programme/"..programm ) then
- shell.run("delete .modderOS/programme/"..programm)
- shell.run("delete .modderOS/programme/liste/"..programm) -- menüeintrag löschen
- reset()
- else
- reset()
- term.setCursorPos(1, sy)
- print("Diese datei gibt es nicht!")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement