Advertisement
Guest User

gate

a guest
Dec 2nd, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. m=peripheral.wrap("top")--sets the monitor to the top side
  2. gate=peripheral.wrap("stargate_1")-- wrap the gate connected by wired modem
  3. local net="right" -- set the side of the rednet cable
  4.  
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print("Super Gate Dialer v0.9")
  8. print("made by Landstryder")
  9. m.clear()
  10. m.setCursorPos(1,1)
  11. m.write("Gate Dialer Online")
  12.  
  13. --Put your gate addresses in below
  14. local ads={"urnonba","nqqymaa","iiaanga","nalzmha","qmjcnfa","amnumja","ocpbnka","lamnmpa","hiaanqa","dixfnba"}
  15. --
  16.  
  17. local c={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768}
  18. local cc={"White","Orange","Magenta","Light Blue","Yellow","Lime","Pink","Gray","Light Gray","Cyan","Purple","Blue","Brown","Green","Red","Black"}
  19. m.setCursorPos(1,2)
  20. m.write("current address library:")
  21.  
  22. function listgate()
  23. for it=1,#ads do
  24.  m.setCursorPos(1,it+2)
  25.  m.write(ads[it].." on channel "..cc[it])
  26. end
  27. end
  28.  
  29. listgate()
  30.  
  31. while true do
  32. if rs.getBundledInput(net)>0 then
  33.  for it=1,#ads do
  34.   if rs.testBundledInput(net,c[it]) then
  35.  gate.connect(ads[it])
  36.  m.clear()
  37.  m.setCursorPos(1,1)
  38.  m.write("connecting to address: "..ads[it])
  39.  sleep(45)
  40.  listgate()
  41.  end
  42.  end
  43. end
  44. sleep(1)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement