Advertisement
Guest User

cast

a guest
Apr 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. os.loadAPI("output")
  2.  
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. local arg = {...}
  6.  
  7. blocks = math.floor(arg[1] / 9)
  8. ingots = arg[1] % 9
  9.  
  10. color = arg[2]
  11. color2 = arg[3]
  12.  
  13. function pourBlock()
  14.   redstone.setOutput("left", true)
  15.   --output.set(color, true)
  16.   sleep(.1)
  17.   --output.set(color, false)
  18.   redstone.setOutput("left", false)
  19. end
  20.  
  21. function pourIngot()
  22.   redstone.setOutput("right", true)
  23.   --output.set(color2, true)
  24.   sleep(.1)
  25.   --output.set(color2, false)
  26.   redstone.setOutput("right", false)
  27. end
  28.  
  29. print("Casting ",blocks," Blocks.")
  30. print("Casting ",ingots," Ingots.")
  31. for i=1, blocks do
  32.   pourBlock()
  33.   print("Casting Block #", i)
  34.   sleep(16)
  35. end
  36.  
  37. for i=1, ingots do
  38.   pourIngot()
  39.   print("Casting Ingot #", i)
  40.   sleep(7)
  41. end
  42. print("Casting Complete.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement