Hi! I am very very new to LUA! and Computer Craft. I Tried to make a turtle That Go's turns and comes back. But it wont Move. its all fueled up too.
Heres the Code i wrote.
function Dig()
turtle.dig()
end
function Move()
for i = 1, 30 do
if not turtle.forward() then
Dig()
end
end
function turn()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end
end
0
Wont Move!
Started by yuvrajkhosa, Aug 06 2015 02:42 AM
2 replies to this topic
#1
Posted 06 August 2015 - 02:42 AM
#2
Posted 06 August 2015 - 06:40 AM
Know how you've got a "Dig()" function, which is called by "Move()"? The question is - where do you call "Move()"?
You've also got your "turn()" function declaration sitting inside the "Move()" declaration.
You've also got your "turn()" function declaration sitting inside the "Move()" declaration.
#3
Posted 06 August 2015 - 08:43 AM
Try this:
-- Functions function Move() for i = 1, 30 do if not turtle.forward() then turtle.dig() end end end function turn() turtle.turnRight() turtle.forward() turtle.turnRight() end -- Programm Move() turn() Move()
Edited by LuckyLuke, 06 August 2015 - 08:45 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users