Posted 22 March 2014 - 01:30 AM
Hello,
I'm currently playing the ftb direwolf20 pack and experimenting with turtles. I've made programs for normal cComputers but never turtles.
Basically, in the pack you can get an item called an Ender Quarry. It's ideal for servers because it replaces blocks with dirt as opposed to leaving a massive hole.
The quarry uses a square fence boundary when setting up and only loads the chunk it's mining in.
I'm making a program for the turtle to place this fence for me.
So it ask's for the size and multiplies it by 4 (for square) and I wanted it to detect how many fences it needed as a result.
I can't find anything in the API relating to checking the inventory for certain ID's
Eg. user enters a boundary of 64, turtle needs 256 fence blocks.
Turtle checks inventory, if blocks are there, proceed.
Else, alert user and pause/cancel.
Code attached for context. It does need commenting and cleaning up I am aware. Plus I need to play with the boundary calculation so it doesn't place excess.
Any help would be greatly appreciated, thank you.
I'm currently playing the ftb direwolf20 pack and experimenting with turtles. I've made programs for normal cComputers but never turtles.
Basically, in the pack you can get an item called an Ender Quarry. It's ideal for servers because it replaces blocks with dirt as opposed to leaving a massive hole.
The quarry uses a square fence boundary when setting up and only loads the chunk it's mining in.
I'm making a program for the turtle to place this fence for me.
So it ask's for the size and multiplies it by 4 (for square) and I wanted it to detect how many fences it needed as a result.
I can't find anything in the API relating to checking the inventory for certain ID's
Eg. user enters a boundary of 64, turtle needs 256 fence blocks.
Turtle checks inventory, if blocks are there, proceed.
Else, alert user and pause/cancel.
Code attached for context. It does need commenting and cleaning up I am aware. Plus I need to play with the boundary calculation so it doesn't place excess.
Any help would be greatly appreciated, thank you.
print("How big you want yer quarry?")
local size = read()
size = size * 4
local count = size
cFence(count)
function cFence()
while true do
print(count)
turtle.dig()
turtle.digDown()
turtle.select(2)
turtle.placeDown()
if count == 0 then
break
else
count = count - 1
end
end
end