Jump to content




startup: 1: attempt to call nil


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

#1 MrBn100ful

  • New Members
  • 2 posts

Posted 17 May 2015 - 04:54 PM

startup: 1: attempt to call nil

My program

reactor = peripheral.warp("back")
cube = peripheral.warp("left")
actif = reactor.getActive()
maxCube = cube.getMaxEnergy()
while true do
 
  energystore = cube.getStored()
  level = (energystore*100)/maxCube
 
  if actif then
    if level >= 99 then reactor.setActive(false) end
   else
	 if level <= 10 then reactor.setActive(true) end
    end
   
   
    sleep(1)
  end
Thank

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 17 May 2015 - 05:08 PM

The correct spelling is peripheral.wrap, not peripheral.warp.

#3 MrBn100ful

  • New Members
  • 2 posts

Posted 17 May 2015 - 05:18 PM

Thank guy :)

#4 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 22 May 2015 - 12:24 PM

pro tip, always remember to check the spelling in any line that makes an error.

#5 fishermedders

  • Members
  • 31 posts
  • LocationDiscord fishermedders#8254

Posted 22 May 2015 - 05:55 PM

View PostWait_, on 22 May 2015 - 12:24 PM, said:

pro tip, always remember to check the spelling in any line that makes an error.

Very smart to do, and sometimes, there are functions that have the first word's letter lowercase and the second, third, etc in Uppercase. That used to trip me up alot.
Happy Computing!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users