This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Q:How do I make a turtle accutly work?
Started by Zambonie, 26 December 2012 - 08:52 AMPosted 26 December 2012 - 09:52 AM
So,I have been trying a couple of times,from youtube,wikis and others to make my turtle make a house.And it never worked.So,does anyone know any answers.Somthing maybe were you could explain?
Posted 26 December 2012 - 12:43 PM
Ok,so wnet to the movies and I came back with no replies.Wow :/
Posted 26 December 2012 - 12:47 PM
What exactly is your problem? Have you made any code at all?
Posted 26 December 2012 - 12:47 PM
Post the code that you were using that is not working and we'll help you figure out whats wrong.
Posted 26 December 2012 - 12:57 PM
Ya,I dont have the code,because everythink justs gets messed up.So Ijsut keep deleting them,but can really someone just maybe explain the code?
Posted 26 December 2012 - 01:02 PM
Accutly,heres a little example code.I dont know what im doing wrong or something,but her it is:
Ok,so?
while true do
print("Making an house!")
turtle.foward("3")
Ok,so?
Posted 26 December 2012 - 01:03 PM
Edit:I forgot to put the end there,it was already in the original code,just forgot it there :/
Posted 26 December 2012 - 01:04 PM
We help with the code you've already got, we don't write it for you.
Posted 26 December 2012 - 01:05 PM
Oh and I forgot,my problem is that it will mine,just not move…
Posted 26 December 2012 - 01:26 PM
Did you give it fuel?
Posted 26 December 2012 - 01:26 PM
If your turtle isn't moving, then it probably needs to be refuelled.
Regarding the code you posted, on line 3 you pass a string as a parameter to turtle.forward, which accepts no parameters and will consequently have no effect. To move your turtle forward 3 spaces you will need to call turtle.forward 3 times. For any house making routine, you'll probably not want to keep the turtle moving forever so the while true loop encapsulating your code seems unnecessary. A while loop with an iterator, or a repeat/for loop would be more appropriate.
More generally, I'll infer you're very new to programming and to lua, which is cool, everyone has to start somewhere, but before you start asking technical questions about code you'll probably need a firmer grip on the basics. I'd recommend getting more familiar with lua as well as the CC-specific API's and come up with some concrete code- people on the forums will then be in a much better position to help you.
Regarding the code you posted, on line 3 you pass a string as a parameter to turtle.forward, which accepts no parameters and will consequently have no effect. To move your turtle forward 3 spaces you will need to call turtle.forward 3 times. For any house making routine, you'll probably not want to keep the turtle moving forever so the while true loop encapsulating your code seems unnecessary. A while loop with an iterator, or a repeat/for loop would be more appropriate.
More generally, I'll infer you're very new to programming and to lua, which is cool, everyone has to start somewhere, but before you start asking technical questions about code you'll probably need a firmer grip on the basics. I'd recommend getting more familiar with lua as well as the CC-specific API's and come up with some concrete code- people on the forums will then be in a much better position to help you.
Posted 26 December 2012 - 02:29 PM
If a particular program you found posted on the forums doesn't work, post your specific problem in the thread for that program.
If none of them work, then the problem isn't with the programs. The problem is you're doing something wrong. In this case, most likely what nitrogenfingers said.
If none of them work, then the problem isn't with the programs. The problem is you're doing something wrong. In this case, most likely what nitrogenfingers said.