Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SimSoft Yellow - Copyright by Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/)
- --Installer
- --Functions
- function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function CP(x,y)
- term.setCursorPos(x,y)
- end
- function BC(farbe)
- term.setBackgroundColor(farbe)
- end
- function TC(farbe)
- term.setTextColor(farbe)
- end
- function SimSoftClear(anzeige)
- BC(1)
- Clear()
- w, h = term.getSize()
- wC = 0
- hC = 1
- while true do
- wC = (wC+1)
- CP(wC, hC)
- BC(SystemColor)
- write(" ")
- if wC == w then
- if hC == 3 then
- break
- else
- hC = (hC+1)
- wC = 0
- end
- end
- end
- TC(1)
- CP(((w/2)-((#anzeige)/2)),2)
- print(anzeige)
- end
- --FlshDep
- BC(32768)
- Clear()
- sleep(0.1)
- BC(128)
- Clear()
- sleep(0.1)
- BC(256)
- Clear()
- sleep(0.1)
- BC(1)
- Clear()
- sleep(0.1)
- --Variablen
- SystemColor = 16
- --System
- w, h = term.getSize()
- SimSoftClear(" SimSoft Yellow")
- BC(SystemColor)
- TC(1)
- CP(10,10)
- print(" ")
- CP(10,11)
- print(" English ")
- CP(10,12)
- print(" ")
- CP((w-20),10)
- print(" ")
- CP((w-20),11)
- print(" Deutsch ")
- CP((w-20),12)
- print(" ")
- while true do
- event, side, x, y = os.pullEvent()
- if event == "mouse_click" then
- if x >= 10 and x <= 20 and y >= 10 and y <= 12 then
- sprache = "english"
- break
- end
- if x >= (w-20) and x <= (w-10) and y >= 10 and y <= 12 then
- sprache = "german"
- break
- end
- end
- end
- SimSoftClear(" SimSoft Yellow")
- function ColorAuswahl()
- BC(4)
- CP(15,7)
- print(" ")
- CP(15,8)
- print(" ")
- BC(8)
- CP(19,7)
- print(" ")
- CP(19,8)
- print(" ")
- BC(16)
- CP(23,7)
- print(" ")
- CP(23,8)
- print(" ")
- BC(32)
- CP(27,7)
- print(" ")
- CP(27,8)
- print(" ")
- BC(64)
- CP(31,7)
- print(" ")
- CP(31,8)
- print(" ")
- BC(512)
- CP(35,7)
- print(" ")
- CP(35,8)
- print(" ")
- --
- BC(2)
- CP(15,10)
- print(" ")
- CP(15,11)
- print(" ")
- BC(2048)
- CP(19,10)
- print(" ")
- CP(19,11)
- print(" ")
- BC(4096)
- CP(23,10)
- print(" ")
- CP(23,11)
- print(" ")
- BC(8192)
- CP(27,10)
- print(" ")
- CP(27,11)
- print(" ")
- BC(16384)
- CP(31,10)
- print(" ")
- CP(31,11)
- print(" ")
- BC(1024)
- CP(35,10)
- print(" ")
- CP(35,11)
- print(" ")
- BC(SystemColor)
- TC(1)
- if sprache == "german" then
- CP(15,14)
- print(" ")
- CP(15,15)
- print(" Weiter ")
- CP(15,16)
- print(" ")
- elseif sprache == "english" then
- CP(15,14)
- print(" ")
- CP(15,15)
- print(" Continue ")
- CP(15,16)
- print(" ")
- end
- end
- ColorAuswahl()
- while true do
- event, side, x, y = os.pullEvent()
- if event == "mouse_click" then
- if x >= 15 and x <= 16 and y >= 7 and y <= 8 then
- SystemColor = 4
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 19 and x <= 20 and y >= 7 and y <= 8 then
- SystemColor = 8
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 23 and x <= 24 and y >= 7 and y <= 8 then
- SystemColor = 16
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 27 and x <= 28 and y >= 7 and y <= 8 then
- SystemColor = 32
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 31 and x <= 32 and y >= 7 and y <= 8 then
- SystemColor = 64
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 35 and x <= 36 and y >= 7 and y <= 8 then
- SystemColor = 512
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- --
- if x >= 15 and x <= 16 and y >= 10 and y <= 11 then
- SystemColor = 2
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 19 and x <= 20 and y >= 10 and y <= 11 then
- SystemColor = 2048
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 23 and x <= 24 and y >= 10 and y <= 11 then
- SystemColor = 4096
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 27 and x <= 28 and y >= 10 and y <= 11 then
- SystemColor = 8192
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 31 and x <= 32 and y >= 10 and y <= 11 then
- SystemColor = 16384
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 35 and x <= 36 and y >= 10 and y <= 11 then
- SystemColor = 1024
- SimSoftClear(" SimSoft Yellow")
- ColorAuswahl()
- end
- if x >= 15 and x <= 36 and y >= 14 and y <= 16 then
- break
- end
- end
- end
- SimSoftClear(" SimSoft Yellow")
- if sprache == "german" then
- e1 = "Nutzername"
- e2 = " Passwort"
- e3 = " PC-Name"
- e4 = " Installieren "
- e5 = " "
- e6 = "Exit"
- e7 = "Sicher?"
- e8 = "Bist Du Dir Wirklich Sicher?"
- e9 = "Komm Schon... :("
- e10 = "Dann geh halt..."
- elseif sprache == "english" then
- e1 = " Username"
- e2 = " Password"
- e3 = " PC-Name"
- e4 = " Install "
- e5 = " "
- e6 = "Quit"
- e7 = "Sure?"
- e8 = "Are You Really Sure?"
- e9 = "Come On... :("
- e10 = "Then go out..."
- end
- BC(1)
- TC(128)
- CP(4,7)
- print(e1)
- CP(4,9)
- print(e2)
- CP(4,11)
- print(e3)
- TC(SystemColor)
- CP(15,7)
- name = read()
- CP(15,9)
- pass = read("#")
- CP(15,11)
- pcname = read()
- SimSoftClear(" SimSoft Yellow")
- BC(SystemColor)
- TC(1)
- CP(((w/2)-8),9)
- print(e5)
- CP(((w/2)-8),10)
- print(e4)
- CP(((w/2)-8),11)
- print(e5)
- TC(256)
- BC(1)
- CP(3,(h-1))
- print(e6)
- est = 1
- while true do
- event, side, x, y = os.pullEvent()
- if event == "mouse_click" then
- if x >= ((w/2)-9) and x <= ((#e5)+((w/2)-9)) and y >= 9 and y <= 11 then
- break
- end
- if x >= 3 and x <= 6 and y == (h-1) and est == 1 then
- est = 2
- BC(1)
- TC(256)
- CP(3, (h-1))
- print(" ")
- CP(34,5)
- print(e7)
- end
- if x >= 34 and x <= (34+((#e7)-1)) and y == 5 and est == 2 then
- est = 3
- BC(1)
- TC(256)
- CP(34,5)
- print(" ")
- CP(20,16)
- print(e8)
- end
- if x >= 20 and x <= (20+((#e8)-1)) and y == 16 and est == 3 then
- est = 4
- BC(1)
- TC(256)
- CP(20,16)
- print(" ")
- CP(2,5)
- print(e9)
- end
- if x >= 2 and x <= (2+((#e9)-1)) and y == 5 and est == 4 then
- est = 5
- BC(1)
- TC(256)
- CP(2,5)
- print(" ")
- CP(5,13)
- print(e10)
- end
- if x >= 5 and x <= (5+((#e10)-1)) and y == 13 and est == 5 then
- os.reboot()
- end
- end
- end
- function Download(CodePB, Pfad)
- local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
- local datei = http.get("https://pastebin.com/raw/" .. textutils.urlEncode(CodePB) .. "?cb=" .. cacheBuster)
- datei = datei.readAll()
- local file = fs.open(Pfad, "w")
- file.write(datei)
- file.close()
- write(" ")
- end
- SimSoftClear(" SimSoft Yellow")
- BC(256)
- CP(10,10)
- print(" ")
- CP(10,10)
- BC(SystemColor)
- write(" ")
- fs.delete("startup")
- fs.delete("SimSoft")
- if sprache == "english" then
- Download("dcjj6U0K","startup")
- Download("sLdeYQHx","SimSoft/System/Desktop")
- Download("VBjNd2NS","SimSoft/System/SystemStart")
- Download("jALaL4ap","SimSoft/System/Update")
- Download("zNnJ9UU7","SimSoft/System/AppStore")
- elseif sprache == "german" then
- Download("dcjj6U0K","startup")
- Download("TcDnMcBC","SimSoft/System/Desktop")
- Download("dt27J7kG","SimSoft/System/SystemStart")
- Download("LUX6HVMy","SimSoft/System/Update")
- Download("iSCumw3S","SimSoft/System/AppStore")
- end
- --BackgroundParty
- Download("YWxbZmJ5","SimSoft/Data/Background")
- --end BackgroundParty
- local file = fs.open("SimSoft/Data/BackgroundConfig", "w")
- file.writeLine("SimSoft Background Config")
- file.writeLine("")
- file.writeLine("true")
- file.close()
- write(" ")
- local file = fs.open("SimSoft/Data/SystemColor", "w")
- file.writeLine("SimSoft System Color")
- file.writeLine("")
- file.writeLine(SystemColor)
- file.close()
- write(" ")
- local file = fs.open("SimSoft/Data/UserData", "w")
- file.writeLine("SimSoft User Data")
- file.writeLine("")
- file.writeLine(name)
- file.writeLine(pass)
- file.writeLine("true")
- file.close()
- write(" ")
- local file = fs.open("SimSoft/Data/Version", "w")
- file.writeLine("SimSoft System Version")
- file.writeLine("")
- file.writeLine("5.0.2")
- file.writeLine(sprache)
- file.close()
- write(" ")
- os.setComputerLabel(pcname)
- write(" ")
- fs.makeDir("SimSoft/SappS")
- CP(10,10)
- print(" ")
- os.reboot()
- --end
Add Comment
Please, Sign In to add comment