13 posts
Posted 29 March 2012 - 04:46 AM
This is a brand new program that I made for a member on my server to install into his TurtleOS thing… I thought it was pretty neat so I would like to share with the rest of the ComputerCraft Communty.
Spoiler
–Bridge Creator/Destroyer :o/>/>
–Made By: EricRandom1023
–If Distributed Please Give Me Credit!
–I do not mind if you change anything.
function termClear()
term.clear()
term.setCursorPos(1,1)
end
function countItems()
s1 = turtle.getItemCount(1)
s2 = turtle.getItemCount(2)
s3 = turtle.getItemCount(3)
s4 = turtle.getItemCount(4)
s5 = turtle.getItemCount(5)
s6 = turtle.getItemCount(6)
s7 = turtle.getItemCount(7)
s8 = turtle.getItemCount(8)
s9 = turtle.getItemCount(9)
nItem = s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9
end
termClear()
countItems()
fx = nItem
repeat
turtle.placeDown()
turtle.forward()
until turtle.detectDown() == true
countItems()
sx = nItem
px = fx - sx
repeat
term.clear()
term.setCursorPos(1,1)
write("Used "..px.." blocks.\nBreak?\n")
x = read()
until x == "yes"
turtle.turnRight()
turtle.turnRight()
turtle.forward()
repeat
turtle.digDown()
turtle.forward()
px = px - 1
until px == 0
termClear()
write("Bridge Successfully Destroyed")
sleep(2)
termClear()
If there are any errors let me know… This is actually quite simple so you should be able to make it awesome :o/>/> just felt like throwin the idea out there.
74 posts
Location
Australia
Posted 29 March 2012 - 04:52 AM
cool your server still online?
74 posts
Location
Australia
Posted 29 March 2012 - 05:23 AM
doesnt work mate i don't see whats wrong with it….
718 posts
Location
Hawaii
Posted 29 March 2012 - 05:54 AM
This is a brand new program that I made for a member on my server to install into his TurtleOS thing… I thought it was pretty neat so I would like to share with the rest of the ComputerCraft Communty.
Spoiler
–Bridge Creator/Destroyer :o/>/>
–Made By: EricRandom1023
–If Distributed Please Give Me Credit!
–I do not mind if you change anything.
function termClear()
term.clear()
term.setCursorPos(1,1)
end
function countItems()
s1 = turtle.getItemCount(1)
s2 = turtle.getItemCount(2)
s3 = turtle.getItemCount(3)
s4 = turtle.getItemCount(4)
s5 = turtle.getItemCount(5)
s6 = turtle.getItemCount(6)
s7 = turtle.getItemCount(7)
s8 = turtle.getItemCount(8)
s9 = turtle.getItemCount(9)
nItem = s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9
end
termClear()
countItems()
fx = nItem
repeat
turtle.placeDown()
turtle.forward()
until turtle.detectDown() == true
countItems()
sx = nItem
px = fx - sx
repeat
term.clear()
term.setCursorPos(1,1)
write("Used "..px.." blocks.nBreak?n")
x = read()
until x == "yes"
turtle.turnRight()
turtle.turnRight()
turtle.forward()
repeat
turtle.digDown()
turtle.forward()
px = px - 1
until px == 0
termClear()
write("Bridge Successfully Destroyed")
sleep(2)
termClear()
If there are any errors let me know… This is actually quite simple so you should be able to make it awesome :o/>/> just felt like throwin the idea out there.
Cool program
–xXm0dzXx
124 posts
Location
Liverpool (no I am not a Scouser Im form Holland)
Posted 29 March 2012 - 08:05 AM
hamish did you put blocks in it?
13 posts
Posted 30 March 2012 - 03:27 AM
the script works you just need blocks in the turtle… if you make sure you copied it right it sho
doesnt work mate i don't see whats wrong with it….
Make sure that you have copied the code correctly. I don't know about you but sometimes the copy paste doesn't always work right from forums for me. If you don't find the error please post the error code/line thing and I'll see whats up. :o/>/>
113 posts
Posted 11 April 2012 - 12:50 AM
You need to put periods in between term and clear() like term.clear() .
474 posts
Posted 11 April 2012 - 01:09 AM
You need to put periods in between term and clear() like term.clear() .
Nope, he has a function called termClear()
14 posts
Posted 17 April 2012 - 07:21 PM
Right-off the bat I noticed
countItems should look more like:
function countItems()
local nItem = { turtle.getItemCount(1) }
for i=2,9 do
nItem = table.insert( nItem, turtle.getItemCount(i) )
end
return nItem
end
I'll try to revise more tonight, but here's another thing…
while !turtle.detectDown() do
turtle.placeDown()
turtle.forward()
end