Added utils.setupMonitor, improved module importing
This commit is contained in:
parent
ea4e05a889
commit
c901cd8053
2
react
2
react
@ -1,5 +1,5 @@
|
|||||||
--import utils for lamp rednet stuffs
|
--import utils for lamp rednet stuffs
|
||||||
dofile("/git-scripts/utils")
|
require("git-scripts.utils")
|
||||||
|
|
||||||
--regulate in between these in normal operation
|
--regulate in between these in normal operation
|
||||||
NORMAL_THRESHOLD_U = 8000000
|
NORMAL_THRESHOLD_U = 8000000
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
LAMP_SIDE = "bottom"
|
dofile("git-scripts.utils")
|
||||||
|
|
||||||
dofile("/git-scripts/utils")
|
LAMP_SIDE = "bottom"
|
||||||
|
|
||||||
local modemSide = utils.getSideOf("modem")
|
local modemSide = utils.getSideOf("modem")
|
||||||
rednet.open(modemSide)
|
rednet.open(modemSide)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
dofile("/git-scripts/utils")
|
require("git-scripts.utils")
|
||||||
|
|
||||||
modemSide = utils.getSideOf("modem") --get side the modem is on
|
modemSide = utils.getSideOf("modem") --get side the modem is on
|
||||||
if modemSide == nil then
|
if modemSide == nil then
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
--import module
|
require("git-scripts.utils")
|
||||||
dofile("/git-scripts/utils")
|
|
||||||
|
|
||||||
local function printUsage()
|
local function printUsage()
|
||||||
print("Usage:")
|
print("Usage:")
|
||||||
|
8
utils
8
utils
@ -18,4 +18,12 @@ function utils.printToMon(mon, text)
|
|||||||
mon.setCursorPos(x, y+1)
|
mon.setCursorPos(x, y+1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function utils.setupMonitor(side, textScale)
|
||||||
|
local mon = peripheral.wrap(side)
|
||||||
|
mon.clear()
|
||||||
|
mon.setTextScale(textScale)
|
||||||
|
mon.setCursor(1, 1)
|
||||||
|
return mon
|
||||||
|
end
|
||||||
|
|
||||||
return utils
|
return utils
|
||||||
|
Loading…
x
Reference in New Issue
Block a user