-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.lua
74 lines (68 loc) · 1.65 KB
/
run.lua
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
do
local dealnow
dealnow = function()
local itm = _G.itm
pat[5] = itm
local stateNo = _G.stateNo
if func == "comm" or func == "comf" then
pat[2] = (func == "comm") and 0 or 2
if comm == "ON" then
pat[6] = 2
if stateNo == 0 then
table.insert(itmState,{itm})
elseif stateNo ~= 0 and itm < 11 then
itmState[stateNo][2] = itmState[stateNo][3]
end
elseif comm == "OFF" then
pat[6] = 0
if stateNo > 0 and itm > 10 then
itmState[stateNo] = nil
elseif stateNo > 0 and itm <11 then
itmState[stateNo][2] = 0
end
end
end
if func == "coft" then pat[2] = 2
pat[6] = 25
local time = tonumber(comm) or 0
if time < 256 then
pat[7] = 5
pat[8] = time
elseif time < 65535 then
pat[7] = 6
pat[8] = bit.band(time, 0xFF)
pat[9] = bit.rshift(time, 8)
else
return
end
end
if func == "askf" then
pat[2] = 2
pat[6] =128
end
if func == "bitr" then
pat[2] = 0
pat[3] = 0
if comm == "ON" then pat[6] = 15
else pat[6] = 9
end
end
if func == "bitf" then
pat[2] = 2
pat[3] = 0
if comm == "ON" then pat[6] = 15
else pat[6] = 9
end
end
if func == "birc" then
pat[2] = 1
pat[3] = 3
if comm == "ON" then pat[6] = 15
else pat[6] = 9
end
end
comm, itm, func = "", "", ""
dofile('writeMTRF.lua')
end
dealnow()
end