mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
mode-button-event: decrease interval, but update start time
This commit is contained in:
parent
1bbbe3a5a7
commit
28df37708c
1 changed files with 8 additions and 3 deletions
|
@ -8,7 +8,12 @@
|
|||
|
||||
:set ($"mode-button"->"count") ($"mode-button"->"count" + 1);
|
||||
|
||||
:if ([ :len [ / system scheduler find where name="mode-button-scheduler" ] ] = 0) do={
|
||||
:log info "Creating mode-button scheduler...";
|
||||
/ system scheduler add name=mode-button-scheduler on-event=mode-button-scheduler interval=5s;
|
||||
:local scheduler [ / system scheduler find where name="mode-button-scheduler" ];
|
||||
|
||||
:if ([ :len $scheduler ] = 0) do={
|
||||
:log info "Creating mode-button scheduler, counting presses...";
|
||||
/ system scheduler add name=mode-button-scheduler on-event=mode-button-scheduler interval=3s;
|
||||
} else={
|
||||
:log debug "Updating mode-button-scheduler...";
|
||||
/ system scheduler set $scheduler start-time=[ /system clock get time ];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue