SHOW:
|
|
- or go back to the newest paste.
| 1 | woolValid = true | |
| 2 | - | for i=1,16 do |
| 2 | + | startPosition = 1 |
| 3 | - | turtle.select(i) |
| 3 | + | |
| 4 | - | turtle.dropDown(1) |
| 4 | + | local function dropWool() |
| 5 | - | --os.sleep(1) |
| 5 | + | for i=startPosition,16 do |
| 6 | if woolValid and turtle.getItemCount(i) > 1 then | |
| 7 | turtle.select(i) | |
| 8 | turtle.dropDown(1) | |
| 9 | --Uncomment this is your spreaders are overloaded \/ | |
| 10 | - | if rs.getInput("left") then
|
| 10 | + | --os.sleep(1) |
| 11 | - | main() |
| 11 | + | else |
| 12 | if woolValid then | |
| 13 | - | sleep(.1) |
| 13 | + | startPosition = i |
| 14 | end | |
| 15 | woolValid = false | |
| 16 | end | |
| 17 | end | |
| 18 | end | |
| 19 | ||
| 20 | local function main() | |
| 21 | woolValid = true | |
| 22 | ||
| 23 | print("Validating Wool")
| |
| 24 | for i=1,16 do | |
| 25 | --For some reason white wool's damage is 64, whereas the rest are sequential.... | |
| 26 | if (turtle.getItemDetail(i).damage ~= i - 1 or turtle.getItemCount(i) < 2) then | |
| 27 | ||
| 28 | woolValid = false | |
| 29 | print("Wool invalid at index: "..i)
| |
| 30 | end | |
| 31 | end | |
| 32 | ||
| 33 | if woolValid then | |
| 34 | print("Your wool's valid. Flip the lever to start the drop.")
| |
| 35 | while woolValid do | |
| 36 | if rs.getInput("left") then
| |
| 37 | dropWool() | |
| 38 | end | |
| 39 | ||
| 40 | sleep(.1) | |
| 41 | end | |
| 42 | end | |
| 43 | ||
| 44 | sleep(1) | |
| 45 | end | |
| 46 | ||
| 47 | while true do | |
| 48 | main() | |
| 49 | end |