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

Some Questions From A Beginner

Started by colecf, 25 February 2012 - 03:50 AM
colecf #1
Posted 25 February 2012 - 04:50 AM
I've been playing around with the turtle a little (not an actually computer though) and I've come up with these questions:

1. When I break the turtle to move it to the area where I want to run the program, the program is erased! Is there anyway to prevent this? I don't want to have to program outside where a creeper could get me…

2. Is there a way to get what slot is currently selected?

3. Is there a way to get what type of block is in the currently selected slot?

Thanks in advance!
Casper7526 #2
Posted 25 February 2012 - 05:01 AM
#1 - Give the turtle a label, you can do this by typing "label set Hello" or from within a program os.setComputerLabel("Hello")
#2 - You can keep track of what slot is selected with a variable. slotselected = 1 turtle.select(slotselected)
#3 - There is no current way to determine what block the turtle is mining or has mined OTHER than setting up an extremely complex piping system that would sort the contents of the turtle when it came to a "docking station"
colecf #3
Posted 25 February 2012 - 05:08 AM
Thanks. I was wondering if there was a way other than using a variable for the slots because I wanted to write an api that does some inventory management, and didn't want the user to worry about the slot changing when using it. I suppose I could just have the user pass in an argument.

Though the block ignorance is annoying, I hope that feature gets added in the next version.