Advertisement
Phenox124

Untitled

Sep 2nd, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2.  
  3. function touch2()
  4.     event, a, b, c = os.pullEvent("monitor_touch")
  5.  
  6.     if a == front then
  7.         redstone.setOutput("top", false)
  8.         --os.sleep(3)
  9.         load()
  10.     end
  11. end
  12.  
  13. function touch()
  14.     event, a, b, c = os.pullEvent("monitor_touch")
  15.  
  16.     if a == front then
  17.         redstone.setOutput("top", true)
  18.         --os.sleep(3)
  19.         mon.clear()
  20.         mon.setBackgroundColor(colors.red)
  21.         mon.clear()
  22.         mon.setCursorPos(1, 3)
  23.         mon.write("Working")
  24.         --os.sleep(3)
  25.         touch2()
  26.     end
  27. end
  28.  
  29. function load()
  30.     --sleep(5)
  31.     mon.setBackgroundColor(colors.green)
  32.     mon.clear()
  33.     mon.setTextScale(1)
  34.     mon.setCursorPos(2, 3)
  35.     mon.write("Ready")
  36.     touch()
  37. end
  38.  
  39. function active()
  40.     rednet.send(202, "I'm Online!")
  41.     load()
  42. end
  43.  
  44. while true do
  45.     if rednet.isOpen() == false then
  46.             rednet.open("left")
  47.             active()
  48.         else
  49.             active()
  50.     end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement