Not really-really.I need to understand more about AI works but do know that it uses a lot on existing knowledge so as RouterOS is relatively niche, there isn't as much source material for scripting such as for PowerShell. What I don't know is whether AI understands the syntax of the language and therefore can write any new code.
Thanks for providing this valuable resource ... it did help me solve some problems effectively ...Try our own AI bot. It's not very good at scripting ...
Maybe you missed it, but the linked page has a chat bot in the corner. I was not talking about emailing support.@robmaltsystems so basically this means "if you are able to formulate the problem in full sentences with a lot of details" MT support will create script for you, not sure about that, but if @normis says so why not to believe![]()
Hi there!I'm a LLM chatbot and I might not answer all questions perfectly, I make mistakes! My knowledge is based on the MikroTik documentation, which you can read here to get more in-depth knowledge.
Write your question in full sentences, this is not a search box.
What I don't know is whether AI understands the syntax of the language and therefore can write any new code.
How to convert string value into boolean type value with ROS script?Hi there!I'm a LLM chatbot and I might not answer all questions perfectly, I make mistakes! My knowledge is based on the MikroTik documentation, which you can read here to get more in-depth knowledge.
Write your question in full sentences, this is not a search box.
This resutls myBool variable with nil valueYou can use the :tobool command in RouterOS scripting to convert a variable to a boolean value. Example:
This will convert the string "true" to a boolean value.Code: Select all:local myStr "true" :local myBool [:tobool $myStr] :put $myBool
To convert a string to a boolean in RouterOS scripting, the string must be exactly "true" or "false" (case-sensitive). Any other value will result in a nil value when using :tobool.
Example:Only "true" and "false" strings are valid for conversion to boolean.Code: Select all:local myStr "true" :local myBool [:tobool $myStr] :put $myBool # will output true :local myStr2 "false" :local myBool2 [:tobool $myStr2] :put $myBool2 # will output false :local myStr3 "yes" :local myBool3 [:tobool $myStr3] :put $myBool3 # will output nil
/console/inspect request=syntax path=beep
Columns: TYPE, SYMBOL, SYMBOL-TYPE, NESTED, NONORM
TYPE SYMBOL SYMBOL-TYPE NESTED NONORM
syntax collection 0 yes
syntax as-value explanation 1 no
syntax frequency explanation 1 no
syntax length explanation 1 no
That's been my long assumption too. I suspect MikroTik could cut-and-paste the presumed Lex/Yacc code into ChatGPT and ask it to generate a BNF. And with BNF, you're closer to being have some LSP (which is my bigger grip since then any editor could accurately syntax check things)I'm pretty convinced they are using something like Lex/Yacc or Flex/Bison
Agreed. Now I'll offer if you submit a bug in with "Docs - " in title, MikroTik has been pretty responsive to fix the docs when reported in JIRA. i.e. I just submitted one for :beep's syntax, SUP-186687.like Microsoft, have done and add a link for user comments on each help page? They already have the tools for it, so how difficult can it be??
100%Since MT already uses Confluence/Jira, they can just publish a link
It is ChatGPT 4.5 with training from our sources added.Yeah, it’s probably because MT picked some cheap or freebie version that can’t really handle much, like Gemini 2.0 Flash-mini or similar.![]()
The award for Quote of the Year 2025 goes to ...... Normis .... if only such a prize existedTheir model naming is worse than mikrotiks product naming.
MikroTik has always responded to these "doc bugs". e.g. docs on :beep were fixed from above, and now picked up by Dude AI:Since MT already uses Confluence/Jira, they can just publish a link to each page that automatically creates a ticket with a comment.
It gets close, but who you'd already need to know how VRRP works to spot errors:please provide the configuration needed to setup two hEX-S routers using VRRP on a WAN side. Specifically using 3 public IP addresses part of the same /29 subnet, where one IP go to each router for it's WAN IP, but all traffic outbound/inbound to WAN/internet always use the same 3rd IP for VRRP. The specific IP in WAN subnet to use are 100.1.1.1 hex1, 100.1.1.2 hex2, 100.1.1.3 for the VRRP address, and a gateway of 100.1.1.4.. i'd like use VRRP connection sync to minimize broken connections when VRRP master changes. it critical all traffic use same IP to internet.
/ip address
add address=100.1.1.1/29 interface=ether1
add address=100.1.1.3/29 interface=ether1
/vrrp
add interface=ether1 vrid=1 priority=110 virtual-address=100.1.1.3
/ip route
add gateway=100.1.1.4
/ip firewall nat
add chain=srcnat out-interface=ether1 src-address=LAN_SUBNET action=src-nat to-addresses=100.1.1.3
/connection tracking
set enabled=yes
/connection tracking sync
set enabled=yes
You do get close the underlying AST using /console/inspect. For example, using request=highlight will, essentially, extract the token types from some script/config:It's not hard at all. LLM models just need to be trained with formal syntax or grammar specification languages like EBNF, ANTLR, etc and might be complemented with structured representations such as ASTs. There are plenty of tools and well-documented processes for this online.
:global badconfig "/ip address
add address=100.1.1.1/29 interface=ether1
add address=100.1.1.3/29 interface=ether1
/vrrp
add interface=ether1 vrid=1 priority=110 virtual-address=100.1.1.3
/ip route
add gateway=100.1.1.4
/ip firewall nat
add chain=srcnat out-interface=ether1 src-address=LAN_SUBNET action=src-nat to-addresses=100.1.1.3
/connection tracking
set enabled=yes
/connection tracking sync
set enabled=yes"
:global tokens [/console/inspect request=highlight input=$badconfig as-value]
:foreach k,v in=($tokens->"highlight") do={:if ($v="error") do={:put "error found at $k"}}
dir;dir;dir;none;dir;dir;dir;dir;dir;dir;dir;none;
cmd;cmd;cmd;none;arg;arg;arg;arg;arg;arg;arg;syntax-meta;none;none;none;none;none;none;none;none;
none;syntax-meta; [...]; dir;error;
Linked example by @infabo points out where correct syntax (no error by interpreter) results unpredictable behavior where function is called inside square brackets multiple times without handling return value. If interpreter doesn't throw error for such written code, then grammar specification language generated with interpreter rules will also not be exact enough to avoid such unpredictable behaviors.
All roads lead to improving docs, and perhaps more "wizards" in UI or at least docs with complete examples to avoid needing AI (or at LLMs)...Still it needs to learn by actual good examples which for rsc there are not much available as for other languages which can mislead AI.
Clearly, you let it off the hook with an easy oneTried another one with Dude AI. And it's similar with config (which is essentially still scripting) – while perhaps LLM get "closer" for standard config... but ,it does not know the needed order of operations and names are inconsistent.
For example, I tried a somewhat more complex prompt for VRRP configuration for two routers:It gets close, but who you'd already need to know how VRRP works to spot errors:please provide the configuration needed to setup two hEX-S routers using VRRP on a WAN side. Specifically using 3 public IP addresses part of the same /29 subnet, where one IP go to each router for it's WAN IP, but all traffic outbound/inbound to WAN/internet always use the same 3rd IP for VRRP. The specific IP in WAN subnet to use are 100.1.1.1 hex1, 100.1.1.2 hex2, 100.1.1.3 for the VRRP address, and a gateway of 100.1.1.4.. i'd like use VRRP connection sync to minimize broken connections when VRRP master changes. it critical all traffic use same IP to internet.
Code: Select all/ip address add address=100.1.1.1/29 interface=ether1 add address=100.1.1.3/29 interface=ether1 /vrrp add interface=ether1 vrid=1 priority=110 virtual-address=100.1.1.3 /ip route add gateway=100.1.1.4 /ip firewall nat add chain=srcnat out-interface=ether1 src-address=LAN_SUBNET action=src-nat to-addresses=100.1.1.3 /connection tracking set enabled=yes /connection tracking sync set enabled=yes
You'll note my prompt is very exact... otherwise it does not get even this close. I tried a more simple prompt for VRRP configuration than above first... and only with a lot of prompting using the magic work "sync-connections" did even know that was a feature, it asserts many times there was no way to sync connections. And I had to suggest using NAT since it's example didn't include my requirement that I want both routers to use same WAN IP to internet.
Or the JIRA list of bugs....And polishing interpreter will not hurt.
Still it needs to learn by actual good examples which for rsc there are not much available as for other languages which can mislead AI.
Currently it is hard to impossible - because formal syntax or grammar definitions do not exist. So LLM will deliver bull**t until forever.It's not hard at all. LLM models just need to be trained with formal syntax or grammar specification languages like EBNF, ANTLR, etc and might be complemented with structured representations such as ASTs. There are plenty of tools and well-documented processes for this online.
Currently it is hard to impossible - because formal syntax or grammar definitions do not exist. So LLM will deliver bull**t until forever.
https://help.mikrotik.com/docs/spaces/R ... 2/REST+APIStarting from RouterOS v7.1beta4, it is implemented as a JSON wrapper interface of the console API.
Sorry, but in what sense, I don't understand...the unique charm of RouterOS scripting isn't lost when someone stumbles upon rextended’s script collection.