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

bios:337: [string "room"];7; '=' expected

Started by sk8mn, 01 June 2014 - 06:29 AM
sk8mn #1
Posted 01 June 2014 - 08:29 AM
i have created a scrip designed to hollow out a room underground i have only done half and i have encountered an error, line 7 has the command turtle.turnLeft() it is the same format as the res but what am i doing wrong
  • turtle.up()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • tutle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.forward()
  • turtle.forward()
  • turtle.forward()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtleturnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnLeft()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig()
  • turtle.forward()
  • turtle.turnRight()
  • turtle.dig
Edited on 01 June 2014 - 06:30 AM
GamerNebulae #2
Posted 01 June 2014 - 08:35 AM
First things first, next time, paste it inside the code brackets, that is the <> symbol in the text editor or copy it to pastebin. You're missing some () at the end of functions. That is what is wrong. Also, I noticed a few spelling errors. Like turtle.turnRight() is turtle.turRight(). Last but not least, try to compact your code with functions or loops.
sk8mn #3
Posted 01 June 2014 - 08:38 AM
First things first, next time, paste it inside the code brackets, that is the <> symbol in the text editor or copy it to pastebin. You're missing some () at the end of functions. That is what is wrong. Also, I noticed a few spelling errors. Like turtle.turnRight() is turtle.turRight(). Last but not least, try to compact your code with functions or loops.
Yeah i have noticed the spelling errors and not all the code cam over with paste bin but why was it telling me that it expected an = on line 7
Whitecatblack #4
Posted 01 June 2014 - 08:39 AM
Let me just format this code so we can read it first ^_^/> .

Spoiler

turtle.up()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
tutle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtleturnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turRight()
turtle.dig()
turtle.forward()
turtle.turRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig

Well, it looks like on line 6 turtle.dig doesn't have parentheses, it should look like:

turtle.dig()

I also noticed some other errors in other places of the code just from glancing through it, make sure you include the period ( . ) between "turtle" and the function you want it to perform (i.e. turtle.dig() rather than turtledig() )

[Edit] Double sniped

Whitecatblack
Edited on 01 June 2014 - 06:39 AM
sk8mn #5
Posted 01 June 2014 - 08:40 AM
Let me just format this code so we can read it first ^_^/> .

Spoiler

turtle.up()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
tutle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtleturnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turRight()
turtle.dig()
turtle.forward()
turtle.turRight()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig

Well, it looks like on line 6 turtle.dig doesn't have parentheses, it should look like:

turtle.dig()

I also noticed some other errors in other places of the code just from glancing through it, make sure you include the period ( . ) between "turtle" and the function you want it to perform (i.e. turtle.dig() rather than turtledig() )

[Edit] Double sniped

Whitecatblack
is my turtle.turnRight/Left correct tho
Whitecatblack #6
Posted 01 June 2014 - 08:44 AM
sk8mn said:
Yeah i have noticed the spelling errors and not all the code cam over with paste bin but why was it telling me that it expected an = on line 7
So line 6 and 7 read:

turtle.dig
turtle.turnLeft()
The computer thinks that line 6, turtle.dig, is a variable, so it is asking you to set that variable equal to what is on line 7. If you add the parentheses, this problem will fix itself.

Whitecatblack
Edited on 01 June 2014 - 06:44 AM
sk8mn #7
Posted 01 June 2014 - 08:47 AM
sk8mn said:
Yeah i have noticed the spelling errors and not all the code cam over with paste bin but why was it telling me that it expected an = on line 7
So line 6 and 7 read:

turtle.dig
turtle.turnLeft()
The computer thinks that line 6, turtle.dig, is a variable, so it is asking you to set that variable equal to what is on line 7. If you add the parentheses, this problem will fix itself.

Whitecatblack
Would it work if i simply added variables to replace turtle.dig etc so i could compact it to one work a line with dig = turtle.dig() forward = turtle.forward() left = turtle.turnLeft()
Whitecatblack #8
Posted 01 June 2014 - 08:58 AM
sk8mn said:
Would it work if i simply added variables to replace turtle.dig etc so i could compact it to one work a line with dig = turtle.dig() forward = turtle.forward() left = turtle.turnLeft()
Yea, that's the great thing about, well, all coding languages: there are shortcuts. So a variable or a function can be set to any function, so the examples you gave would work. You could even set a function equal to multiple functions, like say that every time you wanted the turtle to move forward, you want it to mine the block in front of it. Well, that can be done:

function Forward()
  turtle.dig()
  turtle.forward()
end
You can even have it only mine the block in front of it if there actually is a block in front of it:

function Forward()
  if turtle.detect() then
    turtle.dig()
  end
  turtle.forward()
end

Whitecatblack
Edited on 01 June 2014 - 07:01 AM