Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkColor()
- return iscolor()
- end
- function C()
- term.clear()
- end
- function CP(x,y)
- term.setCursorPos(x,y)
- end
- function BC(bgC)
- term.setBackgroundColor(bgC)
- end
- function TC(ttC)
- term.setTextColor(ttC)
- end
- function Write(text,Wx,Wy,Wbc,Wtc)
- CP(Wx,Wy)
- BC(Wbc)
- TC(Wtc)
- term.write(text)
- end
- function Input(text,rd,Ix,Iy,Ibc,Itc)
- CP(Ix,Iy)
- BC(Ibc)
- TC(Itc)
- term.write(text)
- return read(rd)
- end
- function F(Fy,Fcol)
- Write(" ",1,Fy,Fcol,Fcol)
- end
- function FS(fillCol,effect,eTime)
- y = 1
- if effect then
- for y = 1,19 do
- F(y,fillCol)
- sleep(eTime)
- end
- elseif not effect then
- for y = 1,19 do
- F(y,fillCol)
- end
- end
- end
- function ShellEvent(evt)
- a,b,c,d = os.pullEventRaw()
- if a == evt then
- return b,c,d
- end
- end
- function ShellEventAdv(a,b,c,d,e,f)
- evt,button,x,y = os.pullEventRaw()
- if evt == a then
- if button == b then
- if x >= c then
- if x <= d then
- if y >= e then
- if y <= f then
- return true
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- end
- function PastebinGet(PBcode,Fpath)
- http.get(PBcode,Fpath)
- end
- function FsDel(Fpath)
- fs.delete(Fpath)
- end
- function FsMkdir(dir)
- fs.makeDir(dir)
- end
- function FsExists(file)
- return fs.exists(file)
- end
- function OsReboot()
- os.reboot()
- end
- function OsShutdown()
- os.shutdown()
- end
- function Api(api)
- os.loadAPI(api)
- end
- function Image(Image,x,y)
- img = paintutils.loadImage(Image)
- paintutils.drawImage(img,x,y)
- end
- function Button(text,x,midY,bgC,ttC)
- for x1 = x,(x + (string.len(text))) + 1 do
- Write(" ",x1,midY - 1,bgC,ttC)
- end
- Write(" "..text.." ",x,midY,bgC,ttC)
- for x1 = x,(x + (string.len(text))) + 1 do
- Write(" ",x1,midY + 1,bgC,ttC)
- end
- end
- if checkColor() then
- setup()
- else
- CP(1,1)
- print("Sorry, but XynSoft is'nt compatible with your system...")
- CP(1,2)
- print("Error: 0x000fff")
- CP(1,3)
- input("Hit enter to continue... ")
- print("Downloading alternative and compatible XynSoft OS Version... ")
- end
- function setup()
- FS(colors.white,false,0)
- F(1,colors.gray)
- F(2,colors.gray)
- F(3,colors.gray)
- Write("XynSoft 1.0",5,2,colors.gray,colors.white)
- Write("Installer",18,2,colors.gray,colors.lightGray)
- Write("Choose your language",15,6,colors.white,colors.black)
- Button("English",11,12,colors.gray,colors.white)
- Button("Nederlands",27,12,colors.gray,colors.white)
- t1 = true
- while t1 do
- if ShellEventAdv("mouse_click",1,10,18,11,13) then
- lang = "en"
- t1 = false
- elseif ShellEventAdv("mouse_click",1,26,38,11,13) then
- lang = "nl"
- t1 = false
- end
- end
- if lang == "en" then
- e1 = "Information: "
- i2 = "- Location: /XynSoft/"
- i3 = "- APIs: /XynSoft/System/SystemCC/"
- b1 = "Next"
- e4 = "License:"
- l5 = "- Do not use this code for your own work"
- l6 = "- Do not use this OS for illegal operations"
- l7 = "- Copyright (C) Fluxcraft Labs. All rights reserved. -"
- e8 = "Install"
- e9 = "Quit"
- e10 = "XynSoft succesfully installed"
- e11 = "To Setup"
- elseif lang == "nl" then
- e1 = "Informatie: "
- i2 = "- Locatie: /XynSoft/"
- i3 = "- APIs: /XynSoft/System/SystemCC/"
- b1 = "Volgende"
- e4 = "Licensie:"
- l5 = "- Do not use this code for your own work"
- l6 = "- Do not use this OS for illegal operations"
- l7 = "- Copyright (C) Fluxcraft Labs. All rights reserved."
- e8 = "Installeren"
- e9 = "Annuleren"
- e10 = "XynSoft is met succes geinstalleerd"
- e11 = "Naar Setup.."
- else
- sec = 10
- FS(colors.blue,false)
- BC(colors.blue)
- TC(colors.white)
- Write("Err: Undifined Value",7,7,colors.blue,colors.white)
- for i = 1,10 do
- sec = sec - 1
- Write("Rebooting computer after "..sec.." Seconds..")
- end
- OsReboot()
- end
- FS(colors.white,false,0)
- F(1,colors.gray)
- F(2,colors.gray)
- F(3,colors.gray)
- Write("XynSoft 1.0",5,2,colors.gray,colors.white)
- Write("Installer",18,2,colors.gray,colors.lightGray)
- Write(e1,18,7,colors.white,colors.black)
- Write(i2,7,9,colors.white,colors.gray)
- Write(i3,7,10,colors.white,colors.gray)
- Button(b1,18,13,colors.gray,colors.white)
- t2 = true
- while t2 do
- if ShellEventAdv("mouse_click",1,17,18 + (string.len(b1) + 1),12,14) then
- t2 = false
- end
- end
- FS(colors.white,false,0)
- F(1,colors.gray)
- F(2,colors.gray)
- F(3,colors.gray)
- Write("XynSoft 1.0",5,2,colors.gray,colors.white)
- Write("Installer",18,2,colors.gray,colors.lightGray)
- Write(e4,14,6,colors.white,colors.black)
- Write(l5,1,8,colors.white,colors.gray)
- Write(l6,1,9,colors.white,colors.gray)
- Write(l7,1,10,colors.white,colors.gray)
- Button(b1,18,13,colors.gray,colors.white)
- t3 = true
- while t3 do
- if ShellEventAdv("mouse_click",1,17,18 + (string.len(b1) + 1),12,14) then
- t3 = false
- end
- end
- FS(colors.white,false,0)
- F(1,colors.gray)
- F(2,colors.gray)
- F(3,colors.gray)
- Write("XynSoft 1.0",5,2,colors.gray,colors.white)
- Write("Installer",18,2,colors.gray,colors.lightGray)
- end
Advertisement
Add Comment
Please, Sign In to add comment