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

bios:206: [string "nuke"]:30: '=' expected

Started by Charles, 24 May 2012 - 08:19 PM
Charles #1
Posted 24 May 2012 - 10:19 PM
Hi I'm trying to make a program that places the block in slot 1 (A nuke), move to the block next to it, place a redstone torch (to set it off), and go back to start. I get the error (stated in title) every time i run it. Can someone tell me whats wrong?


turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.select(1)
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.select(2)
turtle.place()
turtle.turnLeft()
turtle.forward
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
print ("Boom")
Imgoodisher #2
Posted 24 May 2012 - 10:21 PM
easy fix

turtle.forward
should be

turtle.forward()
you forgot the ()

Also, just a tip. if you dont want to write turtle.forward() 20 times you can just use a for loop

for i=1, 20 do
turtle.forward()
end
that will repeat turtle.forward() 20 times
Charles #3
Posted 24 May 2012 - 10:47 PM
Thanks! Now I can Nuke people with computers :)/>/>
PixelToast #4
Posted 25 May 2012 - 12:12 AM
and you dont need to place a torch, you can just output redstone directly by using:
rs.setOutput("front",true)