Advertisement
Guest User

trade

a guest
Mar 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1.   -- Components Definition
  2.  
  3. local component = require("component")
  4. local sides = require("sides")
  5. local trans = component.proxy(component.get("133d"))
  6. local keyboard = require("keyboard")
  7.  
  8.  
  9.   -- Variables Definition
  10.  
  11. collector = sides.north
  12. andechest = sides.bottom
  13. diochest = sides.south
  14. phantom = sides.east
  15. trash = sides.top
  16.  
  17.  
  18.   -- Function
  19.  
  20. function clear()
  21.   Item = nil
  22.   Meta = nil
  23.   Amount = 0
  24. end
  25.  
  26.  
  27.   -- Main Code
  28.  
  29. Amount = 0
  30. while true do
  31.   for i = 1, 6 do
  32.     Slot = nil
  33.     Slot = trans.getStackInSlot(collector, i)
  34.     if Slot == nil then os.sleep(2) end
  35.     if Slot ~= nil then
  36.       for k,v in pairs(Slot) do
  37.         if k == "name" then Item = v end
  38.         if k == "damage" then Meta = v end
  39.         if k == "size" then Amount = v end
  40.         if Item == "minecraft:stone" and Meta == 5 and Amount ~= 0 then
  41.           for j = 1, Amount do
  42.             trans.transferItem(collector,trash, 1,i,1)
  43.             trans.transferItem(andechest,phantom, 1,1,2)
  44.             os.sleep(.1)
  45.           end
  46.         clear()
  47.         end
  48.         if Item == "minecraft:stone" and Meta == 3 and Amount ~= 0 then
  49.           for  j= 1, Amount do
  50.             trans.transferItem(collector,trash, 1,i,1)
  51.             trans.transferItem(diochest,phantom, 1,1,1)
  52.             os.sleep(.1)
  53.           end
  54.         clear()
  55.         end
  56.       end
  57.     end
  58.   end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement