View difference between Paste ID: KSEVVriF and hVFYnsQE
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.1
8
9-
local function pulse(PT)
9+
10-
	red.setOutput(sides.down,15)
10+
11-
	os.sleep(PT)
11+
12-
	red.setOutput(sides.down,0)	
12+
	for i = 1, 16 do
13-
end
13+
		if robot.count(i) > 0 then
14
			robot.select(i)
15
			local limit = robot.count(i)
16
			inv.equip()
17-
while inv.getStackInSlot(sides.front,1) ~= nil do
17+
			for c = 1, limit do
18-
	inv.suckFromSlot(sides.front,1)
18+
				robot.use()
19-
	robot.turnLeft()
19+
			end
20-
	while robot.count(1) > 0 do
20+
			
21-
		for i = 1, 3 do  -- drop into alloy smelter
21+
22-
			inv.dropIntoSlot(sides.front, i, 1)
22+
		end
23-
		end		
23+
24-
		os.sleep(0.5)
24+
25
	end
26-
	robot.turnRight()
26+
27-
end
27+
28
end