Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- OftenUsedCommands by Andronio
- local cmp = require'component'
- local comp = require'computer'
- local ouc = {}
- local start_time = comp.uptime()
- function ouc.cc(compon)
- if cmp.isAvailable(compon) then
- return true
- else
- return false
- end
- end
- function ouc.report(msg)
- print(msg)
- if ouc.cc('tunnel') then
- cmp.tunnel.send(msg)
- end
- end
- function ouc.getProgTime()
- local all_sec = comp.uptime() - start_time
- local mins = math.floor(all_sec/60)
- local secs = math.floor(all_sec - mins*60)
- return 'Program Time: '..mins..' min. '..secs..' sec.'
- end
- function ouc.tblChk(val, tbl)
- for k, v in pairs(tbl) do
- if v == val then
- return true, k
- end
- end
- return false
- end
- return ouc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement