-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUnit.onStart_1.lua
More file actions
31 lines (25 loc) · 901 Bytes
/
Unit.onStart_1.lua
File metadata and controls
31 lines (25 loc) · 901 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
---sof---
system.print("LightCopy Starting...")
local possibleLights = {copyTo_1, copyTo_2, copyTo_3, copyTo_4, copyTo_5, copyTo_6, copyTo_7, copyTo_8, copyTo_9}
LightsList = {}
for i = 1, 9, 1 do
if possibleLights[i] then
table.insert(LightsList, possibleLights[i])
possibleLights[i].deactivate()
end
end
copyFrom.activate()
for i = 1, #LightsList, 1 do
system.print("... processing light #" .. i .. "...")
local thisLight = LightsList[i]
rgb_color = copyFrom.getColor()
thisLight.setColor(rgb_color[1], rgb_color[2], rgb_color[3])
thisLight.setBlinkingState(copyFrom.isBlinking())
thisLight.setOnBlinkingDuration(copyFrom.getOnBlinkingDuration())
thisLight.setOffBlinkingDuration(copyFrom.getOffBlinkingDuration())
thisLight.setBlinkingTimeShift(copyFrom.getBlinkingTimeShift())
thisLight.activate()
end
system.print("... *LightCopy Done!!")
unit.exit()
---eof---