Pinkishu

Untitled

Jun 3rd, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. redOn = false
  2. while true do
  3.     local ev,p1 = os.pullEvent("redstone")
  4.     if ev == "redstone" then
  5.         if rs.testBundledInput("back",colors.red) then
  6.             if not redOn then
  7.                 redOn = true
  8.                 redStart = os.clock()
  9.             end
  10.         else
  11.             if redOn then
  12.                 redOn = false
  13.                 timePassed  = os.clock() - redStart
  14.                 print("Seconds passed: " .. timePassed)
  15.             end
  16.         end
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment