Jump to content




[Automatic EnergyCell refill] I need a fresh eye here.


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

#1 plazter

  • Members
  • 134 posts

Posted 08 December 2013 - 01:32 PM

Automatic Energy Cell refilling system

Hello out there! ;)
So.. i made this code for a friend yesterday, and it didnt really work out as it was suppose to do, so i began to make a new, but i keep hitting the same wall, i've tryed to walk around to issue by saying it to do it in another way..

the code is simple enough:p
Spoiler

i get the error message: Attempt to compare number with string expected, got string

Please help me out here.. i dont understand it since i would mean it's simple enough and should work just fine?

Regards Plazter

Edited by plazter, 08 December 2013 - 01:34 PM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 December 2013 - 02:19 AM

Beats me as to why, but wrapping a redstone energy cell and running "type(c.getEnergyStored())" indeed returns "string". "c.getMaxEnergyStored()" gives a number (as one would expect).

Using the term "tonumber(c.getEnergyStored())" should do the trick.

#3 plazter

  • Members
  • 134 posts

Posted 15 December 2013 - 11:45 AM

View PostBomb Bloke, on 09 December 2013 - 02:19 AM, said:

Beats me as to why, but wrapping a redstone energy cell and running "type(c.getEnergyStored())" indeed returns "string". "c.getMaxEnergyStored()" gives a number (as one would expect).

Using the term "tonumber(c.getEnergyStored())" should do the trick.

Tryed aswell, same error .. got it working but not really reacting :P





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users