Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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(ty,Fcoord,Fcol)
- if ty == "h" then
- Write(" ",1,Fcoord,Fcol,Fcol)
- elseif ty == "v" then
- for i = 1,19 do
- Write(" ",Fcoord,i,Fcol,Fcol)
- end
- end
- end
- function FS(fillCol,effect,eTime)
- y = 1
- if effect then
- for y = 1,19 do
- F("h",y,fillCol)
- sleep(eTime)
- end
- elseif not effect then
- for y = 1,19 do
- F("h",y,fillCol)
- end
- end
- end
- function FV(side,fillCol,effect,eTime)
- if effect then
- if side == "left" then
- for x = 1,45 do
- F("v",x,fillCol)
- sleep(eTime)
- end
- elseif side == "right" then
- x = 45
- for i = 1,45 do
- x = x - 1
- F("v",x,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
- Data = {
- ,function GetType(data)
- return type(data)
- end,
- Str = {
- function Length(string)
- return string.len(string)
- end,
- function GM(a,b)
- return string.gmatch(a,b)
- end
- },
- List = {
- function ReturnItem(lst,index)
- return lst[index]
- end,
- function ReturnAllIndexTable(lst)
- s = 0
- t = {}
- for i in lst do
- table.insert(s,i,t)
- end
- return t
- end,
- function Insert(ins,lst)
- table.insert(ins,lst)
- end,
- function ReturnSelf(lst)
- return lst
- end,
- function ReturnIndexes(lst)
- s = 0
- l = {}
- for i in lst do
- table.insert(s,l)
- s = s + 1
- end
- return l
- end
- },
- Tabl = {
- function Insert(key,v,tabl)
- table.insert(key,v,tabl)
- end,
- function ReturnItem(key,tabl)
- return tabl[key]
- end,
- function ReturnSelf(tabl)
- return tabl
- end,
- function ReturnKey(tabl)
- l = {}
- for key,i in pairs(tabl) do
- table.insert(key,l)
- end
- return l
- end
- }
- }
- System = {
- ,FileSystem = {
- ,function GetFileListening(dir)
- return fs.list(dir)
- end,
- function GetFileSystemList()
- tabl = {}
- for a in fs.list("/") do
- for b in fs.list("/"..a) do
- for c in fs.list("/"..a.."/"..b) do
- for d in fs.list("/"..a.."/"..b.."/"..c) do
- for e in fs.list("/"..a.."/"..b.."/"..c.."/"..d) do
- for f in fs.list("/"..a.."/"..b.."/"..c.."/"..d.."/"..e) do
- table.insert(fs.list("/"..a.."/"..b.."/"..c.."/"..d.."/"..e.."/"..f),tabl)
- end
- end
- end
- end
- end
- end
- return tabl
- end,
- function CheckDirForExistingFiles(tab,dir)
- a = fs.list(tab)
- retrn = {}
- for f in a do
- if f in tab then
- table.insert(f,"True",retrn)
- else
- table.insert(f,"False",retrn)
- end
- end
- return retrn
- end
- },
- Http = {
- ,function Get(code,file)
- http.get(code,file)
- end,
- function Put(file)
- http.put(file)
- end
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment