SHOW:
|
|
- or go back to the newest paste.
1 | - | local event = require("event") |
1 | + | local event = require("event") |
2 | - | local g = require("component").openperipheral_bridge |
2 | + | local g = require("component").openperipheral_bridge |
3 | - | |
3 | + | |
4 | - | function list(_,_,nick,_,com) |
4 | + | function list(_,_,nick,_,com) |
5 | - | if com == "clear" then |
5 | + | if com == "clear" then |
6 | - | clear() |
6 | + | clear() |
7 | - | elseif com == hellocomp then |
7 | + | elseif com == hellocomp then |
8 | - | hellocomp() |
8 | + | hellocomp() |
9 | - | end |
9 | + | end |
10 | - | else |
10 | + | else |
11 | - | g.addText(5,2,"Неверная команда.",0xFF0000) |
11 | + | g.addText(5,2,"Неверная команда.",0xFF0000) |
12 | - | g.sync() |
12 | + | g.sync() |
13 | - | os.sleep(5) |
13 | + | os.sleep(5) |
14 | - | g.clear() |
14 | + | g.clear() |
15 | - | g.syc() |
15 | + | g.syc() |
16 | - | end |
16 | + | end |
17 | - | end |
17 | + | end |
18 | - | |
18 | + | |
19 | - | function clear() |
19 | + | function clear() |
20 | - | g.clear() |
20 | + | g.clear() |
21 | - | g.sync() |
21 | + | g.sync() |
22 | - | end |
22 | + | end |
23 | - | |
23 | + | |
24 | - | function hellocomp() |
24 | + | function hellocomp() |
25 | - | g.clear() |
25 | + | g.clear() |
26 | - | g.addBox(1,1,60,10,0xFFFFFF,0.2) |
26 | + | g.addBox(1,1,60,10,0xFFFFFF,0.2) |
27 | - | g.addText(5,2,"Hello, Mikhail!",0xFF0000) |
27 | + | g.addText(5,2,"Hello, Mikhail!",0xFF0000) |
28 | - | g.sync() |
28 | + | g.sync() |
29 | - | end |
29 | + | end |
30 | - | |
30 | + | |
31 | - | --while true do |
31 | + | --while true do |
32 | - | --end |
32 | + | --end |
33 | event.listen("glasses_chat_command",list) |