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

Need Support

Started by Syntron, 03 October 2012 - 07:20 AM
Syntron #1
Posted 03 October 2012 - 09:20 AM
HEy guys, i wrote an script for auto harvesting rubbertrees(IC²).
It works like this: checking for block->using treetap->block up
BUt now i have a problem: the treetap get used up but the turtle just stays on the ground in front of the tree. before i updatet to the newest verson of computercraft it worked just fine(exept the use of the treetap but this was later implemented). Has anybody an idea?

local i = 1
repeat
print(i)
i = i + 1
while turtle.detect() == true do
  turtle.place(1)
  turtle.up()
  turtle.detect()
end
if turtle.detect() == false then
  turtle.turnLeft()
  turtle.forward()
  turtle.turnRight()
  turtle.forward()
  turtle.turnRight()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.detect()
end
until i == 5

cya
Syntron
KaoS #2
Posted 03 October 2012 - 09:24 AM
you need fuel…. latest version of CC makes turtles require fuel to move. either fuel it or disable the fuel requirement in the CC config file
Syntron #3
Posted 03 October 2012 - 09:45 AM
>.< oh right totally forgot about it….
works just perfekt :(/>/>

thx :D/>/>
KaoS #4
Posted 03 October 2012 - 10:08 AM
no problem. I swear this is one of the most common problems lol
Syntron #5
Posted 03 October 2012 - 11:50 AM
@KaoS ist it possible to shorten the code? in my opinion its a bit to long :(/>/>
KaoS #6
Posted 03 October 2012 - 12:17 PM

for i=1,4 do
  local intGone=0
  print('run: '..i)
  turtle.select(1)
  while turtle.detect() do
   turtle.place()
   turtle.up()
   intGone=intGone+1
  end
  turtle.turnLeft()
  turtle.forward()
  turtle.turnRight()
  turtle.forward()
  turtle.turnRight()
  for i=1,intGone do turtle.down() end
end

EDIT: improved code
Edited on 03 October 2012 - 10:19 AM