Guest User

startup

a guest
Apr 6th, 2020
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. --[[Spectrolus Generator
  2. By PancakePhD
  3.  
  4. Do not redistribute. Contact Pancake]]--
  5.  
  6. woolValid = true
  7. startPosition = 1
  8.  
  9. local function dropWool()
  10.     for i=startPosition,16 do
  11.         if woolValid and turtle.getItemCount(i) > 1 then
  12.             turtle.select(i)
  13.             turtle.dropDown(1)
  14.             --Uncomment this is your spreaders are overloaded \/
  15.             os.sleep(7)
  16.         else
  17.             if woolValid then
  18.                 startPosition = i
  19.             end
  20.             woolValid = false
  21.         end
  22.     end
  23. end
  24.  
  25. local function main()
  26.     woolValid = true
  27.  
  28.     print("Validating Wool")
  29.     for i=1,16 do
  30.         --For some reason white wool's damage is 64, whereas the rest are sequential....
  31.         if (turtle.getItemDetail(i).damage ~= i - 1 or turtle.getItemCount(i) < 2) then
  32.  
  33.             woolValid = false
  34.             print("Wool invalid at index: "..i)
  35.     os.setComputerLabel("Wool Invalid")
  36.         end
  37.     end
  38.  
  39.     if woolValid then
  40.         print("Your wool's valid. Flip the lever to start the drop.")
  41.         os.setComputerLabel("Flip Lever")
  42.         while woolValid do
  43.             if rs.getInput("top") then
  44.              os.setComputerLabel("Running")
  45.                 dropWool()
  46.             end
  47.  
  48.             sleep(.1)
  49.         end
  50.     end
  51.  
  52.     sleep(1)
  53. end
  54.  
  55. while true do
  56.     main()
  57. end
Advertisement
Add Comment
Please, Sign In to add comment