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

Function Error

Started by Cukee8, 24 July 2013 - 11:21 AM
Cukee8 #1
Posted 24 July 2013 - 01:21 PM
I am writing a program that will place blocks.

I wanted to make functions for each block, so to place Cobble I could just type Cobble instead of the whole thing.

So I came up with this function:

function Cobble
turtle.select(1)
turtle.placeDown()
end

When I did this, I got an error called

bios:337 [string:"room"]:2: '(' expected

so I put a ( in front of the 2nd line, and this error came up:

bios:337 [string:"room"]:2: ')' expected

and every time and place I put in a ) , the same error popped up!

please help me by replying and/or emailing the answer to Cukee8@gmail.com

- Cukee8
Lyqyd #2
Posted 24 July 2013 - 02:09 PM
Split into new topic.


function Cobble()

It wanted the parentheses there. It didn't find them there, and was still looking for them when it got to the second line, where it found something else, so that's where it threw the error.