From a6b8b8f1158ae48f6adb15a827f5e19ec7f0bfb9 Mon Sep 17 00:00:00 2001 From: erius0 <63460770+erius0@users.noreply.github.com> Date: Fri, 14 May 2021 23:11:50 +0300 Subject: [PATCH] Create skeletonFarm.lua --- skeletonFarm.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 skeletonFarm.lua diff --git a/skeletonFarm.lua b/skeletonFarm.lua new file mode 100644 index 0000000..c062d9f --- /dev/null +++ b/skeletonFarm.lua @@ -0,0 +1,31 @@ +local robot = require("robot") +local component = require("component") +local magnet = component.tractor_beam +local inv = component.inventory_controller + +shell.execute("clear") +print("U - обновить ПО робота, E - выйти в OpenOS") + +function onKeyPressed() + local _, _, _, key, _ = event.pull(0.05, "key_down") + if key == 0x16 then + computer.shutdown(true) + elseif key == 0x12 then + os.exit() + end +end + +function farmSkeletons() + for i = 1, 3 do + robot.swingDown() + end + for i = 1, 8 do + robot.select(i) + robot.drop() + end +end + +while true do + onKeyPressed() + farmSkeletons() +end