----------------------------------- -- Functions for the execSession -- ----------------------------------- function print(...) execSession:print(...) end function sleep(n) execSession:sleep(n) end function readLine(str) return execSession:readLine(str) end function clear() execSession.console:clear() end function kitty() print[[ _______________ < Hello, World! > --------------- \ \ /\_)o< | \ | O . O| \_____/ ]] end function about() print[[ | | //## \'---'/ |// ._'_'O'.'_ / LuaTerm 2.0beta ['o'] ___: | (C) 2013 Jim Bauwens / ,-': |_ | \_,./__,__: | Thanks to Adriweb | | Levak | | TI-Planet | |]] end local function addSpaces(str, n) return str .. string.rep(" ", n-#str) end local function bI(str) return (str:gsub("/%-", "\201") :gsub("%-\\", "\187") :gsub("\\_", "\200") :gsub("_/", "\188") :gsub("%+%-","\204") :gsub("%-%+", "\185") :gsub("%-", "\205") :gsub("|", "\186") ) end function gcct() print(bI" /------------\\") print(bI"/---------------+ Sessions +--------------\\") print(bI"| \\_----------_/ |") for session,_ in pairs(Session.getSessions()) do print(addSpaces(bI"| " .. tostring(session.thread), 22) .. "\t" .. addSpaces((session.suspended and "not " or "") .. "running", 12) .. bI"|") end print(bI"\\_-------------------------------------_/") end function getSession() return execSession end function getConsole() return execSession.console end function browse(env) env = env or _G local count = 0 local rows = execSession.console.rows local cols = execSession.console.cols for k, v in pairs(env) do execSession:print(addSpaces(k, cols/3), v) count = count + 1 if count == rows - 1 then execSession:write("Any key to continue...") execSession:read() execSession:write("\n") count = 0 end end end