Update server + client
This commit is contained in:
parent
04dde0682b
commit
e35e8d8d24
@ -110,6 +110,16 @@ function selectCobble()
|
|||||||
end
|
end
|
||||||
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()
|
function digShaft()
|
||||||
turtle.digDown()
|
turtle.digDown()
|
||||||
selectCobble()
|
selectCobble()
|
||||||
@ -264,6 +274,7 @@ function doRefuel()
|
|||||||
turtle.select(1)
|
turtle.select(1)
|
||||||
while turtle.getFuelLevel() < 1500 do
|
while turtle.getFuelLevel() < 1500 do
|
||||||
turtle.suck(1)
|
turtle.suck(1)
|
||||||
|
selectFuel()
|
||||||
turtle.refuel(1)
|
turtle.refuel(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -297,8 +308,10 @@ function waitForJob()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function emptyToBarrel()
|
function emptyToBarrel()
|
||||||
|
sleep(0.4)
|
||||||
for i = 1,16 do
|
for i = 1,16 do
|
||||||
turtle.select(i)
|
turtle.select(i)
|
||||||
|
sleep(0.1)
|
||||||
turtle.dropDown()
|
turtle.dropDown()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
rednet.open("back")
|
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()
|
function getNextJob()
|
||||||
curjob = curjob + 1
|
curjob = curjob + 1
|
||||||
@ -13,9 +22,11 @@ while true do
|
|||||||
sleep(0.6)
|
sleep(0.6)
|
||||||
else
|
else
|
||||||
if message == "gibjob" then
|
if message == "gibjob" then
|
||||||
|
if rs.getInput("right") then
|
||||||
job = getNextJob()
|
job = getNextJob()
|
||||||
rednet.broadcast(tostring(job), "newjob")
|
rednet.broadcast(tostring(job), "newjob")
|
||||||
print("Found request for job. Offering "..tostring(job))
|
print("Found job request. Offering "..tostring(job))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- numberic job is complete
|
-- numberic job is complete
|
||||||
completejob = tonumber(message)
|
completejob = tonumber(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user