mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-28 11:59:33 +00:00
telegram-chat: use :break in loop
This commit is contained in:
parent
11ec566d91
commit
d3bde6cb46
1 changed files with 1 additions and 2 deletions
|
|
@ -68,12 +68,12 @@
|
||||||
|
|
||||||
:local Data false;
|
:local Data false;
|
||||||
:for I from=1 to=4 do={
|
:for I from=1 to=4 do={
|
||||||
:if ($Data = false) do={
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||||
("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
|
("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
|
||||||
$TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
|
$TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
|
||||||
:set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
|
:set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
|
||||||
|
:break;
|
||||||
} do={
|
} do={
|
||||||
:if ($I < 4) do={
|
:if ($I < 4) do={
|
||||||
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
|
$LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
|
||||||
|
|
@ -81,7 +81,6 @@
|
||||||
:delay (($I * $I) . "s");
|
:delay (($I * $I) . "s");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($Data = false) do={
|
:if ($Data = false) do={
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue