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

Can someone help me out with this?

Started by 007Nick700, 26 December 2012 - 10:25 AM
007Nick700 #1
Posted 26 December 2012 - 11:25 AM
Hello first of all. My favorite mod is redpower and I started to like computercraft aswell lately. Unfortunatly I'm not really an expert with coding, and I've made this small program but when I try to run it, it says "Attempt to call nil" I don't really know what that means and/or how to fix it. Me and a friend of mine set up a server together with houses close to eachother but with a pretty big gap inbetween. I made a retractable bridge using redpower and wanted to activate it using computercraft.
And this is what I came up with:

redstone.setOutput("back",true)
mon = peripheral.wrap("left)
mon.clear()
mon.setTextscale(1)
mon.setCursorpos(1,1)
mon.write("Bridge extracting…")
sleep(10)
mon.clear()
mon.setTextscale(1)
mon.setCursorpos(1,1)
mon.write("Bridge extracted")
redstone.setOutput("back",false)

Thanks in advance and excuse me if this is in the wrong discussion.
rhyleymaster #2
Posted 26 December 2012 - 11:26 AM
instead of mon, use term.

ie.
term.clear()

Also. its write("") not mon.write.
AndreWalia #3
Posted 26 December 2012 - 11:32 AM
 
redstone.setOutput("back",true)
mon = peripheral.wrap("left")
mon.clear()
mon.setTextScale(1)
mon.setCursorPos(1,1)
mon.write("Bridge extracting...")
sleep(10)
mon.clear()
mon.setTextscale(1)
mon.setCursorpos(1,1)
mon.write("Bridge extracted")
redstone.setOutput("back",false) 
You forgot a few "'s and capital letters like mon.setTextscale(1) should be mon.setTextScale(1)
NDFJay #4
Posted 26 December 2012 - 11:34 AM
Also wrong place, should be in ask a pro
007Nick700 #5
Posted 26 December 2012 - 11:43 AM
Thanks a ton both of you! Also I'll remember to post in the right section then for next time.
Lyqyd #6
Posted 26 December 2012 - 01:10 PM
instead of mon, use term.

ie.
term.clear()

Also. its write("") not mon.write.

Please don't attempt to answer questions when you don't understand the code involved.