Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Copyright XiliØn Studios
- GuiList = {}
- --To clear the terminal
- function C()
- term.clear()
- end
- -- To set the cursor position (Arguments: X Coordinate, Y Coordinate )
- function CP(x,y)
- term.setCursorPos(x,y)
- end
- -- To set the background color (Arguments: Color < "colors." + Color >
- function BC(bgC)
- term.setBackgroundColor(bgC)
- end
- -- To set the text color (Arguments: Color < "colors." + Color >
- function TC(ttC)
- term.setTextColor(ttC)
- end
- -- To Write text [ Without having to write multiple commands ] (Arguments: The Text, Starting X Coordinate, Starting Y Coordinate, -- --- Background Color < "colors." + Color >, Text Color < "colors." + Color >)
- 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(ty,Fcoord,Fcol)
- if ty == "h" then
- BC(Fcol)
- Cp(1,Fcoord)
- term.clearLine()
- elseif ty == "v" then
- for i = 1,19 do
- Write(" ",Fcoord,i,Fcol,Fcol)
- end
- end
- end
- function FS(fillCol,effect,side,eTime)
- if effect then
- if side == "left" then
- for x = 1,51 do
- F("v",x,fillCol)
- sleep(eTime)
- end
- elseif side == "right" then
- x = 52
- for i = 1,51 do
- x = x - 1
- F("v",x,fillCol)
- end
- elseif side == "up" then
- for y = 1,19 do
- F("h",y,fillCol)
- end
- elseif side == "down" then
- y = 20
- for i = 1,19 do
- y = y - 1
- F("h",y,fillCol)
- end
- end
- else
- for x = 1,45 do
- F("v",x,fillCol)
- end
- end
- end
- function Block(x1,y1,x2,y2,fill,col)
- CP(x1,y1)
- for xa1 = x1,x2 - x1 + 1 do
- Write(" ",xa1,y1,col,col)
- end
- CP(x1,y1)
- for ya1 = y1,y2 - y1 + 1 do
- Write(" ",x1,ya1,col,col)
- end
- CP(x1,y2)
- for xa2 = x1,x2 - x1 + 1 do
- Write(" ",xa2,y2,col,col)
- end
- CP(x2,y1)
- for ya2 = y1,y2 - y1 + 2 do
- Write(" ",x2,ya2,col,col)
- end
- if fill then
- for y = y1,y2 do
- for x = x1,x2 do
- Write(" ",x,y,col,col)
- end
- 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 FsMake(path)
- local f = fs.open(path)
- f.close()
- end
- function ReadAll(file)
- local f = fs.open(file)
- local data = f.readAll()
- f.close()
- return data
- end
- function GlobalWrite(file,writeData)
- local f = fs.open(file)
- f.write(writeData)
- f.close()
- end
- function OsReboot()
- os.reboot()
- end
- function OsShutdown()
- os.shutdown()
- end
- function Api(api)
- os.loadAPI(api)
- end
- function Image(Image,x,y)
- local 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
- function KernelOp(code,prog)
- if code == 0001 then
- shell.run("/XynSoft/System/Troubleshoot/Ts")
- elseif code == 0000 then
- shell.run("/XynSoft/System/Ops/Shutdown")
- elseif code == 1000 then
- shell.run("/XynSoft/System/Ops/Logoff")
- elseif code == 1111 then
- shell.run("/XynSoft/System/Ops/AppRun",prog)
- end
- end
- function DrawTitleBar(TitleTxt,bgColor,SubTxt,xCoord)
- F("h",1,bgColor)
- F("h",2,bgColor)
- F("h",3,bgColor)
- local x = xCoord + (string.len(TitleTxt) + 2)
- Write(TitleTxt,xCoord,2,bgColor,colors.white)
- Write(SubTxt,x,2,bgColor,colors.lightGray)
- end
- -- function SetAlias(aliasName,appPath)
- -- |||
- -- end
Advertisement
Add Comment
Please, Sign In to add comment