Guest User

startup

a guest
Feb 4th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. m = peripheral.wrap("back")
  2. m.open(51)
  3. local function pulse(side)
  4. rs.setOutput(side, true)
  5. sleep(3)
  6. rs.setOutput(side,false)
  7. end
  8. Tr = true
  9. function os.pullEvent()
  10. local event, p1,p2,p3,p4,p5 = os.pullEventRaw()
  11. if event == "terminate" then write("For terminate need password:")
  12. p = read("*")
  13. if p == "p" then Tr = false end end
  14. return event,p1,p2,p3,p4,p5
  15. end
  16.  
  17. while Tr do
  18. Recive = {"","",""}
  19. Recive[1],Recive[2],Recive[3],Recive[4],Recive[5] = os.pullEvent()
  20. pL = fs.list("Assets")
  21. if Recive[1] == "player" or "modem_message" then
  22. if Recive[1] == "modem_message" then
  23. for k,v in string.gmatch(Recive[5], "(%w+)=(%w+)") do
  24. if k == "rOpen" then
  25. pulse("right")
  26. end
  27. end
  28. else
  29. for i =1 , 10 ,1 do
  30. if Recive[3] == pL[i] then
  31. pulse("right")
  32. end
  33. end
  34. end
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment