Advertisement
Vilsol

Untitled

Jan 24th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. repeat
  2. shell.run("clear")
  3. write "Is the door O or C? "
  4. oc = string.lower(read())
  5. until oc == "o" or oc == "c"
  6. shell.run("clear")
  7. while true do
  8.     if(rs.getInput("top"))then
  9.         if(oc == "o")then
  10.             rednet.broadcast("TurtleDoor.Close")
  11.             oc = "c"
  12.             print "Door Closing!"
  13.             sleep(1) -- Amount of seconds it takes to close
  14.         else
  15.             rednet.broadcast("TurtleDoor.Open")
  16.             oc = "o"
  17.             print "Door Opening!"
  18.             sleep(1)  -- Amount of seconds it takes to open
  19.         end
  20.         shell.run("clear")
  21.     else
  22.         sleep(0.1)
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement