Advertisement
problemlow

MiningResourceSplitter

May 21st, 2024 (edited)
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. function searchString(bigString, searchString)
  2.     if bigString ~= nil and searchString ~= nil then
  3.         if bigString.match(bigString, searchString) == nil then
  4.             return false
  5.         else
  6.             return true
  7.         end
  8.     else
  9.         return false
  10.     end
  11. end
  12.  
  13.  
  14. function check()
  15.     for slot = 1, 16 do
  16.         turtle.select(slot)
  17.         if turtle.getItemSpace(slot) ~= 64 then
  18.             temp = turtle.getItemDetail()
  19.             name = temp.name
  20.             if searchString(name, "raw") == true or searchString(name, "sulfur") == true then
  21.                 print("Drop Forward")
  22.                 turtle.drop(64)
  23.             else
  24.                 print("Drop Down")
  25.                 turtle.dropDown(64)
  26.             end
  27.         end
  28.     end
  29. end
  30.  
  31. while true do
  32.     check()
  33.     sleep(2.5)
  34. end
  35. shell.run("reboot")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement