Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("right")
- function info()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Computer ID: ")
- print(os.getComputerID())
- print("Alle eZ-Connect Geraete senden auf Kanal 42")
- print("Nachrichten empfangen mit recieve")
- print("Nachrichten senden mit send")
- print("Benoetigt ein Wireless Modem an der rechten Seite")
- print("Beenden mit exit")
- end
- function recieve()
- print("Warte auf Nachricht...")
- event, modemSite, senderChannel, replyChannel, message = os.pullEvent("modem_message")
- print("")
- print("Nachricht erhalten:")
- print(message)
- term.write("Auf Kanal ")
- term.write(senderChannel)
- term.write(" mit Antwortkanal ")
- print(replyChannel)
- end
- function exit()
- print("Programm beendet")
- print("Computer wird nun neustarten")
- os.sleep(3)
- os.reboot()
- end
- function send()
- print("Sende Nachricht...")
- local message = read()
- modem.transmit(42, 42, message)
- print("Nachricht gesendet: ")
- print(message)
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- modem.open(42)
- local run = 0
- term.clear()
- term.setCursorPos(1,1)
- term.write("eZ-Connect")
- print("")
- sleep(2)
- while run ~= 1 do
- print("")
- command = read()
- if command == "info" then
- info()
- elseif command == "recieve" then
- recieve()
- elseif command == "send" then
- send()
- elseif command == "clear" then
- clear()
- elseif command == "exit" then
- exit()
- else
- print("Unbekannter Kommando")
- print("Hilfe mit info")
- os.sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment