Update server + client

This commit is contained in:
Dominic Zimmer 2020-07-05 02:01:31 +02:00
parent 04dde0682b
commit e35e8d8d24
2 changed files with 28 additions and 4 deletions

View File

@ -110,6 +110,16 @@ function selectCobble()
end
end
function selectFuel()
for i = 1,16 do
turtle.select(i)
item = turtle.getItemDetail()
if item and (item["name"] == "minecraft:coal" or item["name"] == "minecraft:charcoal") then
break
end
end
end
function digShaft()
turtle.digDown()
selectCobble()
@ -264,6 +274,7 @@ function doRefuel()
turtle.select(1)
while turtle.getFuelLevel() < 1500 do
turtle.suck(1)
selectFuel()
turtle.refuel(1)
end
end
@ -297,8 +308,10 @@ function waitForJob()
end
function emptyToBarrel()
sleep(0.4)
for i = 1,16 do
turtle.select(i)
sleep(0.1)
turtle.dropDown()
end
end

View File

@ -1,6 +1,15 @@
rednet.open("back")
curjob = 29
curjob = 69
while true do
print("From what index do you want to resume jobs?")
x = read()
if x then
curjob = tonumber(x)
break
end
print("That's not a number.")
end
function getNextJob()
curjob = curjob + 1
@ -13,9 +22,11 @@ while true do
sleep(0.6)
else
if message == "gibjob" then
job = getNextJob()
rednet.broadcast(tostring(job), "newjob")
print("Found request for job. Offering "..tostring(job))
if rs.getInput("right") then
job = getNextJob()
rednet.broadcast(tostring(job), "newjob")
print("Found job request. Offering "..tostring(job))
end
else
-- numberic job is complete
completejob = tonumber(message)