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

For Problems(I think)

Started by kevin105008, 18 March 2014 - 10:15 AM
kevin105008 #1
Posted 18 March 2014 - 11:15 AM
I am having some difficulty with my code, and I believe it's the for loop. I'm new to lua but I know several other languages, so any help would be great, thanks.
Code:
  • while true do
  • rednet.open("right")
  • local id, msg = rednet.receive()
  • if msg == ("mine") then
  • turtle.select(1)
  • turtle.place()
  • sleep(7)
  • for i = 1..10 do
  • turtle.select(i)
  • turtle.drop()
  • end
  • turtle.select(1)
  • turtle.dig()
  • end
  • end
Lyqyd #2
Posted 18 March 2014 - 02:26 PM
Your for loop should start with this:


for i = 1, 10 do
apemanzilla #3
Posted 18 March 2014 - 03:32 PM
What Lyqyd said. Also, code you wrap code inside
 tags or a spoiler next time?
kevin105008 #4
Posted 18 March 2014 - 07:01 PM
Thanks, im kinda new to this, so any help is greatly appreciated