mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-17 16:21:15 +02:00
mode-button: $ModeButtonScheduler: explicitly name the variable
This commit is contained in:
parent
f8a55860af
commit
e51191035b
1 changed files with 8 additions and 4 deletions
|
@ -26,6 +26,8 @@
|
||||||
:if ([ :len $Scheduler ] = 0) do={
|
:if ([ :len $Scheduler ] = 0) do={
|
||||||
$LogPrint info $ScriptName ("Creating scheduler _ModeButtonScheduler, counting presses...");
|
$LogPrint info $ScriptName ("Creating scheduler _ModeButtonScheduler, counting presses...");
|
||||||
:global ModeButtonScheduler do={
|
:global ModeButtonScheduler do={
|
||||||
|
:local FuncName $0;
|
||||||
|
|
||||||
:global ModeButton;
|
:global ModeButton;
|
||||||
|
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
|
@ -54,7 +56,7 @@
|
||||||
|
|
||||||
:if ([ :len $Code ] > 0) do={
|
:if ([ :len $Code ] > 0) do={
|
||||||
:if ([ $ValidateSyntax $Code ] = true) do={
|
:if ([ $ValidateSyntax $Code ] = true) do={
|
||||||
$LogPrint info $0 ("Acting on " . $Count . " mode-button presses: " . $Code);
|
$LogPrint info $FuncName ("Acting on " . $Count . " mode-button presses: " . $Code);
|
||||||
|
|
||||||
:for I from=1 to=$Count do={
|
:for I from=1 to=$Count do={
|
||||||
$LEDInvert;
|
$LEDInvert;
|
||||||
|
@ -69,13 +71,15 @@
|
||||||
:do {
|
:do {
|
||||||
[ :parse $Code ];
|
[ :parse $Code ];
|
||||||
} on-error={
|
} on-error={
|
||||||
$LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed with runtime error!");
|
$LogPrint warning $FuncName \
|
||||||
|
("The code for " . $Count . " mode-button presses failed with runtime error!");
|
||||||
}
|
}
|
||||||
} else={
|
} else={
|
||||||
$LogPrint warning $0 ("The code for " . $Count . " mode-button presses failed syntax validation!");
|
$LogPrint warning $FuncName \
|
||||||
|
("The code for " . $Count . " mode-button presses failed syntax validation!");
|
||||||
}
|
}
|
||||||
} else={
|
} else={
|
||||||
$LogPrint info $0 ("No action defined for " . $Count . " mode-button presses.");
|
$LogPrint info $FuncName ("No action defined for " . $Count . " mode-button presses.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/system/scheduler/add name="_ModeButtonScheduler" \
|
/system/scheduler/add name="_ModeButtonScheduler" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue