x=io.read()
if x == "w" then
n=io.read()
turtle.forward(tonumber(n))
end
problem:- it only goes forward once instead of the told amount of times
help would be appreciated :)/>
x=io.read()
if x == "w" then
n=io.read()
turtle.forward(tonumber(n))
end
x = read()
if x == "w" then
b = read()
turtle.forward(tonumber(B)/>/>)
end
x = read() if x == "w" then
num = read()
for i = 1,tonumber(num) do
turtle.forward()
end
end
x = read()
if x == "w" then
n = read()
for i=1, tonumber(n) do
turtle.forward()
end
end
n = tonumber(read()) or 1 -- default will be 1 move
for i = 1, n do turtle.forward() end
-- etc..
I am what one may call, a 'ninja' :ph34r:/>Lol SuicidalSTDz, nice edit there ;)/> Was just about to quote you :[
Has the turtle got fuel in it?none of these won't work, if you want the code look HERE
i started making a prompt for how many blocks you go forward so i made this:-x=io.read() if x == "w" then n=io.read() turtle.forward(tonumber(n)) end
problem:- it only goes forward once instead of the told amount of times
help would be appreciated :)/>
x=io.read()
if x == "w" then
n=io.read()
for n = n, 0, -1 do
turtle.forward()
end
else
sleep(2)
end
Why not justThis is probably the way i would do it. :)/>x=io.read() if x == "w" then n=io.read() for n = n, 0, -1 do turtle.forward() end else sleep(2) end
local n = tonumber(read())
for i = 1, n do
turtle.forward()
end
instead of your odd and un-required backwards for loop.Why not justThis is probably the way i would do it. :)/>x=io.read() if x == "w" then n=io.read() for n = n, 0, -1 do turtle.forward() end else sleep(2) end
instead of your odd and un-required backwards for loop.local n = tonumber(read()) for i = 1, n do turtle.forward() end
Well considering you're also missing the tonumber, mine would actually work ;)/> :P/>That's also a possibilty, i don't think it would change anything. :D/>
Well considering you're also missing the tonumber, mine would actually work ;)/> :P/>That's also a possibilty, i don't think it would change anything. :D/>
Getting input from the user is returned as a string of characters. For loops require numbers. So using the input of a user at any point in something that requires a number, means you have to call the tonumber function, which converts a string to a number.I don't know why the tonumber is required, explanation please. :)/>
Getting input from the user is returned as a string of characters. For loops require numbers. So using the input of a user at any point in something that requires a number, means you have to call the tonumber function, which converts a string to a number.I don't know why the tonumber is required, explanation please. :)/>