2018-09-10 20:15:54 +00:00
|
|
|
#
|
|
|
|
# RouterOS script: mode-button-scheduler
|
|
|
|
# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
|
|
|
|
#
|
|
|
|
# act on multiple mode-botton presses from scheduler
|
|
|
|
|
|
|
|
:global "mode-button";
|
|
|
|
|
|
|
|
:local count ($"mode-button"->"count");
|
2018-09-13 20:07:58 +00:00
|
|
|
:local code ($"mode-button"->[ :tostr $count ]);
|
|
|
|
:local parsed [ :parse $code ];
|
2018-09-10 20:15:54 +00:00
|
|
|
|
|
|
|
:set ($"mode-button"->"count") 0;
|
|
|
|
/ system scheduler remove mode-button-scheduler;
|
|
|
|
|
2018-09-13 20:07:58 +00:00
|
|
|
:log info ("Acting on " . $count . " mode-button presses: " . $code);
|
|
|
|
:delay 1s;
|
2018-09-12 20:28:55 +00:00
|
|
|
$parsed;
|