This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
qwerty's profile picture

making fill-up bars

Started by qwerty, 22 November 2018 - 09:51 PM
qwerty #1
Posted 22 November 2018 - 10:51 PM
Hi everyone!

I'm working on a program ment to controll a reactor, but I'm stuck on the full-up bar part.
I can't seem to get it working on almost any level so I'd apreciate some help!
I just want to implement a 48x3 fill-up bar filling from left to right based on a percentage, and that's realy where i'm struggeling because, what ever arithmetics i've tried i fail.
I realy only need the part where i can devide the 48 by a percentage.

With regards,
Qwerty.
Bomb Bloke #2
Posted 23 November 2018 - 12:17 AM
I realy only need the part where i can devide the 48 by a percentage.

Easier to multiply 48 by a percentage.

current value / maximum value * 48
qwerty #3
Posted 23 November 2018 - 01:27 AM
I realy only need the part where i can devide the 48 by a percentage.
Easier to multiply 48 by a percentage.
current value / maximum value * 48
thanks!