Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

IceG4merBR

Members
  • Content Count

    8
  • Joined

  • Last visited

Reputation Activity

  1. Like
    IceG4merBR reacted to Molinko in attemp to index a nil value (local 'i')   
    I believe your error is coming from updateCubeStats().
    cube.stats.stored = cube.getEnergyStored()
    You're missing parentheses.
  2. Like
    IceG4merBR reacted to Molinko in How can i terminate this program?   
    Your program has an infinite loop. You'll need to yield either with sleep or by pulling an event. Here is a simple solution.
    repeat energy = toMRf(cube.getEnergyStored()) energyMax = toMRf(cube.getMaxEnergyStored()) energyJ = toJ(cube.getEnergyStored()) energyMaxJ = toJ(cube.getMaxEnergyStored()) label(1, 1, "%.2f MRf / %.2f MJ (Energia Acumulada)", colors.red, energy, energyJ ) label(1, 3, "%.2f MRf / %.2f MJ (Capacidade da bateria)", colors.lime, energyMax, energyMaxJ) until event.pull(1) == "interrupted" -- # change 1 to something smaller to refresh faster  
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.