Stravides

ME-Link

Mar 15th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. m= peripheral.wrap("left")
  2. m.AddAlert("testalarm1","1:0",10,50)
  3. m.AddAlert("testalarm2","1:0",10,0)
  4. m.AddAlert("testalarm3","1:0",0,50)
  5. while true do
  6.   local event,param1 = os.pullEvent()
  7.   if event == "testalarm1" then
  8.         print("range alarm "..param1)
  9.   elseif event == "testalarm2" then
  10.         print("min alarm " ..param1)
  11.   elseif event == "testalarm3" then
  12.         print("max alarm " .. param1)
  13.   else
  14.         sleep(1.5)
  15.   end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment