1 posts
Posted 05 April 2013 - 07:49 AM
So, i have OCS i want to do something ilke in this video but…. i am completly lost on how to do it
http://www.youtube.com/watch?v=tftCfDbBBAgI know how to retrive the capacity and amounts of the tank I want but how do I make this graph.
436 posts
Posted 05 April 2013 - 10:27 AM
EDIT:
Ignore anything you might have read here before. I'd ask this particular reply removed, but it would be a waste, because I might have some help in a moment.
8543 posts
Posted 05 April 2013 - 12:31 PM
You could PM Mikeemoo on these forums and ask if he has the source handy. Otherwise, it's a pretty simple matter of using the tank's capacity and amount values as well as the screen size to determine how many lines to color whatever color you choose.
2217 posts
Location
3232235883
Posted 05 April 2013 - 04:10 PM
you have to use some weird maths and for loops, basically you do this:
-- insert term.redirect somewhere
local Mx,My=term.getSize()
local graph_height=math.floor(My*(liquid/max_liquid))
rendering the graph itself sould be pretty easy
8543 posts
Posted 06 April 2013 - 06:31 AM
Ideally, one should use `amount * maxY / capacity`.