fixed keys added more OS syscalls and added colored logging
This commit is contained in:
@@ -13,6 +13,11 @@ local function write(text)
|
||||
if c == "\n" then
|
||||
y = y + 1
|
||||
x = 1
|
||||
if y-1 >= h then
|
||||
term.scroll(1)
|
||||
y = h
|
||||
term.setCursorPos(x, y)
|
||||
end
|
||||
elseif c == "\t" then
|
||||
local tabSize = 4
|
||||
local spaces = tabSize - ((x - 1) % tabSize)
|
||||
@@ -38,7 +43,7 @@ local function write(text)
|
||||
y = y + 1
|
||||
end
|
||||
|
||||
if y-1 > h then
|
||||
if y-1 >= h then
|
||||
term.scroll(1)
|
||||
y = h
|
||||
term.setCursorPos(x, y)
|
||||
@@ -66,7 +71,6 @@ local ok, err = xpcall(function()
|
||||
local lua = {
|
||||
coroutine = true,
|
||||
debug = true,
|
||||
_HOST = true,
|
||||
_VERSION = true,
|
||||
assert = true,
|
||||
collectgarbage = true,
|
||||
@@ -160,7 +164,7 @@ local ok, err = xpcall(function()
|
||||
|
||||
local computer = {
|
||||
time = function() return apis.os.epoch("utc") end,
|
||||
clock = function() return apis.os.clock()/1000 end,
|
||||
clock = function() return apis.os.clock()*1000 end,
|
||||
shutdown = apis.os.shutdown,
|
||||
reboot = apis.os.reboot,
|
||||
getMachineEvent = function()
|
||||
|
||||
@@ -63,13 +63,13 @@ tKeys[keys.pageUp] = '\x1b[5~'
|
||||
tKeys[keys.pageDown] = '\x1b[6~'
|
||||
tKeys[keys.home] = '\x1b[1~'
|
||||
tKeys[keys["end"]] = '\x1b[4~'
|
||||
tKeys[keys.capsLock] = '\x1b[capsLock'
|
||||
tKeys[keys.scrollLock] = '\x1b[scrollLock'
|
||||
tKeys[keys.numLock] = '\x1b[numLock'
|
||||
if keys.printScreen then
|
||||
tKeys[keys.printScreen] = '\x1b[printScreen'
|
||||
end
|
||||
tKeys[keys.pause] = '\x1b[pause'
|
||||
--tKeys[keys.capsLock] = '\x1b[capsLock'
|
||||
--tKeys[keys.scrollLock] = '\x1b[scrollLock'
|
||||
--tKeys[keys.numLock] = '\x1b[numLock'
|
||||
--if keys.printScreen then
|
||||
-- tKeys[keys.printScreen] = '\x1b[printScreen'
|
||||
--end
|
||||
--tKeys[keys.pause] = '\x1b[pause'
|
||||
tKeys[keys.f1] = '\x1b[11~'
|
||||
tKeys[keys.f2] = '\x1b[12~'
|
||||
tKeys[keys.f3] = '\x1b[13~'
|
||||
|
||||
Reference in New Issue
Block a user