Advertisement
Guest User

startup

a guest
Jul 10th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. rednet.open("back")
  2. aa = "Access Allow"
  3. ad = "Access Denied"
  4.  
  5. function o()
  6. e,s,m = os.pullEvent("rednet_message")
  7. term.write("Computer: #"..s.." Send: '"..m.."'")
  8. cX,cY = term.getCursorPos()
  9. term.setCursorPos(1,math.floor(cY+1))
  10. if a(s) == aa then
  11. term.setTextColor(colors.green)
  12. term.write(aa)
  13. if m == "on" then
  14. rs.setOutput("top",true)
  15. elseif m == "off" then
  16. rs.setOutput("top",false)
  17. end
  18. else
  19. term.setTextColor(colors.red)
  20. term.write(ad)
  21. end
  22. term.setTextColor(colors.white)
  23. cX,cY = term.getCursorPos()
  24. term.setCursorPos(1,math.floor(cY+1))
  25. o()
  26. end
  27. function a(s)
  28. if s == 0 then
  29. return aa
  30. else
  31. return ad
  32. end
  33. end
  34. o()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement