Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- This API, Project Colligo, is the sole work of LDShadowLord. If you wish to use this API in your program it MUST be kept as its own file and loaded as an API with os.loadAPI() this header must also be kept intact!
- ]]
- w,h = term.getSize()
- lvart1 = {"[MSG]","[GUD]","[ERR]","[SVR]","[404]","[501]","[403]","[412]","[204]","[411]"}
- lvart2 = {2048,8192,16,2,2,16,16,16,16,16}
- function getVersion()
- local varstri = "Project Colligo - 0.140A"
- return varstri
- end
- function reset()
- term.setTextColour(colours.white)
- term.setCursorPos(1,1)
- term.clear()
- end
- function isAdvanced()
- return term.isColor and term.isColor()
- end
- function attachPeripheral(type)
- local periphno = 1
- local ldata = peripheral.find(type)
- local doing = true
- local returned = {}
- while doing do
- for i=1, #ldata do
- peripheral.wrap(ldata[i])
- table.insert(returned, ldata[i])
- end
- end
- return returned
- end
- function aPrint(type,text)
- if type == "c" then
- local lvarx,lvary = term.getCursorPos()
- local lvar2 = #text
- local lvar3 = math.floor((w-lvar2)/2)
- term.setCursorPos(lvar3,lvary)
- print(text)
- elseif type == "r" then
- local lvarx, lvary = term.getCursorPos()
- local lvar2 = #text
- term.setCursorPos(w-lvar2-1,lvary)
- print(text)
- elseif type == "l" then
- local lvarx, lvaryy = term.getCursorPos()
- term.setCursorPos(2,lvary)
- print(text)
- end
- end
- function aWrite(type,text)
- if type == "c" then
- local lvarx,lvary = term.getCursorPos()
- local lvar2 = #text
- local lvar3 = math.floor((w-lvar2)/2)
- term.setCursorPos(lvar3,lvary)
- write(text)
- elseif type == "r" then
- local lvarx, lvary = term.getCursorPos()
- local lvar2 = #text
- term.setCursorPos(w-lvar2-1,lvary)
- write(text)
- elseif type == "l" then
- local lvarx, lvaryy = term.getCursorPos()
- term.setCursorPos(2,lvary)
- write(text)
- end
- end
- function erPrint(type,message)
- local lvar = #lvart1 + 1
- local lvar2 = #lvart2 + 1
- if lvar ~= lvar2 then
- error("Tables do not match")
- else
- if isAdvanced() == true then
- if type <lvar then
- term.setTextColour(lvart2[type])
- write(lvart1[type].." ")
- term.setTextColour(1)
- print(message)
- elseif type == 36956 then
- term.setTextColour(16384)
- write("[FTL] ")
- term.setTextColour(16384)
- print(message)
- end
- end
- end
- term.setTextColour(1)
- end
- --[[
- function guibutt(name,x,xx,y,colour,text)
- local lvar1 = xx-x
- local doing = true
- if lvar1 < #text then
- error("Text is larger than container!")
- else
- while doing do
- local event,button, cx, cy = os.pullEvent("mouse_click")
- if cx>x and cx<xx and cy == y then
- return true
- break
- end
- end
- end
- end
- ]]
- function getTime()
- timeResult = pcall (function() return (http.get("http://www.timeapi.org/utc/0+hours+after+now?format="..textutils.urlEncode("%d-%m-%y %H:%M"))).readAll() end)
- return timeResult
- end
- --[[
- function blog(data)
- name = getTime()
- doing = true
- while doing do
- if not fs.exists("/logs/") then
- mkdir("/logs")
- else
- if fs.exists("/logs/log-"*) then
- fs.open("name".."[1]",w)
- end
- end
- end
- end
- ]]
Advertisement
Add Comment
Please, Sign In to add comment