Posted 09 September 2013 - 08:24 PM
Hey guys. I've been playing around with open.peripheral recently and I wanted to create a simple program that outputs the max capacity of a batbox and displays how much of that capacity is being used. this is what I have so far.
however. When I go to display this on my monitor the text obviously scrolls up as the new lines are being printed.
I tried doing this
but the result is that the screen stays blank.
Any suggestions?
while true do
os.startTimer(5)
os.pullEvent("timer")
local bat1cap = net.callRemote("batbox_3","getCapacity")
local bat2cap = net.callRemote("batbox_4","getCapacity")
local bat1store = net.callRemote("batbox_3","getStored")
local bat2store = net.callRemote("batbox_4","getStored")
print("BatBox [1] Power Levels")
print(bat1store.."/"..bat1cap)
print("")
print("BatBox [2] Power Levels")
print(bat2store.."/"..bat2cap)
end
however. When I go to display this on my monitor the text obviously scrolls up as the new lines are being printed.
I tried doing this
while true do
shell.run('clear')
os.startTimer(5)
os.pullEvent("timer")
local bat1cap = net.callRemote("batbox_3","getCapacity")
local bat2cap = net.callRemote("batbox_4","getCapacity")
local bat1store = net.callRemote("batbox_3","getStored")
local bat2store = net.callRemote("batbox_4","getStored")
print("BatBox [1] Power Levels")
print(bat1store.."/"..bat1cap)
print("")
print("BatBox [2] Power Levels")
print(bat2store.."/"..bat2cap)
end
but the result is that the screen stays blank.
Any suggestions?