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

Botania Orechid automation script not working?

Started by Braxbro, 11 March 2017 - 01:04 PM
Braxbro #1
Posted 11 March 2017 - 02:04 PM
I made a script for automating the Orechid from Botania, but it doesn't do anything.


local stone = 1
rs.setAnalogOutput("top",15)
while true do
turtle.select(stone)
while turtle.getItemCount() > 1 do
turtle.place()
while turtle.compare() = false do
sleep(1)
end
turtle.dig()
end
rs.setOutput("top",true)
while turtle.getItemCount() < 64 do
sleep(1)
end
rs.setOutput("top",false)
end

The error it provides is:


bios:14: [string "ore"]:7: "do" expected
The Higher Realm #2
Posted 11 March 2017 - 07:25 PM
On line 7 you have:

while turtle.compare() = false do

You're missing another equal sign. Two equal signs compare, one sets the value.
You should also indent your code.


local stone = 1
rs.setAnalogOutput("top",15)
while true do
  turtle.select(stone)
  while turtle.getItemCount() > 1 do
    turtle.place()
    while turtle.compare() == false do
     sleep(1)
    end
    turtle.dig()
  end
  rs.setOutput("top",true)
  while turtle.getItemCount() < 64 do
    sleep(1)
  end
  rs.setOutput("top",false)
end
Edited on 11 March 2017 - 06:29 PM