12 posts
Posted 18 August 2012 - 08:38 PM
Okey, so i though i was getting good at this…
boy was i wrong xD
okey so i got 2 questions :(/>/>
1: can someone make me a script that does this: go 29 blocks forward while placing blocks under (the turtle.forward turtle.placeDown) or something, but i do not know how to loop correctly… but you'll see that soon
2:
http://prntscr.com/e0h9vwell that's the error :)/>/> tried googelin but nothing …
also here's the code:
http://prntscr.com/e0hao
318 posts
Location
Somewhere on the planet called earth
Posted 18 August 2012 - 08:41 PM
for 1 = 1, 29 do --Idk if this makes it do 30.
turtle.placeUp()
turtle.forward()
end
12 posts
Posted 19 August 2012 - 12:11 AM
WOW FAST reply FTW :(/>/>
anywho seemed to not work ;P but can you explain it?
also the error code:
http://prntscr.com/e0u53
3790 posts
Location
Lincoln, Nebraska
Posted 19 August 2012 - 12:50 AM
You want this instead. sjele was close:
for i = 1,29 do -- yes it will loop until it hits 29
turtle.placeDown()
turtle.forward()
print(i) --will print the number it's at.
end
12 posts
Posted 19 August 2012 - 01:47 AM
Works thx a lot can be closed now :D/>/>
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 19 August 2012 - 06:51 AM
Even though I don't think your watching this, you can use while and have the movement run in a function, like this:
i = 0
function countUpAndMove()
turtle.placeDown()
turtle.forward()
i = i + 1
end
while i >= 29 do
countUpAndMove()
end
it could allow you to have the moving / counting called multiple times by different pieces of code.
12 posts
Posted 19 August 2012 - 07:40 AM
still watching :D/>/>
mhm… seemed like more complex :P/>/>
well i'll try and stick with the easiest ways :P/>/>
997 posts
Location
Wellington, New Zealand
Posted 19 August 2012 - 01:12 PM
By the way, the "__add on nil and number" was because you forgot the space between "local" and "i", so instead you assigned 1 to the variable "locali" (instead of making "i" local and assigning 1 to it)