This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tigerlife's profile picture

Automatic Snowman Idea

Started by Tigerlife, 14 March 2012 - 07:05 PM
Tigerlife #1
Posted 14 March 2012 - 08:05 PM
i thought, if mining turtles can place, why not make them make an army? well i thought that so i created a program called snowman in it. im a new person with lua so me failing was expected. heres what i put in the new program:

go up 1
(place [1])
argument "no item in 1" use 2
argument "no item in 2" use 3
argument "no item in 3" give message:"no items in slots 1, 2, and 3." end
go up 1
(place [4])
argument "no item in 4" use 5
argument "no item in 5" use 6
argument "no item in 6" give message:"no items in slots 4, 5, and 6." end
go up 1
(place[7])
argument "no item in 7" use 8
argument "no item in 8" use 9
argument "no item in 9" give message:"no items in slots 7, 8, and 9." end
go forward 2
go down 3


i failed miserably. if anyone can help, or find a way to fix it, that would help.
Imgoodisher #2
Posted 14 March 2012 - 10:16 PM
that isnt lua… 'go' is not a function. neither is 'argument' or 'give' or '(place)'… the may be programs, but they are not functions. you want something more like this:

turtle.up()
if turtle.getItemCount(1)>1 then turtle.select(1)
elseif turtle.getItemCount(2)>1 then turtle.select(2)
elseif turtle.getItemCount(3)>1 then turtle.select(3)
else print("no items in slots 1, 2, or 3")
turtle.place()
turtle.up()
if turtle.getItemCount(4)>1 then turtle.select(4)
elseif turtle.getItemCount(5)>1 then turtle.select(5)
elseif turtle.getItemCount(6)>1 then turtle.select(6)
else print("no items in slots 4, 5, or 6")
turtle.place()
turtle.up()
if turtle.getItemCount(7)>1 then turtle.select(7)
elseif turtle.getItemCount(8)>1 then turtle.select(8)
elseif turtle.getItemCount(9)>1 then turtle.select(9)
else print("no items in slots 7, 8, or 9")
turtle.place()
for i=1,2 do turtle.forward() end
for i=1,3 do turtle.down() end
wrote this right off the top of my head, no idea if it will acutally work. I suggest you should look up some lua tutorials. Casper made a good one: http://www.computerc...torial-in-game/
also, wrong section. I suggest ask a pro.
Tigerlife #3
Posted 14 March 2012 - 10:51 PM
thank you so much
Tigerlife #4
Posted 15 March 2012 - 12:08 AM
didnt work :D/>/> i even made horrible edits and it didnt work :)/>/>

l ask a pro if i can find one :)/>/>