ComputerCraft Archive

AE2 Pure Certus, Quartz, or Fluix Grower

turtle utility unknown forum

Description

This is a simple program I made (it is my first program so I am sorry if it could be done better), and it does exactly what it needs to.It is a simple program designed to grow Pure Certus Crystals, Pu...

Installation

Copy one of these commands into your ComputerCraft terminal:

Pastebin:pastebin get PfTXrnMm ae2_pure_certus,_quartz,_or_fluix_grower
wget:wget https://pastebin.com/raw/PfTXrnMm ae2_pure_certus,_quartz,_or_fluix_grower
Archive:wget https://cc.shobie.xyz/cc/get/pb-PfTXrnMm ae2_pure_certus,_quartz,_or_fluix_grower
Quick Install: wget https://cc.shobie.xyz/cc/get/pb-PfTXrnMm AE2 Pure Certus, Quartz, or Fluix Grower

Usage

Run the program after downloading

Tags

turtleforumturtle-programs

Source

View Original Source

Code Preview

isFluix = false
isCertus = false
isQuartz = false
isPureFluix = false
i = 1
workToDo = 0

function CheckForWork()
-- If anything in slot 1-13 we have work to do
   
    for i=1,13 do
        local ItemFound = turtle.getItemCount(i)
		if (ItemFound ~= 0) 
		then
			workToDo = 1
		end
    end
end

function CheckWorkStatus()
-- Check the status of the work in progress
-- Anything unfinished will be found by the 
-- next CheckForWork cycle 

	turtle.suckDown()
	for i=1,13 do
		
		turtle.select(i)
    
		isFluix = turtle.compareTo(13)
		isCertus = turtle.compareTo(14)
		isQuartz = turtle.compareTo(15)
		isPureFluix = turtle.compareTo(16)
    
		if isFluix == true then
		  turtle.dropUp()
		elseif isCertus == true then
		  turtle.dropUp()
		elseif isQuartz == true then
		  turtle.dropUp()
		elseif isPureFluix == true then
		  turtle.dropUp()
		end
    end
  end
  
 --Main
 while true do
	-- Start off with the toggle bus off
	-- only turn on when there's work to do
	
	redstone.setOutput("back", false)
	CheckForWork()
	if workToDo == 1 then
		-- Now we can turn on the accelerators 
		-- and run a cycle
		redstone.setOutput("back", true)
		
		for i=1,13 do
		-- Since we have work, drop the items
			turtle.select(i)
			turtle.dropDown()
		end
		-- now wait a bit for it to process
		os.sleep (60)
	end
	CheckWorkStatus()
 end