package management

This commit is contained in:
kepler155c
2018-11-03 18:14:11 -04:00
parent aa66b1c663
commit 1f7ef4a483
124 changed files with 1274 additions and 9 deletions

33
core/debug.lua Normal file
View File

@@ -0,0 +1,33 @@
_G.requireInjector(_ENV)
local Util = require('util')
local device = _G.device
local os = _G.os
local term = _G.term
local args = { ... }
local mon = device[args[1] or 'monitor'] or error('Syntax: debug <monitor>')
mon.clear()
mon.setTextScale(.5)
mon.setCursorPos(1, 1)
local oldDebug = _G._debug
_G._debug = function(...)
local oldTerm = term.redirect(mon)
Util.print(...)
term.redirect(oldTerm)
end
repeat
local e, side = os.pullEventRaw('monitor_touch')
if e == 'monitor_touch' and side == mon.side then
mon.clear()
mon.setTextScale(.5)
mon.setCursorPos(1, 1)
end
until e == 'terminate'
_G._debug = oldDebug