This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
NerdHouse's profile picture

attempt to index ? (a nil value)

Started by NerdHouse, 10 November 2016 - 01:27 PM
NerdHouse #1
Posted 10 November 2016 - 02:27 PM
Hello~

So basically I am setting up a mob farm in FTB CrackPack. I've never made a mob farm before, so I went on YouTube and found a very nice tutorial that utilizes ComputerCraft to control the mob farm.

Using this to program to control the mob farm: http://pastebin.com/qhTZLiKF
Getting this error: https://i.gyazo.com/...b5029caa1fc.png
Followed this video tutorial to the T: https://www.youtube....h?v=5xPHGwJxgP8

The guy in the video didn't get any errors, and I don't see what's wrong with line 44:

mon.setBackgroundColor(defaultBgColor)

Maybe someone else can see it. xD
Thanks for reading!
Dog #2
Posted 10 November 2016 - 04:01 PM
Do you actually have a monitor on top of the computer?
NerdHouse #3
Posted 10 November 2016 - 04:46 PM
Do you actually have a monitor on top of the computer?

No, the computer is on the left of the monitor, and I editted the program to reflect this already.

TheRockettek #4
Posted 10 November 2016 - 06:57 PM
peripheral.wrap("top") means to the computer "the monitor is on the top of the computer" if its on the left, change top to left (or what side the monitor is on)
Exerro #5
Posted 10 November 2016 - 07:09 PM
Unless I've missed something…



Looks like you should be calling `peripheral.wrap( side )` instead.
Edited on 10 November 2016 - 06:10 PM
jakejakey #6
Posted 13 November 2016 - 02:18 PM
The error was because you were calling the monitor function, when a monitor was nonexistant. What you should do instead is

if not mon then
  printError("Please change the monitor side in the program")
  printError("config,  then try again.")
  return
end
Add this to the top, that way you will know if the bug will happen again