Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- AE Crystal Checking Script
- -- Is the crystal crystally yet? Or is it still seedy? LETS FIND OUT!
- -- (The turtle must be placed directly above the water!)
- -- (The chest must be placed directly above the turtle!)
- --<< Global configs >>--
- -- Time the script pauses before checking the crystals
- local sleepTime = 20
- -- Pairs of values: 1st is the name, second is the damage value.
- -- Gotten by putting item in selected slot and running turtle.getItemDetail()
- local finalForm = {
- "appliedenergistics2:item.ItemMultiMaterial", 10, --Certus
- "appliedenergistics2:item.ItemMultiMaterial", 11, --Nether
- "appliedenergistics2:item.ItemMultiMaterial", 7, --Fluix Raw
- "appliedenergistics2:item.ItemMultiMaterial", 12 --Fluix Pure
- }
- -- Output info for user
- print("AE Crystal Checker")
- print("------------------")
- print()
- print("Press q to quit...")
- -- Function that returns true if the selected item is in the table, false if not
- function isFinalForm()
- local data = turtle.getItemDetail()
- if data == nil then
- return false
- end
- for i=1,#finalForm,2 do
- if data.name == finalForm[i] then
- if data.damage == finalForm[i+1] then
- return true
- end
- end
- end
- return false
- end
- -- Main
- -- Setting up
- local timer = os.startTimer(sleepTime)
- while true do
- local event, edata = os.pullEvent()
- if event == "timer" and edata == timer then
- -- This is the timer we started, let's go!
- while turtle.suckDown() do end
- for i=1,16 do
- turtle.select(i)
- if isFinalForm() then
- turtle.dropUp()
- else
- turtle.dropDown()
- end
- end
- turtle.select(1)
- -- Restart the timer
- timer = os.startTimer(sleepTime)
- elseif event == "key" and edata == 16 then
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment