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

Basic Movement

Started by Sorcelator, 08 April 2013 - 10:15 AM
Sorcelator #1
Posted 08 April 2013 - 12:15 PM
I've been reading over the Wiki and the forums here and I can't seem to get my Turtles to just do a basic action like Move. Our server does not require turtles to be fueled so I know that is not the issue.

My basic code is this:
while turtle.detectDown() do
  turtle.forward()
end


I'm really confused. I can get it to Turn however. That same code works just fine if I replace turtle.forward with turtle.turnLeft it will turn left forever until I ctrl+t the program. So what am I missing? Is the server configured to not allow move commands? When I go in to the API Mode and do any turtle move commands it returns false.
SadKingBilly #2
Posted 08 April 2013 - 12:26 PM
I have no idea. Have you asked the server admin why it's not working?
Sorcelator #3
Posted 08 April 2013 - 12:34 PM
I have no idea. Have you asked the server admin why it's not working?

Yeah I just sent him a message to see if thats the case.
SuicidalSTDz #4
Posted 08 April 2013 - 12:34 PM
I'm going to go out on a limb and ask you this:

Is there a block underneath the turtle?
Bubba #5
Posted 08 April 2013 - 01:03 PM
I'm going to go out on a limb and ask you this:

Is there a block underneath the turtle?

He says he can replace turtle.forward() with turtle.turnLeft() and it works. So there must be.

My guess is fuel. I know you said that fuel is not enabled, but give it a go anyway. This sounds consistent with that issue, and if you have never managed to get it to go forward then it probably does need fuel.

Otherwise I can think of only two reasons it would not go forward:
1) It is not on top of a block
2) There is a block preventing it from moving or you are standing front of it.

The code itself is perfectly valid.
Sammich Lord #6
Posted 08 April 2013 - 01:08 PM
The only thing I can think of is either fuel is actually enabled or there is block protection.
The turtle could be in a region that is protected which is preventing the turtle from moving. But that is the only thing I can think of.
SuicidalSTDz #7
Posted 08 April 2013 - 01:12 PM
He says he can replace turtle.forward() with turtle.turnLeft() and it works. So there must be.
Pfft, you never know :P/> Turtles have a mind of their own ^_^/>
Bubba #8
Posted 08 April 2013 - 01:14 PM
He says he can replace turtle.forward() with turtle.turnLeft() and it works. So there must be.
Pfft, you never know :P/> Turtles have a mind of their own ^_^/>

Last time I checked mine all had a conspicuous lack of AI. So unless Dan/Cloudy have added that in extremely recently then I doubt it :P/>
SadKingBilly #9
Posted 08 April 2013 - 01:24 PM
He says he can replace turtle.forward() with turtle.turnLeft() and it works. So there must be.
Pfft, you never know :P/> Turtles have a mind of their own ^_^/>

Last time I checked mine all had a conspicuous lack of AI. So unless Dan/Cloudy have added that in extremely recently then I doubt it :P/>
Cloudy would just make turtles print "No." repeatedly.
Bubba #10
Posted 08 April 2013 - 01:28 PM
He says he can replace turtle.forward() with turtle.turnLeft() and it works. So there must be.
Pfft, you never know :P/> Turtles have a mind of their own ^_^/>

Last time I checked mine all had a conspicuous lack of AI. So unless Dan/Cloudy have added that in extremely recently then I doubt it :P/>
Cloudy would just make turtles print "No." repeatedly.


> turtle.forward()
No
> turtle.turnRight() --Please?
No
> turtle.digDown() --Come on...
No
> turtle.implode() --
... No.
> print("No")
Certainly not.
Sorcelator #11
Posted 08 April 2013 - 02:42 PM
So I put some Coal in the first slot in its inventory, then did lua > turtle.forward() and it returned "false"
Then I put coal in every slot in its inventory, then did the same command and got "false"
Bubba #12
Posted 08 April 2013 - 02:45 PM
So I put some Coal in the first slot in its inventory, then did lua > turtle.forward() and it returned "false"
Then I put coal in every slot in its inventory, then did the same command and got "false"

You need to actually make it refuel. Putting fuel into the inventory does nothing.
Add something like this to the top of the program.

turtle.select(2) --Or slot with fuel
turtle.refuel()
turtle.select(1) --Reset to the first slot
SadKingBilly #13
Posted 08 April 2013 - 02:48 PM
Did you try fueling it, though? Putting coal in a turtle's inventory ~= fueling it. You have to call turtle.refuel().

EDIT: Bubba beat me to the punch, just ignore me.
SuicidalSTDz #14
Posted 08 April 2013 - 02:49 PM
Or just enter into the command line interface:

refuel all
Sorcelator #15
Posted 08 April 2013 - 04:04 PM
Or just enter into the command line interface:

refuel all

UHG i feel dumb. Thank you! That was what I was missing. None of the Wiki posts really explained how Fueling worked so I never knew about that command.
SuicidalSTDz #16
Posted 08 April 2013 - 04:37 PM
Or just enter into the command line interface:

refuel all

UHG i feel dumb. Thank you! That was what I was missing. None of the Wiki posts really explained how Fueling worked so I never knew about that command.
Ok, I am going to update the wiki right now. This has been discussed several times and I thought someone would have taken it upon themselves to do so.

*SuicidalSTDz furiously heads over to the wiki*