Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuel() -- standard script for refuel
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
- repeat
- turtle.select(1)
- if turtle.getItemCount( turtle.getSelectedSlot() ) == 0 then
- redstone.setAnalogOutput("top",15)
- print("Out of fuel! Put fuel in first slot.")
- print("Press any key to continue")
- os.pullEvent("key")
- redstone.setAnalogOutput("top",0)
- else
- end
- until turtle.getItemCount( turtle.getSelectedSlot() ) > 0
- print("refueling")
- turtle.refuel()
- end
- end
- while true do -- start the endless journey
- refuel()
- turtle.select(2) -- select inventory slot number 2
- local slot2raw = turtle.getItemDetail() -- store the item details for item in slot 2
- turtle.select(3)
- local slot3raw = turtle.getItemDetail()
- turtle.select(4)
- local slot4raw = turtle.getItemDetail()
- if slot2raw and slot3raw and slot4raw then
- local slot2 = tostring(slot2raw.name)
- local slot3 = tostring(slot3raw.name)
- local slot4 = tostring(slot4raw.name)
- -- script for recognizing right inventory for fluix crystal
- if slot2 == "ae2:charged_certus_quartz_crystal" or slot2 == "minecraft:redstone" or slot2 == "minecraft:quartz"
- and slot3 == "ae2:charged_certus_quartz_crystal" or slot3 == "minecraft:redstone" or slot3 == "minecraft:quartz"
- and slot4 == "ae2:charged_certus_quartz_crystal" or slot4 == "minecraft:redstone" or slot4 == "minecraft:quartz"
- then
- -- make fluix crystal
- turtle.forward()
- for a = 2,4,1 do
- turtle.select(a)
- turtle.dropDown()
- end
- os.sleep(10)
- turtle.select(3)
- itemcunt3 = turtle.getItemCount()
- turtle.select(2)
- itemcunt2 = turtle.getItemCount()
- while itemcunt2 + itemcunt3 < 128 do
- print(itemcunt3)
- turtle.suckDown()
- turtle.select(3)
- itemcunt3 = turtle.getItemCount()
- turtle.select(2)
- itemcunt2 = turtle.getItemCount()
- end
- turtle.back()
- turtle.turnLeft() turtle.turnLeft()
- for a = 2,4,1 do
- turtle.select(a)
- turtle.drop()
- end
- turtle.turnLeft() turtle.turnLeft()
- end
- end
- os.sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment