Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
-- tower_tablet_addon.lua local tower_id = 5 local lastMsg = "" local lang = "de" local function ensureRednetOpen() for _, n in ipairs(peripheral.getNames()) do if peripheral.getType(n):match("modem") then rednet.open(n) break end end end ensureRednetOpen() local function send(cmd, task) if rednet.isOpen() then rednet.send(tower_id,{cmd=cmd,task=task}) lastMsg = task print("Letzte Aktion: "..lastMsg) end end while true do local e,key = os.pullEvent("key") if key==keys.one then send("toggle","power_toggle") elseif key==keys.two then send("toggle","alarm") elseif key==keys.three then send("toggle","door_main") elseif key==keys.q then break end end
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)