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
-- ender_master.lua (Gecorrigeerd: 'goto' en 'local' scope) -- ... (Configuratie, Hulpfuncties, en Initialisatie blijven hetzelfde) ... local function main() local ender_modem = initialize() -- NIEUW: DECLAREER ALLE LOKALE VARIABELEN HIER local input = nil local signal_number = nil local timer_duration = nil -- Deze variabele veroorzaakte de fout -- Start van de while lus while true do display_color_map() write("Voer signaalnummer in (1 t/m 16, 99, 100) of 'quit': ") input = read() if input and string.lower(input) == "quit" then break end -- Gebruik de bestaande lokale variabele, zonder 'local' ervoor. signal_number = tonumber(input) if not signal_number or signal_number < 1 or signal_number > 100 or (signal_number > 16 and signal_number < 99) then print("[FOUT] Ongeldig signaalnummer.") sleep(1) goto continue_loop end timer_duration = 0 -- Reset naar 0 if signal_number ~= 99 and signal_number ~= 100 then write("Voer timer (sec) in (0 voor permanente toggle): ") local timer_input = read() timer_duration = tonumber(timer_input) or 0 if timer_duration < 0 then timer_duration = 0 end end local message_table = { signal = signal_number, timer = timer_duration } local success, err = pcall(ender_modem.transmit, ender_modem, CHANNEL, message_table) if success then print(string.format("[VERZONDEN] Signaal: %d | Timer: %d", signal_number, timer_duration)) if timer_duration > 0 then print(string.format(" -> %d seconden timer geactiveerd op Slave PC.", timer_duration)) end else print(string.format("[FOUT] Fout bij verzenden: %s", err)) end ::continue_loop:: print("\n----------------------------------\n") end if ender_modem.close then ender_modem.close(CHANNEL) end print("[INFO] Programma beƫindigd. Modem gesloten.") end main()
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)