View difference between Paste ID: EQ10uws2 and JYMfNy2z
SHOW: | | - or go back to the newest paste.
1
local component = require("component")
2
local sides = require("sides")
3
local os = require("os")
4
local robot = require("robot")
5
local inv = component.inventory_controller
6
local red = component.redstone
7
local pulsetime = 0.25
8
9
local function pulse(PT)
10
	red.setOutput(sides.back,15)
11
	os.sleep(PT)
12
	red.setOutput(sides.back,0)	
13
end
14-
local function dropcomparenot(slot)
14+
local function dropcomparenot(slot,Target1,Target2)
15
	robot.select(slot)
16-
	N = robot.count(slot)
16+
	if not robot.compareTo(Target1) and not robot.compareTo(Target2) and robot.count(slot)>0 then
17-
	if not robot.compareTo(16) and N>0 then
17+
			robot.dropDown()
18-
		inv.equip()
18+
19-
		for i = 1, N do
19+
20-
			robot.useDown()
20+
local function dropcompare(slot, Target)
21
	robot.select(slot)
22
	if robot.compareTo(Target) then
23
		robot.dropDown(1)
24-
local function dropcompare(slot)
24+
25
end
26-
	if robot.compareTo(16) then
26+
local function activate()
27
	for i = 1, 14 do  --dropping seed
28
		dropcompare(i,15)
29
	end	
30-
local function activatealtar()
30+
31-
	for i = 2, 15 do  --dropping living rock
31+
32-
		dropcompare(i)
32+
33
	if robot.count(1) and robot.count(2) and robot.count(3) > 0 then
34-
	robot.down()
34+
35-
	robot.select(1)
35+
		for i = 1, 14 do  --dropping bucket
36-
	robot.placeDown()
36+
			dropcompare(i,16)
37
		end	
38
		for i = 1, 14 do  --use all items except seed and water bucket
39
			dropcomparenot(i,14,15)
40-
	if robot.count(2) and robot.count(3) > 0 and red.getComparatorInput(sides.down) == 0 then
40+
41
42-
		for i = 2, 15 do  --use all items except living rock
42+
43-
			dropcomparenot(i)
43+
		activate()
44
		os.sleep(0.1)
45-
		while true do
45+
46-
			
46+
47-
			if red.getComparatorInput(sides.down) == 2 then
47+
48-
				break
48+
49-
			end
49+
	os.sleep(0.1)
50-
			os.sleep(0.2)
50+
51
52-
		robot.up()
52+