Jump to content




OpenCCSensors and Tanks


  • You cannot reply to this topic
4 replies to this topic

#1 crameep

  • New Members
  • 1 posts

Posted 05 April 2013 - 06: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




I know how to retrive the capacity and amounts of the tank I want but how do I make this graph.

#2 OmegaVest

  • Members
  • 436 posts

Posted 05 April 2013 - 09: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.

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 05 April 2013 - 11:31 AM

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.

#4 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 05 April 2013 - 03: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

#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 April 2013 - 05:31 AM

Ideally, one should use `amount * maxY / capacity`.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users