forked from morefinances/qlua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_five.lua
More file actions
50 lines (33 loc) · 884 Bytes
/
example_five.lua
File metadata and controls
50 lines (33 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function OnInit()
do_it = true
progname="example_five: "
status = 0
mes_ind = 0
end
function OnStop()
do_it = false
message(progname.." завершение работы")
end
function OnDisconnected()
status = - 1
message(progname..'терминал отключен от сервера')
end
function main()
message(progname.." старт")
connect = isConnected()
if connect == 1 then
message(progname..' связь с сервером установлена')
status = 1
else
message(progname..'связи с сервером нет')
status = - 1
end
while do_it do
connect2 = isConnected()
if status == -1 and connect2 == 1 then
message(progname..' соединение с сервером восстановлено')
status = 1
end
sleep(1000)
end
end