INCSlayer

portalcomputer

Dec 16th, 2012
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | None | 0 0
  1. function portal()
  2. local Locations = {}
  3. -- Name Your Locations Here:
  4. Locations[1] = ""
  5. Locations[2] = ""
  6. Locations[3] = ""
  7. Locations[4] = ""
  8. Locations[5] = ""
  9. Locations[6] = ""
  10. Locations[7] = ""
  11. Locations[8] = ""
  12. Locations[9] = ""
  13. Locations[10] = ""
  14. Locations[11] = ""
  15. Locations[12] = ""
  16. Locations[13] = ""
  17. Locations[14] = ""
  18. Locations[15] = ""
  19. Locations[16] = ""
  20. Locations[99] = "Portal Closed"
  21. -- Define Portal Turtle Here (if you do not know what this is use the command: print(os.getComputerID()) on the computer you will get a number put it after the equal sign below):
  22. local pt =
  23.  
  24.     mon = peripheral.wrap("top")
  25.     mon.setTextScale(2)
  26.     mon.setCursorPos(1,1)
  27.     mon.clearLine(1)
  28.     mon.write("Destination:")
  29.     mon.setCursorPos(1,2)
  30.     term.clear()
  31.     term.setCursorPos(1,1)
  32.     print ("Valid Destinations are:")
  33.     print ("01. " ..Locations[1])
  34.     print ("02. " ..Locations[2])
  35.     print ("03. " ..Locations[3])
  36.     print ("04. " ..Locations[4])
  37.     print ("05. " ..Locations[5])
  38.     print ("06. " ..Locations[6])
  39.     print ("07. " ..Locations[7])
  40.     print ("08. " ..Locations[8])
  41.     print ("09. " ..Locations[9])
  42.     print ("10. " ..Locations[10])
  43.     print ("11. " ..Locations[11])
  44.     print ("12. " ..Locations[12])
  45.     print ("13. " ..Locations[13])
  46.     print ("14. " ..Locations[14])
  47.     print ("15. " ..Locations[15])
  48.     print ("16. " ..Locations[16])
  49.     print ("Enter Destination ID: ")
  50.     Num1 = tonumber( read() )
  51.         mon.clearLine(2)
  52.         mon.write(Locations[Num1])
  53.         rednet.send(pt,""..Num1)
  54. end
  55.  
  56. function close()
  57. id, message = rednet.receive()
  58.     if message == "close" then
  59.         mon = peripheral.wrap("top")
  60.         mon.setTextScale(2)
  61.         mon.clear()
  62.         mon.setCursorPos(1,1)
  63.         mon.write("Destination:")
  64.         mon.setCursorPos(1,2)
  65.         mon.write("Portal Closed")
  66.     end
  67. end
  68.  
  69. while redstone.getInput("left") do
  70.         rednet.open("back")
  71.         parallel.waitForAny(portal, close)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment