Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Each recipe is indexed by name (stick, chest etc.)
- --Each recipe has the following values:
- --count: The number of materials required to make it
- --map: an indexed table of booleans, the index referring to the
- --slot in the turtle's inventory (1 -> 11, sans 4 and 8)
- recipes = {
- --The example recipe: Sticks!
- ["wiring"] = {
- count = 3,
- map = {
- [1] = false, [2] = false, [3] = false,
- [5] = true, [6] = true, [7] = true,
- [9] = false, [10]= false, [11]= false
- }
- }
- }
- function craftRecipe(recipemap)
- end
- function readName()
- while true do
- shell.run("clear")
- print("What do you want me to craft?")
- local name = io.read()
- if not recipes[name] then
- print("I don't know that recipe.")
- sleep(2)
- else
- print("Please insert "..recipes[name].count.." materials to slot 1")
- while turtle.getItemCount(1) ~= recipes[name].count do sleep(0.1) end
- craftRecipe(recipes[name].map)
- end
- end
- end
- readName()
Advertisement
Add Comment
Please, Sign In to add comment