What's going on, guys?
I've heard that there is code where a turtle can sense how many and what type of items it picks up. I am basically making a bank-type program. I want a certain amount of one item to execute a command (such as redstone.setOutput()). Help will be much appreciated. Thanks!
5 replies to this topic
#1
Posted 07 June 2015 - 02:03 AM
#3
#4
Posted 07 June 2015 - 02:50 PM
So do that.
It is, of course, rather difficult to tell you how to improve your script if you don't want to show it to us.
local data = turtle.getItemDetail() if data and data.name == "minecraft:iron_ingot" then -- If data is defined (meaning there was an item in the slot), and the item's name matches, then... -- whatever end
It is, of course, rather difficult to tell you how to improve your script if you don't want to show it to us.
#5
Posted 07 June 2015 - 03:23 PM
Bomb Bloke, on 07 June 2015 - 02:50 PM, said:
So do that.
It is, of course, rather difficult to tell you how to improve your script if you don't want to show it to us.
local data = turtle.getItemDetail() if data and data.name == "minecraft:iron_ingot" then -- If data is defined (meaning there was an item in the slot), and the item's name matches, then... -- whatever end
It is, of course, rather difficult to tell you how to improve your script if you don't want to show it to us.
#6
Posted 07 June 2015 - 04:31 PM
MC version rarely makes a difference in CC features, the CC version is more important. However, if you had said minecraft 1.6, I could've told you it isn't added yet.
if the script BB provided errors with
...You don't have that functionality in your version of CC, and may want to consider updating.
If you used his code and nothing happened, you do have the functionality but didn't add any code inside the if statement provided, or the turtle didn't find an iron ingot in the currently selected slot (default is slot 1, upper left).
if the script BB provided errors with
filename:1:attempt to call nil
...You don't have that functionality in your version of CC, and may want to consider updating.
If you used his code and nothing happened, you do have the functionality but didn't add any code inside the if statement provided, or the turtle didn't find an iron ingot in the currently selected slot (default is slot 1, upper left).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











