Main Menu

Move a turtle

Started by flowfy, Jul 16, 2020, 11:39 AM

Previous topic - Next topic

flowfy

Hello
I'm trying to write my first turtle program and need to know two things.
Maybe someone could easily answer my questions.
My first question is:
My turtle have to move forward a couple of blocks. So far I just write turtle.forward() so many times that I want the turtle to move.
Is there an easier way to do that?
And my second question:
My turtle have to set a block under her and to Redstone power the block
Setting the block is mo problem, but how do I set the direction with the command setredstoneOutput()

I hope my english is understandable
Greetings

Lupus590

For moving, you want to use a loop. In this case a for loop will be best.

As for redstone, have you checked the wiki?

flowfy

I have some trouble with the Redstone.getoutput command
Can you give me an example what I have to add to this command do set the signal to the bottom side of the turtle?

Lupus590

You want the setOutput command, not the getOutput one.

QuickMuffin8782

rs.getOutput("<side>") is entirely different as it returns the redstone level on the given side.
rs.setOutput("<side>", <level int - 0 to 15 limit>) can set the redstone output.
"The Blue Blur" - Working on Net Star OS, a new frontier for Red Star OS 3.0
linktr.ee/quickmuffin8782

Lupus590

Quote from: QuickMuffin8782 on Aug 15, 2020, 07:54 PMrs.getOutput("<side>") is entirely different as it returns the redstone level on the given side.
Adding to this, getOutput is different from getInput as one gives the redstone value that the computer is emitting and the other is what it's receiving. Honestly, I don't know why getOutput exists other than for backwards compatibility at this point. I seem to remember that the two get's can return different values so they must mean different things (I think it was when two computers were next to each other pushing redstone signals to each other if someone wants to experiment).