10 posts
Posted 02 June 2015 - 03:01 PM
Im relatively new to CC and I try to get some programs, this is more or less my first.
The purpose of the program is to place a variable amout of blocks in the shape of a rectangle.
I know that the autorefill is not in there, but my problem right now is, that it turns itself around on the same block or that it builds an interesting construct, but either way it doesnt work right.
local arg1,arg2,arg3,arg4 = ...
write "length="
print (arg1)
write "width="
print (arg2)
write "height="
print (arg3)
fwdvar = tonumber(arg1)
sdevar = tonumber(arg2)
hgtvar = tonumber(arg3)
hgt = 0
while hgt < hgtvar do
fwd = 1
while fwd < fwdvar do
turtle.select(5)
turtle.placeDown()
turtle.forward()
fwd = fwd + 1
end
turtle.turnRight()
sde = 1
while sde < sdevar do
turtle.placeDown()
turtle.forward()
sde = sde + 1
end
turtle.turnRight()
fwd = 1
while fwd < fwdvar do
turtle.placeDown()
turtle.forward()
fwd = fwd + 1
end
turtle.turnRight()
sde = 1
while sde < sdevar do
turtle.placeDown()
turtle.forward()
sde = sde + 1
end
turtle.up()
turtle.turnRight()
hgtvar = hgtvar +1
end
(sorry,if there is a spoiler thing, I cant find it)
~ malleusmintaka
2427 posts
Location
UK
Posted 02 June 2015 - 03:40 PM
What do you mean by "doesn't work right"?
Describe what it does that you think isn't correct.
3057 posts
Location
United States of America
Posted 02 June 2015 - 04:02 PM
You may want to look into for loops. They make this sort of thing much easier.
Aside from that, a picture of what it does do vs what you want it to do would be helpful.
10 posts
Posted 02 June 2015 - 05:51 PM
it rotates at this block the whole time, the other thing I cant recreate
@KingofGamesYami Where exactly would you place a loop?
656 posts
Posted 02 June 2015 - 06:46 PM
Does your turtle have fuel?
10 posts
Posted 02 June 2015 - 06:57 PM
I pla with FTB Ulti, dont know the CC version, but i dont need fuels there afaik
656 posts
Posted 02 June 2015 - 06:59 PM
Try typing this into your turtle:
> lua
> turtle.forward()
Does the turtle go forward?
10 posts
Posted 02 June 2015 - 07:11 PM
nop. it returns false
45 posts
Location
IA, USA
Posted 02 June 2015 - 07:39 PM
Then you need fuel
Put something you can burn in the turtles inventorty like coal and then type refuel or in a program or Command Prompt call turtle.refuel(Amount)
10 posts
Posted 02 June 2015 - 07:51 PM
But why did it work withotu fuel then?
1080 posts
Location
In the Matrix
Posted 02 June 2015 - 07:56 PM
Try typing this instead. Because I'm not so sure you do need fuel. Since the lua prompt didn't say that you needed fuel and only said false.
lua
turtle.getFuelLevel()
Say what that tells you
10 posts
Posted 02 June 2015 - 08:01 PM
it tells me 0, before i needed no fuel though
1080 posts
Location
In the Matrix
Posted 02 June 2015 - 08:08 PM
Server probably changed the config then. Since it does say 0, then you do need fuel. Get something that you can put in a furnace for fuel and put it in the turtle, and then type refuel.
10 posts
Posted 02 June 2015 - 08:15 PM
well, now it just places the first row of blocks :/
7083 posts
Location
Tasmania (AU)
Posted 03 June 2015 - 12:43 AM
And then what does it do? Run out of blocks to place?
10 posts
Posted 03 June 2015 - 11:48 AM
no, it runs arond crazy, but could fix it, it works now, thanks for the help!