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

Reactor Program Not Working!

Started by Daviddog23, 05 August 2015 - 12:32 AM
Daviddog23 #1
Posted 05 August 2015 - 02:32 AM
I have my reactor, computer, and monitor all connected using wired modems, and they're all red except the computer's (Which is fine) However when my computer tries to use anything to write on my monitor it give me this:

startup:5: attempt to call nil

Here's my peripheral.wrap:


local mon = peripheral.wrap("monitor_19")

That should work, but it doesn't! Help!
Dog #2
Posted 05 August 2015 - 03:18 AM
Well, I have a theory or two, but let's start with seeing your code. Please post your entire code - I'd like to see line 5 and the layout of the code in general. For future reference, please read over this post (especially the sections titled "Posting a Good Question" and "Getting Help Faster") - following those guidelines helps up help you better and faster.
Edited on 05 August 2015 - 01:22 AM
Daviddog23 #3
Posted 05 August 2015 - 03:33 AM
@Dog Okay, Im not sure how to write my entire code here easily, but uhm….

go to this link, and look through the 4 pictures of the code


http://daviddog23.imgur.com/all/
Edited on 05 August 2015 - 01:35 AM
Dog #4
Posted 05 August 2015 - 03:39 AM
Your images aren't publicly available. From within CC, you can use the built in pastebin program (pastebin put FILENAME) - it will return the pastebin code which you can post here.
Daviddog23 #5
Posted 05 August 2015 - 03:44 AM
http://pastebin.com/wMLnPxur
Dog #6
Posted 05 August 2015 - 03:57 AM
In the OP you state that your wrap is
local mon = peripheral.wrap("monitor_19")

but in your code it is
mon = peripheral.wrap("top")

Do you have a monitor on top?
Daviddog23 #7
Posted 05 August 2015 - 03:58 AM
Yes, I do.
KingofGamesYami #8
Posted 05 August 2015 - 03:59 AM
What does this print?


for k, v in pairs( peripheral.getMethods( "top" ) ) do
  print( v )
end
Daviddog23 #9
Posted 05 August 2015 - 04:15 AM
What does this print?


for k, v in pairs( peripheral.getMethods( "top" ) ) do
  print( v )
end

That just gives me another error: test:1: bad argument: table expected, got nil


I was using the wrong computer, Derp. It gave me this

write
scroll
setCursorPos
setCursorBlink
getCursorPos
getSize
clear
clearLine
setTextScale
setTextColour
setTextColor
setBackgroundColour
setBackgroundColor
isColour
isColor
Edited on 05 August 2015 - 02:21 AM
Dog #10
Posted 05 August 2015 - 05:24 AM
Just for kicks…if you're running ComputerCraft 1.6 or newer and you only have one addressable monitor attached, what happens if you replace line 2 with the following…

mon = peripheral.find("monitor")
if not mon then
  print("No monitor found!")
  return
end
Edited on 05 August 2015 - 03:25 AM