28 lines
541 B
Lua
28 lines
541 B
Lua
local M = {}
|
|
|
|
local logger = require("libs.logger")
|
|
local currentStatus = "idle"
|
|
|
|
function M.getStatus()
|
|
return currentStatus
|
|
end
|
|
|
|
function M.run()
|
|
while true do
|
|
currentStatus = "moving backward"
|
|
logger.log("Started moving backward")
|
|
for i = 1, 10 do
|
|
turtle.back()
|
|
sleep(0.5)
|
|
end
|
|
|
|
currentStatus = "moving forward"
|
|
logger.log("Started moving forward")
|
|
for i = 1, 10 do
|
|
turtle.forward()
|
|
sleep(0.5)
|
|
end
|
|
end
|
|
end
|
|
|
|
return M |