Jump to content




books:16: attempt to call nil


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

#1 Mouki

  • New Members
  • 1 posts

Posted 07 April 2014 - 07:17 PM

View PostBomb Bloke, on 01 February 2014 - 08:23 PM, said:


function checkSlots(id)
   clearInv()
   data = {}
   local slot
   for i=1,p.getInventorySize() do
	  slot = p.getStackInSlot(i)
	  if slot then data[i] = slot.destination end
   end
   rednet.send(id,"done")
end


For me, I get this error: books:16: attempt to call nil
What's going on here? I'm running Unleashed 1.1.7

#2 CometWolf

  • Members
  • 1,283 posts

Posted 07 April 2014 - 07:40 PM

wat... Post the full code, and where did you quote this from?

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 07 April 2014 - 07:41 PM

I split this from a topic that was last active in February. It was vaguely related, but not helpful.

#4 Agoldfish

  • Members
  • 451 posts
  • LocationSome Fish Bowl in Ohio.

Posted 07 April 2014 - 09:22 PM

There aren't even 16 lines... ;-;

#5 Bomb Bloke

    Hobbyist Coder

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

Posted 07 April 2014 - 10:35 PM

Thankfully, quotes generally have links back to the original post in context.

The issue turned out to be that people were attempting to use a script Direwolf wrote (which puts a list of Mystcraft book names up on a touch display so you can press them to generate portals) with an older version of OpenPeripheral. Which, due to OpenPeripheral's "special" documentation system... well, there were a few threads springing up about the matter at the time.

That function I wrote was a work-around (written from the perspective of someone who doesn't watch MineCraft YouTube videos nor wanted to install various versions of OpenPeripheral until he found the "right one"), though it'll likely need "slot.destination" replaced with "slot.name" to work (as mentioned in my complete original post).

#6 apemanzilla

  • Members
  • 1,421 posts

Posted 07 April 2014 - 10:51 PM

Sometimes I really wish that Direwolf20 didn't release so many programs that don't have proper error checking and prevention. Would really help cut down on AAP requests.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users