Advertisement
Sim_Piko

[lua][computercraft]sensorDoorOpeningTest v0.1

Feb 28th, 2015
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  1. local sensor = peripheral.wrap('right')
  2. local loop = 1
  3. while true do
  4.   sleep(1)
  5.   print (loop)
  6.   loop=loop+1
  7.   players = sensor.getPlayers()
  8.   rs.setOutput('left',false)
  9.   anyone=table.getn(players)
  10.   if anyone > 0 then
  11.     print(" wooo ")
  12.     rs.setOutput('left',true)
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement