Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- numWells = 16
- if (args[1]==nil) then
- numRuns = 4
- else
- numRuns = args[1]
- end
- shell.run("send99","file","emptyINV")
- shell.run("send99","file","wellPlace")
- shell.run("send99","file","wellGet")
- print("Starting mining program.")
- local m = peripheral.wrap("right")
- m.open(100)
- function advsleep(t)
- for i=1,t do
- print("Sleeping for: ".. t-i .." sec.")
- sleep(1)
- end
- end
- function wellsready(nw)
- wellsPlaced = 0
- while wellsPlaced ~= nw do
- local event,modemside,senderchannel,replychannel,message,senderdistance = os.pullEvent("modem_message")
- if (senderchannel==100) then
- if (message=="ready") then
- wellsPlaced = wellsPlaced+1
- print("Totale wells klaar: "..wellsPlaced)
- end
- end
- end
- end
- for i=1,numRuns do
- print("Run#: ".. i)
- shell.run("send99","shell","wellPlace")
- wellsready(numWells)
- advsleep(20)
- shell.run("send99","shell","emptyINV","down")
- wellsready(numWells)
- shell.run("send99","shell","wellGet","down")
- wellsready(numWells)
- shell.run("moveFrame","forward")
- end
- shell.run("moveFrame","left")
- sleep(1)
- shell.run("moveFarm","back")
- for i=1,numRuns do
- print("Run#: ".. i)
- shell.run("send99","shell","wellPlace")
- wellsready(numWells)
- advsleep(20)
- shell.run("send99","shell","emptyINV","down")
- wellsready(numWells)
- shell.run("send99","shell","wellGet","down")
- wellsready(numWells)
- shell.run("moveFrame","back")
- end
- shell.run("moveFrame","left")
Advertisement
Add Comment
Please, Sign In to add comment