Nessiesson

ApotheosisRaritySorter

May 22nd, 2023 (edited)
3,218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | Gaming | 0 0
  1. shell.run("label set raritySorter")
  2.  
  3. local reader = peripheral.find("blockReader")
  4. local keepers = {epic=true, mythic=true}
  5.  
  6. function sort()
  7.     turtle.select(1)
  8.     turtle.suck()
  9.  
  10.     if turtle.getItemCount() > 0 then
  11.         local status, rarity = pcall(getRarity)
  12.         if status and keepers[rarity] then
  13.             turtle.dropUp()
  14.         else
  15.             turtle.dropDown()
  16.         end
  17.     end
  18. end
  19.  
  20. function getRarity()
  21.     return reader.getBlockData()["Items"][0]["tag"]["affix_data"]["rarity"]
  22. end
  23.  
  24. while true do
  25.     sort()
  26.     sort()
  27.     sort()
  28.     sort()
  29.     os.sleep(1)
  30. end
  31.  
Advertisement
Add Comment
Please, Sign In to add comment