Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local mon = peripheral.wrap("top")
  2. mon.clear()
  3. rednet.open("back")
  4. mon.setTextColor(colors.purple)
  5. mon.setCursorPos(3,1)
  6. mon.write("***TERMINAL***")
  7. mon = s
  8. ----------------------------------------------------------------------------
  9.  
  10. zmacknuto=false
  11. text="fermenter"
  12.  
  13. s.setBackgroundColor(colors.red)
  14. s.setCursorPos(5,3)
  15. s.write(text)
  16.  
  17. function klik(kx,ky)
  18. if ky==3 and ( kx > 4 and kx < 15) then
  19. print("zmena fermenter")
  20. zmacknuto = not zmacknuto
  21. if zmacknuto == true then
  22. s.setBackgroundColor(colors.green)
  23. rednet.send(244, "turtle1on")
  24. else
  25. s.setBackgroundColor(colors.red)
  26. rednet.send(244, "turtle1off")
  27. end
  28. s.setCursorPos(5,3)
  29. s.write(text)
  30. end
  31. end
  32.  
  33. while true do
  34. s.clear()
  35. local e,s,x,y = os.pullEvent("monitor_touch")
  36. klik(x,y)
  37. print(x..":"..y)
  38. local 244, message, distance = rednet.receive()
  39. print(message)
  40. sleep(0.1)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement