Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ~monitor do
- monitor=term
- end
- function clear()
- monitor.clear()
- end
- function getSize()
- return monitor.getSize()
- end
- function draw_text(x, y, text, text_color, bg_color)
- monitor.setBackgroundColor(bg_color)
- monitor.setTextColor(text_color)
- monitor.setCursorPos(x,y)
- monitor.write(text)
- end
- function draw_line(x, y, length, color)
- draw_text(x,y,string.rep(" ", length),color,color)
- end
- function progress_bar(x, y, length, minVal, maxVal, bar_color, bg_color)
- draw_line(x, y, length, bg_color) --backgoround bar
- local barSize = math.floor((minVal/maxVal) * length)
- draw_line(x, y, barSize, bar_color) --progress so far
- end
- -- APPLICATION CODE
- statsmeta={}
- stats={}
- modes={}
- statsmeta.fuelstorage="percent"
- statsmeta.test="number"
- statsmeta.other="boolean"
- modes.OFF=function(stats)
- print("test")
- end
- modes.ON=function(stats)
- print("test")
- end
- function updateStats()
- stats.fuelstorage=89
- stats.test=84
- stats.other=true
- end
- while true do
- end
Advertisement
Add Comment
Please, Sign In to add comment