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

Remote Turtle- Lumberjack

Started by Traffic_Warden, 28 March 2012 - 05:25 PM
Traffic_Warden #1
Posted 28 March 2012 - 07:25 PM
Hi,

I'm new to CC, and wondered if it's possible to control a turtle from a nearby computer.

I'm trying to make a lumberjack program and then link it to the computer to control where the turtle goes, as i don't want to destroy the turtle and replace it all the time, and go and find it :o/>/>

I could type "home" or something and it will go back to the start position and then i can type "Start" and it will start chopping :o/>/>

trees are 3x3 apart in long rows like this (x marks saplings, - marks 1 block free space.)

x–x–x–x–x–x–x
——————–
——————–
x–x–x–x–x–x–x
——————–
——————–
x–x–x–x–x–x–x

Thanks
Liraal #2
Posted 28 March 2012 - 07:30 PM
there are all kinds of scripts for remote control. But you would need only something like:

while true do
lumberjack() --or whatever function you use for tree coppping
local a,b=rednet.receive()
if b=="home" then
home() --or any other function to make it go home
end
if b=="next" then nextrow() end
end
Traffic_Warden #3
Posted 28 March 2012 - 07:47 PM
Hi, as I say, I'm new to all this, how will the turtle know what next-row is etc, I would need to know how to tell it this, as i don't know the correct commands

How would i go about setting the computer up to send/receive info from the turtle?

Many thanks
Liraal #4
Posted 28 March 2012 - 07:51 PM
next row can be set like

function nextrow()
turtle.turnLeft()
turtle.forward() turtle.forward() turtle.forward()
turtle.turnRight()
turtle.back() turtle.back() turtle.back() turtle.back() turtle.back()
return true
end
which goes 3 blocks left and then 4 back

and a computer receiver would look like

while true do
print(rednet.receive())
end