Advertisement
Guest User

cas

a guest
Dec 4th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local computer = require("computer")
  2. local robot = require("robot")
  3. local component = require("component")
  4. local sides = require("sides")
  5. local redstone = component.redstone
  6. function scan()
  7.   alm = robot.compareTo(16)
  8.   co = robot.count()
  9.   robot.suck()
  10.   if alm == true and co > 0 then
  11.     robot.dropDown()
  12.     rand = math.random(2)
  13.     print(rand)
  14.     if rand == 1 then
  15.       redstone.setOutput(sides.back,15)
  16.       os.sleep(1)
  17.       redstone.setOutput(sides.back,0)
  18.     elseif rand == 2 then
  19.       computer.beep(2000, 0.7)
  20.     end
  21.   end
  22. end
  23. while true do
  24.   red = redstone.getInput(sides.right)
  25.   if red > 0 then
  26.     scan()
  27.   end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement