Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function txt(x,y,t,c,b)
- if not c then c = colors.white end
- if not b then b = colors.black end
- term.setCursorPos(x,y)
- term.setTextColor(c)
- term.setBackgroundColor(b)
- write(t)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- end
- local function debug(x,y,t,c,b)
- if not c then c = colors.red end
- if not b then b = colors.white end
- txt(x,y,"Debug: "..t,c,b)
- read()
- end
- local function addToFile(name,str)
- local h = fs.open(name, fs.exists(name) and "a" or "w")
- h.write(str)
- h.close()
- end
- local function overWrite(name,str)
- local h = fs.open(name, "w")
- h.write(str)
- h.close()
- end
- return {
- txt = txt,
- debug = debug,
- addToFile = addToFile,
- overWrite = overWrite
- }
Add Comment
Please, Sign In to add comment