LuaScripts/craftCrystal.lua

24 lines
476 B
Lua
Raw Normal View History

2021-01-04 23:45:03 +00:00
local robot = require("robot")
2021-01-05 13:09:20 +00:00
local component = require("component")
local sides = require("sides")
local rs = component.redstone
2021-01-05 13:14:05 +00:00
local flag = true;
2021-01-05 13:09:20 +00:00
while true do
if rs.getInput(sides.top) > 0 then
2021-01-05 13:22:41 +00:00
if not flag then
robot.turnAround()
flag = true
end
2021-01-05 13:09:20 +00:00
robot.suck()
robot.dropDown()
else
2021-01-05 13:14:05 +00:00
if flag then
2021-01-05 13:22:41 +00:00
robot.turnAround()
2021-01-05 13:14:05 +00:00
os.sleep(5)
flag = false
end
2021-01-05 13:09:20 +00:00
robot.suckDown()
2021-01-05 13:54:33 +00:00
robot.drop()
2021-01-05 13:09:20 +00:00
end
end