Jump to content




Making a RFTools Power monitor



4 replies to this topic

#1 ravensniper72

  • Members
  • 12 posts
  • LocationCanada

Posted 11 December 2020 - 10:05 AM

I'm trying to make a live energy display for my rf tools power cells.
I can get it to display the current amount but I am still new to CC and would love to learn how to make it functional.

This is what I have so far

https://pastebin.com/dHng9S6B

Edited by ravensniper72, 11 December 2020 - 11:17 AM.


#2 Lupus590

  • Members
  • 2,025 posts
  • LocationUK

Posted 11 December 2020 - 04:46 PM

You probably need to move the getEnergy call into the while loop. That's how it usually works with those kinds of peripherals.

#3 ravensniper72

  • Members
  • 12 posts
  • LocationCanada

Posted 11 December 2020 - 11:13 PM

ok So this is what I have now and I am having it display like this. But I want it to be whole numbers instead of infinite decimals.

https://pastebin.com/hGrmrxmE

https://ibb.co/ww4tskV

#4 Lupus590

  • Members
  • 2,025 posts
  • LocationUK

Posted 11 December 2020 - 11:47 PM

niceNumber = math.floor(uglyNumber) should do the trick

Edited by Lupus590, 11 December 2020 - 11:47 PM.


#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,464 posts

Posted 13 December 2020 - 05:46 PM

Moved to Ask a Pro.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users