Advertisement
Alexr360

Stargate Controller Test 2

Apr 1st, 2025 (edited)
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. interface = peripheral.find("crystal_interface")
  2.  
  3. function dial(address)
  4.    
  5.     local addressLength = #address
  6.    
  7.     local start = interface.getChevronsEngaged() + 1
  8.    
  9.     for chevron = start, addressLength, 1
  10.     do
  11.         local symbol = address[chevron]
  12.        
  13.         if chevron % 2 == 0 then
  14.             interface.rotateClockwise(symbol)
  15.         else
  16.             interface.rotateAntiClockwise(symbol)
  17.         end
  18.        
  19.         while(not interface.isCurrentSymbol(symbol))
  20.         do
  21.             sleep(0)
  22.         end
  23.        
  24.         sleep(1)
  25.         interface.openChevron()
  26.         sleep(1)
  27.  
  28.         interface.closeChevron()
  29.         sleep(1)
  30.     end
  31. end
  32.  
  33. abydosAddress = {13,28,34,3,22,18,35,9,0}
  34.  
  35. overworldAddress = {26,17,7,19,4,24,21,10,0}
  36.  
  37. cavumAddress = {18, 7, 3, 36, 25, 15, 0}
  38.  
  39. chulakAddress = {18,14,21,15,2,13,19,35,0}
  40.  
  41. othersideAddress = {10, 28, 17, 21, 3, 27, 0}
  42.  
  43. print("Awaiting input:")
  44.  
  45. print("1 = Abydos")
  46. print("2 = Overworld")
  47. print("3 = Cavum Tenebrae")
  48. print("4 = Chulak")
  49. print("5 = Otherside")
  50.  
  51. input = tonumber(io.read())
  52. sleep(0)
  53.  
  54. if input == 1 then
  55.     dial(abydosAddress)
  56. elseif input == 2 then
  57.     dial(overworldAddress)
  58. elseif input == 3 then
  59.     dial(cavumAddress)
  60. elseif input == 4 then
  61.     dial(chulakAddress)
  62. elseif input == 5 then
  63.     dial(othersideAddress)
  64. else
  65.     print("Invalid input")
  66. end
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement