SHOW:
|
|
- or go back to the newest paste.
| 1 | -- Repeater 5GBPS / 7GBPS | |
| 2 | -- Gateway 80 (WEB door) | |
| 3 | input = "left" | |
| 4 | output = "right" | |
| 5 | ||
| 6 | modem = peripheral.wrap(input) | |
| 7 | ||
| 8 | modemout = peripheral.wrap(output) | |
| 9 | ||
| 10 | modem.setListening(80, true) | |
| 11 | modem.setListening(51, true) | |
| 12 | modemout.setListening(80, true) | |
| 13 | modemout.setListening(51, true) | |
| 14 | ||
| 15 | while true do | |
| 16 | ||
| 17 | event, side, id, chn, msg = os.pullEvent("lan_message")
| |
| 18 | ||
| 19 | if chn == 80 then | |
| 20 | if msg == "sussy baka" then | |
| 21 | print("Error 404")
| |
| 22 | else | |
| 23 | if side == "left" then | |
| 24 | modemout.sendChannel(80, msg) | |
| 25 | print("Send request "..msg.." to "..side)
| |
| 26 | else | |
| 27 | modem.sendChannel(80, msg) | |
| 28 | print("Send request "..msg.." to "..side)
| |
| 29 | end | |
| 30 | end | |
| 31 | ||
| 32 | event, sid, ids, ch, ms = os.pullEvent("lan_message")
| |
| 33 | sleep(1.5) | |
| 34 | if ms == "sussy baka" then | |
| 35 | print("Error 404")
| |
| 36 | else | |
| 37 | if sid == "left" then | |
| 38 | modemout.sendChannel(80, ms) | |
| 39 | print("Received response from 144.91.97."..ids)
| |
| 40 | else | |
| 41 | modem.sendChannel(80, ms) | |
| 42 | print("Received response from 144.91.97."..ids)
| |
| 43 | end | |
| 44 | end | |
| 45 | elseif chn == 51 then | |
| 46 | if msg == "sussy baka" then | |
| 47 | print("Error 404")
| |
| 48 | else | |
| 49 | if side == "left" then | |
| 50 | modemout.sendChannel(51, msg) | |
| 51 | print("Send request "..msg.." to "..side)
| |
| 52 | else | |
| 53 | modem.sendChannel(51, msg) | |
| 54 | print("Send request "..msg.." to "..side)
| |
| 55 | end | |
| 56 | end | |
| 57 | ||
| 58 | event, sid, ids, ch, ms = os.pullEvent("lan_message")
| |
| 59 | sleep(1.5) | |
| 60 | if ms == "sussy baka" then | |
| 61 | print("Error 404")
| |
| 62 | else | |
| 63 | if sid == "left" then | |
| 64 | modemout.sendChannel(51, ms) | |
| 65 | print("Received response from 144.91.97."..ids)
| |
| 66 | else | |
| 67 | modem.sendChannel(51, ms) | |
| 68 | print("Received response from 144.91.97."..ids)
| |
| 69 | end | |
| 70 | end | |
| 71 | end | |
| 72 | sleep(0.1) | |
| 73 | end | |
| 74 | ||
| 75 |