Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 22420

Scripting • Re: New command in RouterOs 7

$
0
0
FWIW, I already had a GitHub project that compiled the REST schema, and as part of that there is an "inspect.json" that get generates with output of /console/inspect. I recently automated it all at GitHub, and put a tiny web page that has downloadable form of the "command schema":

https://tikoci.github.io/restraml

On the web page, I wrote a quick-and-dirty "diff tool" for output a recursive /console/inspect. So you can compare command difference in between various releases. Since it does this in the browser, it take may take a dozen seconds to show diffs.

And to also digress... There is a new [:convert from=byte-array] method in 7.15, I put a few examples here: viewtopic.php?t=57665#p1078218 – but it's useful to the /termina/inkey discussed above...
I'll digress a little from the main topic of the topic and give examples of the possibility of entering a line in the Terminal:
For /terminal/inkey, there is an handy method, in 7.15, to get the actual string of the char pressed, so you don't need to compare the ASCII int code. So if you run this code, and hit the letter "a", you can see you get the actual "a" back:
Code:
:put [/terminal/inkey]                                                   # 97:put [:convert from=byte-array to=raw {[/terminal/inkey]}]# a

Statistics: Posted by Amm0 — Fri May 31, 2024 8:31 pm



Viewing all articles
Browse latest Browse all 22420

Trending Articles