SHOW:
|
|
- or go back to the newest paste.
1 | --Befehle | |
2 | -- Normal Light on [Zone] | |
3 | -- Normal Light off [Zone] | |
4 | ||
5 | --Variablen | |
6 | wModul = "left" --Angabe fΓΌr die Position des Wirless Modems | |
7 | - | Zone = "Schalfzimmer" |
7 | + | Zone = "Gang-Zentrale" |
8 | NormalLight = true | |
9 | RedLight = false | |
10 | ||
11 | --Code | |
12 | function Command() | |
13 | senderId, message, protocol = rednet.receive("1900Light") | |
14 | if (message == "Normal Light on " .. Zone or message == "Normal Light on ALL") then | |
15 | NormalLight = true | |
16 | redstone.setOutput("front", NormalLight) | |
17 | rednet.send(senderId, NormalLight, "1900Light") | |
18 | ||
19 | elseif (message == "Normal Light off " .. Zone or message == "Normal Light off ALL") then | |
20 | NormalLight = false | |
21 | redstone.setOutput("front", NormalLight) | |
22 | rednet.send(senderId, NormalLight, "1900Light") | |
23 | end | |
24 | - | elseif (message == "Red Light on " .. Zone or message == "Red Light on ALL") then |
24 | + | |
25 | - | RedLight = true |
25 | + | |
26 | - | redstone.setOutput("back",RedLight) |
26 | + | |
27 | - | rednet.send(senderId, RedLight, "1900Light") |
27 | + | |
28 | shell.run("clear") | |
29 | - | elseif (message == "Red Light off " .. Zone or message == "Red Light off ALL") then |
29 | + | |
30 | print("FΓΌr die Zone: " .. Zone) | |
31 | - | redstone.setOutput("back", RedLight) |
31 | + | |
32 | - | rednet.send(senderId, RedLight, "1900Light") |
32 | + | |
33 | print("Rotes Licht: " .. "Wurde komplett deaktiviert!") | |
34 | end | |
35 | ||
36 | --Einmal Code | |
37 | rednet.open(wModul) | |
38 | Dashboard() | |
39 | ||
40 | if NormalLight == true then | |
41 | redstone.setOutput("front", true) | |
42 | else | |
43 | - | print("Rotes Licht: " .. tostring(RedLight)) |
43 | + | |
44 | end | |
45 | ||
46 | while true do | |
47 | Command() | |
48 | end |