SkyNetCloud

Untitled

Nov 19th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. interface = peripheral.find("basic_interface")
  2.  
  3. function dial(address)
  4. local addressLength = #address
  5. local start = interface.getChevronsEngaged() + 1
  6.  
  7. for chevron = start,addressLength,1
  8. do
  9.  
  10. local symbol = address[chevron]
  11.  
  12. if chevron % 2 == 0 then
  13. interface.rotateClockwise(symbol)
  14. else
  15. interface.rotateAntiClockwise(symbol)
  16. end
  17.  
  18. while(not interface.isCurrentSymbol(symbol))
  19. do
  20. print("Feedback",interface.getRecentFeedback())
  21. sleep(0)
  22. end
  23.  
  24. sleep(1)
  25. print("Code",interface.raiseChevron())
  26. sleep(1)
  27. print("Code",interface.lowerChevron())
  28. sleep(1)
  29. end
  30. end
  31.  
  32. abydosAddress = {26,6,14,31,11,29,0}
  33. chulakAddress = {8,1,22,14,36,19,0}
  34. lanteaAddress = {18,20,1,15,14,7,19,0}
  35.  
  36. print("Avaiting input:")
  37. print("1 = Abydos")
  38. print("2 = Chulak")
  39. print("3 = Lantea")
  40. input = tonumber(io.read())
  41.  
  42. if input == 1 then
  43. dial(abydosAddress)
  44. elseif input == 2 then
  45. dial(chulakAddress)
  46. elseif input == 3 then
  47. dial(lanteaAddress)
  48. end
Add Comment
Please, Sign In to add comment