SHOW:
|
|
- or go back to the newest paste.
1 | term.redirect(peripheral.wrap("left")) | |
2 | term.clear() | |
3 | ||
4 | local ss = fs.open("ss","r") | |
5 | local data = ss.readAll() | |
6 | ss.close() | |
7 | textutils.unserialise(data) | |
8 | local stacker = {data} | |
9 | rednet.open("top") | |
10 | print("Stacker:") | |
11 | ||
12 | while true do | |
13 | senderId, message, protocol = rednet.receive() | |
14 | if protocol == "stacker" and senderId == 144 then | |
15 | term.clear() | |
16 | print("Stacker:") | |
17 | table.insert(stacker, message) | |
18 | table.sort(stacker, function (a, b) | |
19 | - | return #b < #a |
19 | + | return #a > #b |
20 | end) | |
21 | local ss = fs.open("ss","w") | |
22 | ss.write(table.concat(stacker,'\n')) | |
23 | ss.close() | |
24 | write(table.concat(stacker,'\n')) | |
25 | ||
26 | ||
27 | ||
28 | end | |
29 | end | |
30 |