Advertisement
Guest User

emeralds

a guest
Dec 17th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. ---Simple little program to automate my Minecraft emerald farm.
  2. ---
  3. ---Basic idea: I have an infinite villager breeder feeding into a
  4. ---smeltery (yes, I'm a bad, bad man). This script is for the computer
  5. ---to monitor the smeltery and trigger the drain whenever there's more than
  6. ---one emerald in there. More than one so that the smeltery doesn't end up
  7. ---empty and stop killing villagers.
  8.  
  9. function alarm()
  10.     allGood=false
  11.     redstone.setOutput("bottom",true)
  12.     while not allGood do
  13.         info=smelt.getInfo()
  14.         allGood= (info.id==27)
  15.     end
  16.     redstone.setOutput("bottom",false)
  17. end
  18.  
  19. smelt=peripheral.wrap("right")
  20.  
  21. alarm()
  22.  
  23. while true do
  24.     info=smelt.getInfo()
  25.  print(info.id)
  26.     if not (info.id==27) then
  27.         alarm()
  28.     elseif info.amount > 640 then
  29.         redstone.setOutput("back",true)
  30.         sleep(1)
  31.         redstone.setOutput("back",false)
  32.     end
  33.     sleep(30)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement