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

Help with Coding a program for mining turtles to place ender chests when inv. is full.

Started by JakeTheSnakeMC, 22 March 2013 - 08:40 AM
JakeTheSnakeMC #1
Posted 22 March 2013 - 09:40 AM
So I've been trying to code a mining program, that allows a turtle to place an ender chest and dump it's inventory into it. So far, this is what I've got: http://pastebin.com/sJZc3gc4. The problem that is occurring is as follows: bios:338 [string "mine"]:18: '=' expected. I have tried to fix the problem, but nothing seems to work. If someone could tell me how to fix it, or fix it on there own that'd be great :)/>

Thanks, Jake.
Lyqyd #2
Posted 22 March 2013 - 10:02 AM
Split into new topic.

`turtle.forward` needs to be `turtle.forward()`.
JakeTheSnakeMC #3
Posted 22 March 2013 - 11:42 AM
Alright, so, after doing that, I've made it so it should be a 2x2x2 mine, but I am getting this error for line 14: bios:338 [string "mine"]:14: '=' expected. It is the same problem, but line 14 is a "end" line. I'm probably missing something crucial for this to work, but I'm at a loss… again.
Lyqyd #4
Posted 23 March 2013 - 05:53 AM
We aren't psychic. You'll have to post the updated code for us to find the new problem.
JakeTheSnakeMC #5
Posted 23 March 2013 - 03:21 PM
Oh darn, I must have forgotten. Very sorry. http://pastebin.com/H5si9vsM. The error I'm getting now is: bios:338: [strin "mine"]:15: '=' expected. Sorry for being a idiot and forgetting to link the code.
LazyBoot #6
Posted 04 April 2013 - 12:45 AM
It seems you're ending the for loop on line 10, and the "end" on line 13 had nothing to end…
Telokis #7
Posted 04 April 2013 - 03:21 AM
There are several "end" which make no sense in your code.
You probably should remove these on lines 10, 13, 22, 25, 34, 37 and 46.
You need to keep the one on line 49 because your for loop has to be ended.

If you indented your code you would have seen that there were too many "end".
PixelToast #8
Posted 04 April 2013 - 05:10 AM
i fixed some issues
Edited on 04 April 2013 - 04:30 AM
Telokis #9
Posted 04 April 2013 - 05:21 AM

I'm not sure this will do what he expected. I think he wanted a pattern like this :


while a < length do
  turtle.dig()
  turtle.digUp()
  turtle.forward()
  turtle.turnRight()

  turtle.dig()
  turtle.digUp()
  turtle.forward()
  turtle.turnLeft()

  turtle.dig()
  turtle.digUp()
  turtle.forward()
  turtle.turnLeft()

  turtle.dig()
  turtle.digUp()
  turtle.turnRight()
end

So it digs a 2x2xlength tunnel

EDIT :
This pattern will dig a tunnel with a length of 2 * length, I think