Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --shell.run("monitor", "right", "mon.lua", "07")
- tArgs = {...}
- local mm = {}
- function mm:bars(num, line)
- local maxline = 16
- if num == nil then num = 1 end
- if num > maxline then num = maxline end
- local b = num
- local p = maxline
- local sleeptime = 0.1
- term.setTextColor(colors.lightGray)
- while p > 0 do
- term.write("|")
- p = p - 1
- os.sleep(sleeptime)
- end
- term.setTextColor(colors.black)
- term.setCursorPos(2,line)
- while b > 0 do
- term.write("|")
- b = b - 1
- os.sleep(sleeptime)
- end
- term.setTextColor(colors.black)
- end
- function mm:draw()
- local cnum = "1"
- local tnum = "16"
- if tArgs[1] ~= nil then cnum = tArgs[1] end
- if tArgs[2] ~= nil then tnum = tArgs[2] end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- term.setCursorPos(2,9)
- term.write("Chamber " .. cnum .. " / " .. tnum)
- term.setTextColor(colors.lightGray)
- term.setCursorPos(5,25)
- term.write("LightSource")
- term.setCursorPos(2,11)
- mm:bars(tonumber(tArgs[1]), 11)
- end
- mm:draw()
- while(true) do
- event, param = os.pullEvent()
- if event == "redstone" and redstone.getInput("bottom") == false then
- mm:draw()
- os.sleep(0.1)
- else end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement