KaychenHH

meco.lua

Mar 25th, 2022 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. -- mecom.lua
  2. --
  3. -- Test auf ME-Controller unter CC
  4. --
  5. -- written in 03/2022 by Kay Michaelsen
  6. --
  7.  
  8. meco = {}
  9. chest = {}
  10. liste = {}
  11. trans = {}
  12. vars = {}
  13. tableString = ""
  14.  
  15. meco = peripheral.wrap("back")
  16. chest = peripheral.wrap("bottom")
  17.  
  18. print(peripheral.getName(meco))
  19. print(peripheral.getName(chest))
  20.  
  21. liste = meco.listAvailableItems()
  22.  
  23. vars.liste = liste
  24. tableString = textutils.serialise(vars)
  25.  
  26. function FindSlot(fItemname,fAnzahl)
  27.  
  28.     local Nummer = 0
  29.     local item = {}
  30.     local slot = 0
  31.     local Anz = 0
  32.    
  33.     for slot,item in pairs(liste) do
  34.         if item.name == fItemname then
  35.             Nummer = slot
  36.             Anz = meco.pushItems(peripheral.getName(chest),fAnzahl)
  37.             print(Anz)
  38.             break
  39.         end
  40.     end
  41.  
  42.     return Nummer
  43.  
  44. end
  45.  
  46. print("Cobblestone: ", FindSlot("minecraft:cobblestone", 500))
  47. print("Redstone: ", FindSlot("minecraft:redstone",64))
  48.  
Add Comment
Please, Sign In to add comment