Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conSide = "back"
- icbmSide = "bottom"
- protocol = "iTnP"
- computerId = os.getComputerID()
- rednet.open(conSide)
- term.clear()
- term.setCursorPos(1, 1)
- if not rednet.isOpen(conSide) then
- print("Erro ao estabelecer conexao a rede Skynet.")
- sleep(3)
- os.reboot()
- end
- print("Conexao com Sistemas Skynet .. OK")
- print("Aguardando log in.")
- sleep(2)
- term.clear()
- x,y = term.getSize()
- term.setCursorPos(x/2 - 17, y/2 - 1)
- print("Username: ")
- term.setCursorPos(x/2 - 15, y/2)
- user = read()
- term.setCursorPos(x/2 - 17, y/2 + 1)
- print("Password: ")
- term.setCursorPos(x/2 - 15, y/2 + 2)
- pass = read("*")
- authString = "R.Check." .. user .. "." .. pass
- term.clear()
- term.setCursorPos(1, 1)
- function menu()
- icbm = peripheral.wrap(icbmSide)
- term.clear()
- x,y = term.getSize()
- term.setCursorPos(x/2 - 20, y/2)
- print("[1] Inserir Coords [2] Lancar [3] Sair")
- term.setCursorPos(x/2 - 10, y/2 + 1)
- c = read()
- if c == "1" then
- term.clear()
- term.setCursorPos(x/2 - 5, y/2 - 1)
- print("X:")
- term.setCursorPos(x/2 - 3, y/2 - 1)
- xc = read()
- term.setCursorPos(x/2 - 5, y/2)
- print("Y:")
- term.setCursorPos(x/2 - 3, y/2)
- yc = read()
- term.setCursorPos(x/2 - 5, y/2 + 1)
- print("Z:")
- term.setCursorPos(x/2 - 3, y/2 + 1)
- zc = read()
- icbm.setTarget(xc,yc,zc)
- menu()
- return
- elseif c == "2" then
- term.clear()
- term.setCursorPos(x/2 - 10, y/2)
- print("A Lancar Missil...")
- icbm.launch()
- term.setCursorPos(x/2 - 10, y/2 + 1)
- print("Missil Lancado.....")
- menu()
- return
- elseif c == "3" then
- os.reboot()
- end
- end
- while true do
- rednet.broadcast("R.Id", protocol)
- i1,m1,p1 = rednet.receive()
- print(i1)
- if i1 == m1 and p1 == protocol then
- rednet.send(i1, authString, protocol)
- i2,m2,p2 = rednet.receive()
- if i2 == i1 and p2 == protocol then
- if m2 == "Resp.True" then
- print("ok")
- menu()
- break
- else
- print("Dados Invalidos.")
- sleep(2)
- os.reboot()
- end
- else
- os.reboot()
- end
- else
- os.reboot()
- end
- end
Add Comment
Please, Sign In to add comment