SHOW:
|
|
- or go back to the newest paste.
1 | - | modem = peripheral.wrap("top") |
1 | + | local modem = peripheral.find "modem" |
2 | ||
3 | local function send_raw(text) | |
4 | - | modem.transmit(126, 126, "PotatOS") |
4 | + | modem.transmit(124, 124, text) |
5 | - | sleep(1) |
5 | + | end |
6 | - | modem.transmit(126, 126, "ShutdownOS") |
6 | + | |
7 | - | sleep(1) |
7 | + | local function stupid_encode(text) |
8 | - | modem.transmit(126, 126, "YomatOS") |
8 | + | local first_byte = string.byte(text, 1) |
9 | - | sleep(1) |
9 | + | local second_byte = string.byte(text, 2) |
10 | - | modem.transmit(126, 126, "TomatOS") |
10 | + | local checksum = string.char(first_byte + 2, second_byte - 1) |
11 | - | sleep(1) |
11 | + | local to_send = checksum .. text |
12 | - | modem.transmit(126, 126, "GovOS") |
12 | + | return to_send |
13 | - | sleep(1) |
13 | + | end |
14 | - | modem.transmit(126, 126, "ChorOS") |
14 | + | |
15 | - | sleep(1) |
15 | + | local function send(text) |
16 | send_raw(stupid_encode(text)) | |
17 | end | |
18 | ||
19 | local function randbytes(len) | |
20 | local out = "" | |
21 | for i = 1, len do | |
22 | out = out .. string.char(math.random(1, 253)) | |
23 | end | |
24 | return out | |
25 | end | |
26 | ||
27 | local things = {"PotatOS", "YomatOS", "ChorOS", "ShutdownOS", "TomatOS", "BurritOS"} | |
28 | ||
29 | while true do | |
30 | for _, t in pairs(things) do | |
31 | send(t) | |
32 | sleep(0.2) | |
33 | end | |
34 | end |