Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Labels and variables for the items we need for crystal growth
- -- Fluix Crystal
- lblNetherQuartz = "Nether Quartz"
- bNQ = false -- do we have Nether Quartz
- lblRedstone = "Redstone"
- bR = false -- do we have Redstone
- lblChargedCertus = "Charged Certus Quartz Crystal"
- bCC = false -- do we have Charged Certus
- -- Pure Certus Quartz
- lblCertusSeed = "Certus Quartz Seed"
- bCS = false -- do we have Certus Quartz Seed
- -- Pure Fluix Crystal
- lblFluixSeed = "Fluix Seed"
- -- Pure Nether Quartz
- lblNQuartzSeed = "Nether Quartz Seed"
- bFS = false -- dw we have Fluix Seed
- -- Side of the turtle the chest is on
- -- This requires the chest to be in front of the turtle or on top of the turtle.
- -- Edit code in function fMoveOne (turtle.drop or turtle.dropUp)
- lblChest = "front"
- lblPushDir = "south"
- -- Side of the turtle used to turn off energy
- lblRS = "back"
- pChest = peripheral.wrap(lblChest)
- -- This function will scan the chest and detect what ingredients are located in it
- function fCheckChest()
- -- Start by setting all of the ingredients to false
- bNQ = false -- Nether Quartz
- bR = false -- Redstone
- bCC = false -- Charged Certus
- bCS = false -- Certus Seed
- bFS = false -- Fluix Seed
- bNQS = false -- Nether Quartz Seed
- cSize = pChest.size() -- number of slots in the chest
- --print("cSize = "..cSize)
- for slot = 1, cSize do
- --print("slot = "..slot)
- data = pChest.getItemMeta(slot)
- if data == nil then
- itemName = "No item in slot"
- else
- itemName = data["displayName"]
- print(itemName)
- end
- if itemName == lblNetherQuartz then
- bNQ = true
- print("Found Nether Quartz")
- slotNQ = slot
- end -- if
- if itemName == lblRedstone then
- bR = true
- print("Found Redstone")
- slotR = slot
- end -- if
- if itemName == lblChargedCertus then
- bCC = true
- print("Found Charged Certus")
- slotCC = slot
- end -- if
- if itemName == lblCertusSeed then
- bCS = true
- print("Found Certus Seed")
- slotCS = slot
- end -- if
- if itemName == lblFluixSeed then
- bFS = true
- print("Found Fluix Seed")
- slotFS = slot
- end -- if
- if itemName == lblNQuartzSeed then
- bNQS = true
- print("Found Nether Quartz Seed")
- slotNQS = slot
- end -- if
- end -- for
- end -- function
- -- This routine will drop the seeds and turn on the accelerators
- -- It will aslo check on the seed growth and turn off the accelerators when done
- function fGrowSeeds()
- turtle.dropDown()
- redstone.setAnalogOutput(lblRS, 15)
- os.sleep(30) -- wait 30 seconds
- while turtle.suckDown() do
- turtle.dropDown()
- os.sleep(30)
- end -- do
- redstone.setAnalogOutput(lblRS, 0)
- end -- function
- -- This routine will pull one item out of the chest and drop it into the water below
- function fMoveOne(moveSlot)
- pChest.drop(moveSlot, 1, "down")
- --pushItemIntoSlot(lblPushDir, moveSlot)
- end -- function
- -- This routine will check to see if we have a crafting operation to perform
- function fCheck4Work()
- if bFS then
- print("Make Pure Fluix")
- pChest.drop(slotFS, 64, "down")
- fGrowSeeds()
- elseif bCS then
- print("Make Pure Certus")
- pChest.drop(slotCS, 64, "down")
- fGrowSeeds()
- elseif bNQS then
- print("Make Pure Nether Quartz")
- pChest.drop(slotNQS, 64, "down")
- fGrowSeeds()
- elseif (bNQ and bR and bCC) then
- print("Make Fluix")
- fMoveOne(slotNQ)
- fMoveOne(slotR)
- fMoveOne(slotCC)
- -- else
- -- print("Nothing to make")
- end -- if
- end -- function
- while true do
- fCheckChest()
- fCheck4Work()
- os.sleep(1) -- wait one seconds between checks
- end -- program
Add Comment
Please, Sign In to add comment