Advertisement
ExVee

diag

Sep 7th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. dofile("config")
  2. dofile("compat")
  3.  
  4. listgate()
  5.  
  6. rs.setOutput(a,true) --keeps the worldanchor off till needed
  7.  
  8. while true do
  9. if rs.getBundledInput(net)>0 then
  10. if rs.testBundledInput(net,32768) then
  11. gate.disconnect()
  12. sleep(1)
  13. else
  14. rs.setOutput(a,false)
  15. for it=1,#ads do
  16. if rs.testBundledInput(net,c[it]) then
  17. local ok,err=pcall(gate.connect,ads[it])
  18. if not ok then
  19. print("There was a problem...")
  20. print(err)
  21. else
  22. m.clear()
  23. m.setCursorPos(1,1)
  24. m.write("connecting to:")
  25. m.setCursorPos(2,2)
  26. if adname[it]=="name" then
  27. m.write("address "..ads[it])
  28. else
  29. m.write(adname[it])
  30. end
  31. m.setTextScale(2)
  32. m.setCursorPos(4,4)
  33. m.write("CHEVRON")
  34. m.setCursorPos(4,6)
  35. m.write("ENCODED")
  36.  
  37. while not gate.isConnected() do
  38. m.setCursorPos(7,5)
  39. m.clearLine()
  40. m.write(string.format("%d",gate.getLockedChevronCount()))
  41. sleep(0.3)
  42. end
  43. m.clear()
  44. m.setCursorPos(5,4)
  45. m.write("GATE")
  46. m.setCursorPos(3,5)
  47. m.write("CONNECTED")
  48.  
  49. while gate.isConnected() do
  50. if rs.testBundledInput(net,32768) then
  51. gate.disconnect()
  52. sleep(0.3)
  53. else
  54. sleep(1)
  55. end
  56. end
  57. end
  58. rs.setOutput(a,true)
  59.  
  60. m.clear()
  61. m.setTextScale(1)
  62. m.setCursorPos(1,1)
  63. m.write("Gate Dialer Online")
  64. listgate()
  65. end
  66. end
  67. end
  68. end
  69. sleep(1)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement