Advertisement
Agent_Silence

Ore Generator

May 24th, 2015 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local ids = {
  2. {id = "minecraft:stone", dmg = 0},
  3. {id = "minecraft:cobblestone", dmg = 0},
  4. {id = "minecraft:gold_ore", dmg = 0},
  5. {id = "minecraft:iron_ore", dmg = 0},
  6. {id = "minecraft:coal", dmg = 0},
  7. {id = "minecraft:redstone", dmg = 0},
  8. {id = "minecraft:emerald", dmg = 0},
  9. {id = "minecraft:quartz", dmg = 0},
  10. {id = "minecraft:dye", dmg = 4},
  11. {id = "minecraft:glowstone", dmg = 0},
  12. {id = "minecraft:iron_sword", dmg = 0},
  13. {id = "minecraft:iron_pickaxe", dmg = 0},
  14. {id = "minecraft:netherrack", dmg = 0},
  15. {id = "minecraft:soul_sand", dmg = 0},
  16. {id = "minecraft:lava_bucket", dmg = 0},
  17. {id = "minecraft:melon_seeds", dmg = 0}}
  18.  
  19. while true do
  20.   local event, slot, side = os.pullEvent("slot_click")
  21.   local name = peripheral.call("pim_1","getInventoryName")
  22.   if name ~= nil then
  23.         local info = peripheral.call("back","getSlot",slot)
  24.         commands.exec("give "..name.." "..info.id.." 1 "..info.dmg)
  25.         for i=1,9 do
  26.             peripheral.call("back","setSlot",i,ids[math.random(1,#ids)])
  27.         end
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement