8 posts
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!
1220 posts
Location
Earth orbit
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
8 posts
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 codehttp://daviddog23.imgur.com/all/
Edited on 05 August 2015 - 01:35 AM
1220 posts
Location
Earth orbit
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.
8 posts
Posted 05 August 2015 - 03:44 AM
1220 posts
Location
Earth orbit
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?
8 posts
Posted 05 August 2015 - 03:58 AM
Yes, I do.
3057 posts
Location
United States of America
Posted 05 August 2015 - 03:59 AM
What does this print?
for k, v in pairs( peripheral.getMethods( "top" ) ) do
print( v )
end
8 posts
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 nilI 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
1220 posts
Location
Earth orbit
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