Mowmaster

Sorting Ores Ingots Gems

Sep 2nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s=peripheral.wrap("left")
  2.  
  3. oP={14,15,2001,688,200,67537,164060,33471,34769,133073,196821,100305}
  4. --ores
  5. iP={9264,265,266,9270,7780,938760,774920,136339,103571,169107,971528}
  6. --ingots
  7. gP={263,30128,30243,348,331,5267,388,264,201070,233838,38035,70803,131423,201875}
  8. --gems
  9.  
  10. function sortable(table,element)
  11.   for key,value in pairs(table) do
  12.     if value==element then
  13.       return true
  14.     end
  15.   end
  16.   return false
  17. end      
  18.  
  19. function sorter()
  20. while true do
  21. event,item,count=os.pullEvent("isort_item")
  22.   if sortable(oP,item)==true then
  23.     s.sort(0)
  24.   elseif sortable(iP,item)==true then
  25.     s.sort(5)
  26.   elseif sortable(gP,item)==true then
  27.     s.sort(1)
  28.   else
  29.     s.sort(3)  
  30. end
  31. end
  32. end
  33.  
  34. sorter()
Add Comment
Please, Sign In to add comment