did stuff

This commit is contained in:
Julian Brammer 2024-06-25 23:15:57 +02:00
parent 6dc855b4cf
commit d15dab5595
4 changed files with 103 additions and 7 deletions

View File

@ -0,0 +1,80 @@
basic = require("lib.basic")
local toPlant = {
[1] = "minecraft:wheat_seeds",
[2] = "minecraft:potato",
[3] = "minecraft:carrot",
}
local toCollect = {
[1] = "minecraft:wheat",
[2] = "minecraft:potato",
[3] = "minecraft:carrot",
}
local function doAllFields()
local numFieldsDepth = 2
local numFieldsWidth = 2
turtle.up()
--for each column
for i=1, numFieldsDepth do
for j=1, numFieldsWidth do
doOneField()
end
end
end
--start = 0
--1231 2132 3123 1321
--
--1. +1 aufsteigend
--2. +1 absteigend
--3. +1 aufsteigend
--4. +1 absteigend
local function doOneField()
for i=1, 4 do --for 4 rows
for j=1, 4 do
turtle.digDown()
turtle.suckUp()
--get next crop
if i%2==1 then
currentSeed = currentSeed + 1
if currentSeed > 3 then
currentSeed = 1
end
elseif i%2==0 then
currentSeed = currentSeed - 1
if currentSeed > 3 then
currentSeed = 1
end
end
end
end
end
local function main()
while true do
for i=1, 600 do
basic.clearDisplay()
print(i*5 .. "/3000")
sleep(5)
end
doAllFields()
sortAway()
goToStart()
end
end
currentSeed = 0
main()

View File

@ -53,6 +53,14 @@ function ntfy(msg)
http.post(getNtfyAddress(), "[" .. os.getComputerLabel() .. "] " .. msg)
end
local function getTutelServer()
return readFileOneline("/brulijam/config/tutelServer.txt")
end
function telegramNotifier()
http.post()
end
function splitStringToArray(inputStr)
table = {}
i = 0

View File

@ -1,13 +1,14 @@
basic = require("lib.basic")
tutel = require("lib.tutel")
function excavate(depth, width, height)
-- Digging loop
-- secureDigging loop
for h = 1, height do
-- Digging a layer
-- secureDigging a layer
for w = 1, width do
-- Digging a row
-- secureDigging a row
for d = 1, depth-1 do
turtle.dig() -- Digging forward
tutel.secureDig() -- secureDigging forward
turtle.forward() -- Moving forward
end
--move to start of row
@ -18,7 +19,7 @@ function excavate(depth, width, height)
-- go to next row if not last row
if w<width then
turtle.turnRight()
turtle.dig()
tutel.secureDig()
turtle.forward()
turtle.turnLeft()
end
@ -33,7 +34,7 @@ function excavate(depth, width, height)
--go to next layer if not last layer
if h<height then
turtle.digUp()
tutel.secureDigUp()
turtle.up()
end
end
@ -46,7 +47,7 @@ end
basic.clearDisplay()
print("[Digs a Quader]")
print("[secureDigs a Quader]")
write("depth: ")
depth = tonumber(read())
write("width: ")

View File

@ -58,6 +58,13 @@ if not (fs.exists("brulijam/config/ntfy.txt")) then
file.close()
end
--create tutelServer file (can be changed later)
if not (fs.exists("/brulijam/config/tutelServer.txt")) then
file = fs.open("/brulijam/config/tutelServer.txt", "a")
file.writeLine("https://seals.social/minecraftapi")
file.close()
end
-- vulna because you can terminate startup
print("Press Return to continue")