Community discussions

MikroTik App

Search found 491 matches

  • 1
  • 2
by Sertik
Thu Oct 31, 2024 1:51 pm
Forum: Scripting
Topic: Command to remove a Value [SOLVED]
Replies: 6
Views: 2106

Re: Command to remove a Value [SOLVED]

LOL :D :D :D
by Sertik
Sat Oct 26, 2024 6:41 pm
Forum: Scripting
Topic: MikroVoice for Mikrotik
Replies: 3
Views: 1468

Re: MikroVoice for Mikrotik

A simple Telegram Terminal has been made for executing MikroVoice System commands from the Telegram chatbot. Useful for test listening to system messages, and also simply as a remote control for a music center (after all, a lot of music can be recorded on the flash drive of MikroVoice mp3 players). ...
by Sertik
Thu Oct 24, 2024 10:47 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

If you need to pass more arguments or/and named arguments, all of them must be specified in :parse In general, the final phrase for declaring and immediately calling a recursive function call without specifying its name is as follows: [[:parse "global $[:pick $0 1 [:len $0]]; [$0 $1 $2 $Par1 $P...
by Sertik
Thu Oct 24, 2024 10:18 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

This example illustrates the correct solution:
:global CountDown do={
:if ($1>0) do={:put $1; :set $1 ($1-1);[[:parse "global $[:pick $0 1 [:len $0]]; [$0 $1]"]];}
:return "end"
}

:put [$CountDown 5]
5
4
3
2
1
end
by Sertik
Thu Oct 24, 2024 10:12 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

you can pass arguments during a recursive call like this:
[[:parse "global $[:pick $0 1 [:len $0]]; [$0 mama]"]]
by Sertik
Thu Oct 24, 2024 8:58 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

It turned out to be much simpler. To call a function recursively without specifying its name, you don’t need to declare it internally at all. Simple enough: [$0] :global AnyName do={ :if ($1="test") do={ [$0] :put "Recursive call without mentioning the function name works"} :put ...
by Sertik
Thu Oct 24, 2024 8:34 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

It turns out that I was happy early. The syntax of the constructs passes, but the execution does not. We still need to dig deeper.
by Sertik
Wed Oct 23, 2024 4:08 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

I thought about it, but it turned out, as always, only after Rex’s blessing: :global AnyName do={ :if ($1="test") do={ [[:parse [:parse ":global [:pick \$$0 1 [:len \$$0]]"]]]; [[:parse [:parse "[:pick \$$0 1 [:len \$$0]]"]]] :put "Recursive call without mentioning...
by Sertik
Wed Oct 23, 2024 1:25 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

I didn’t miss this... By :parse inside :parse you mean something like this construction:

[[:parse "[:parse [/system script get $msgTxt source]] $Parametr1 $Parametr2"]]
by Sertik
Wed Oct 23, 2024 12:11 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

won't spoil it, but just rename the function...
Okay, I'll dig around myself, maybe it will work...
by Sertik
Wed Oct 23, 2024 11:08 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

In this case, I just wanted to make a recursive call to the function so that its name could be taken from $0, and not specified explicitly. This is necessary so that if someone other than me changes the name of this function, its operation will not be disrupted. Is this possible?
by Sertik
Tue Oct 22, 2024 9:25 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

I also want to ask Rex. For example, there is a function in which I want to make a recursive call. We do it as usual like this: :global MT do={:global MT; [$MT]; :put $0} How can I call her without explicitly mentioning her name? That is, I want to make it so that if the function itself is renamed, ...
by Sertik
Tue Oct 22, 2024 1:19 pm
Forum: Scripting
Topic: MikroVoice for Mikrotik
Replies: 3
Views: 1468

Re: MikroVoice for Mikrotik

by Sertik
Thu Oct 17, 2024 3:25 pm
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

I need it for another reason. Thank you, Teacher.

Also /user get admin last-logged-in shows the time of the last previous, and not the current login of the administrator to the router.
by Sertik
Thu Oct 17, 2024 3:12 pm
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

That's it, I figured it out. This is how it works in ROS 7 [:tonsec] not needed :local SchedName "check_login" :local userName "admin" :local Stime ([pick [/system scheduler get value-name=next-run [find name=$SchedName]] 11 19] - [/system scheduler get value-name=interval [find ...
by Sertik
Thu Oct 17, 2024 11:07 am
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

ROS7 does not find syntax errors in my script. There's a timing error...
by Sertik
Thu Oct 17, 2024 11:06 am
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

I might misread (should use reading glasses), do you use ~ instead of = ?
Yes, I use ~ in
:foreach i in=[/log find message~"user $userName logged in from" && [:tonsec time]>=$lstime] do={
but who forbids me to do this?
by Sertik
Thu Oct 17, 2024 11:05 am
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

:put ([/system scheduler get value-name=next-run [find name~"Load"]]) invalid internal item number Do you have a scheduler job named "Load"? next-run is in /system scheduler ROS7 It's better to be more specific, or maybe you have several tasks in the Scheduler that include “Load...
by Sertik
Thu Oct 17, 2024 9:46 am
Forum: Scripting
Topic: Auto Update Scheduler
Replies: 6
Views: 895

Re: Auto Update Scheduler

Everything is right. Russian roulette is when they turned the drum of a revolver loaded with one cartridge and shot themselves in the temple.
Comparable to the Router OS auto upgrade.
by Sertik
Thu Oct 17, 2024 9:03 am
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

Re: where is the error?

Didn't change anything, just converted all the time intervals into seconds? ...
by Sertik
Wed Oct 16, 2024 7:58 pm
Forum: Scripting
Topic: where is the error?
Replies: 10
Views: 396

where is the error?

There is a working script for Router OS 6 in the Scheduler that reports the admin login to the router: :local lstime ([/system scheduler get value-name=next-run [find name="login"]] - [/system scheduler get value-name=interval [find name="login"]] * 2); :foreach i in=[/log find m...
by Sertik
Tue Oct 15, 2024 4:10 pm
Forum: Scripting
Topic: Auto Update Scheduler
Replies: 6
Views: 895

Re: Auto Update Scheduler

name=russian-roulette
:lol:
by Sertik
Wed Oct 09, 2024 10:47 am
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

Thank you very much, Amm0, for your advice and help. In the end, everything worked out for me and it works. I have modified the firmware of the programmable version of the USB GPIO EXTENDER T so that it returns OK in the responses and now the device is adequately supported /ppp-client at-chat Mikrot...
by Sertik
Sat Sep 28, 2024 8:52 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

O`K
by Sertik
Fri Sep 27, 2024 3:58 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

Thank you very much. I will try.
by Sertik
Fri Sep 27, 2024 2:53 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

I didn't understand everything, but I probably got the gist. If my device does, say, sprintf(&UART0.TX, "A%d\n", PA4.VALUE) by sending A11101\n to TX, then in order for this to work correctly with AT-CHAT, do I need to return OK\r\n\A11101\r\n ? That is, you need to add "OK" ...
by Sertik
Fri Sep 27, 2024 1:07 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

Please tell me, Amm0! Do you not know how the support for AT commands works? I mean, how should the device accessed by the ppp-out interface return the data so that it is "correctly" returned by the interface? I'll explain. There is a programmable version of the device that I described her...
by Sertik
Thu Sep 26, 2024 10:06 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

Re: USB GPIO EXTENDER

This is good. It would be great if they added this feature for the USB port too.
But in ROS 6 they won't add this...
by Sertik
Thu Sep 26, 2024 9:52 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

:global invBinaryString do={ :local bstr $1 :local asString false :if ($2 = "as-string") do={:set asString true} :local barr [:toarray ""] :for i from=0 to=([:len $bstr]-1) do={:set ($barr->$i) (![:tobool [:tonum [:pick $bstr $i ($i+1)]]])} :if $asString do={ :local xorstr "...
by Sertik
Thu Sep 26, 2024 9:48 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

{ :local invert01onstr do={ :local result "" :for i from=0 to=([:len $1] -1) do={ :if ([:pick $1 $i (1 + $i)] = "1") do={:set result ($result . "0")} else={:set result ($result . "1")} } :return $result } This is what we need. Very simple and great! Thanks Re...
by Sertik
Thu Sep 26, 2024 9:42 pm
Forum: Scripting
Topic: USB GPIO EXTENDER
Replies: 11
Views: 990

USB GPIO EXTENDER

The issue of managing 220V loads from a Mikrotik router was raised several times on the forum. Another normal solution could be to use the USB GPIO EXTENDER module from the Russian company Open Development http://open-dev.ru https://habrastorage.org/webt/1j/-6/al/1j-6alhkvj3qomd_g419xmr7ns0.png The ...
by Sertik
Wed Sep 25, 2024 3:07 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

The proposed options are not shorter than mine... We need to write a function that XORs a binary number of any length.
Where did our Cat go? :D
by Sertik
Wed Sep 25, 2024 2:08 pm
Forum: Scripting
Topic: MikroVoice for Mikrotik
Replies: 3
Views: 1468

Re: MikroVoice for Mikrotik

# MikroVoice download from GitHub and import # for Terminal ROS { :do { :put ("MikroVoice system is loaded from GitHub ...") /tool fetch url="https://raw.githubusercontent.com/Sertik13/MikroVoice/refs/heads/main/MikroVoiceSys" } on-error={:error "MikroVoice System installat...
by Sertik
Wed Sep 25, 2024 1:56 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

Maybe Rex will laugh and it can be much simpler and shorter? More versatile ?
by Sertik
Wed Sep 25, 2024 1:48 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

This can be done in blocks of 4 digits to the end. In the example for 5 digits: # inversion for 5 digits { :local a "10011"; :local b; :local d :local f do={:local c; :for i from=0 to=[:len $1] do={:set c ("$c"."$[:pick $1 $i (1+$i)]".".")}; return [:pick $c 0...
by Sertik
Wed Sep 25, 2024 12:51 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

Re: logical "or" over number

I answer myself:
{
:local a "1101"
:local c
:for i from=0 to=[:len $a] do={:set c ("$c"."$[:pick $a $i (1+$i)]".".")}
:set $c [:pick $c 0 ([:len $c]-2)]
:put $c
:set c ($c^1.1.1.1)
:put $c
}
but this only works with 4 digits.
by Sertik
Tue Sep 24, 2024 9:32 pm
Forum: Scripting
Topic: logical "or" over number
Replies: 20
Views: 1862

logical "or" over number

Hello !

What is the easiest way to perform a logical or script operation on a number represented by a string variable? For example, there is a line "01001". Should it be converted to "10110"?
by Sertik
Thu Sep 12, 2024 12:56 pm
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

It turned out that the method works, but not always... :global funcEventHandler do={ :delay 1s :log warning $1 :if (([/system script environment get [/system script environment find name=$1] value]="(code)") \ or ([:len [:find [/system script environment get [/system script environment fin...
by Sertik
Thu Sep 12, 2024 10:24 am
Forum: Scripting
Topic: MikroVoice for Mikrotik
Replies: 3
Views: 1468

MikroVoice for Mikrotik

A voice router? And why not? I have created a voice notification system for network events for Mikrotiks. The project is named MikroVoice and is represented by the boards of the Catalex YX5300/6300, BT201 or DF Player Pro mp3 players, as well as a library of script functions and voiceover jingles i...
by Sertik
Thu Sep 05, 2024 11:47 am
Forum: Scripting
Topic: serial-MP3-player Catalex YX6300 for RBM33G or other RB with serial port
Replies: 3
Views: 1830

Re: serial-MP3-player Catalex YX6300 for RBM33G or other RB with serial port

This work has been completed. A notification system for events occurring on the Mikrotik router, called MikroVoice , has been created, working in three languages: Russian, English and Chinese. The system supports three different mp3 players: Catalex YX5300; DFPlayer Pro and BT201. In the near future...
by Sertik
Fri Aug 30, 2024 9:52 am
Forum: Scripting
Topic: User manager Daily Sales Report
Replies: 1
Views: 439

Re: IMPORTANT.. Daily Sales Report

:global EventHandler do={ /log info "New Event username=$Name changed"; send to Telegram :return 0; }; :execute { :global EventHandler; /user-manager .... follow-only where [$EventHandler Name=$name]; }; Use this tracking script. In it, replace the dots with the data section of interest /u...
by Sertik
Fri Aug 30, 2024 9:37 am
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

By the way, can someone explain why :execute is used here, since print follow already starts a separate process? Can I use it without :execute?
by Sertik
Thu Aug 29, 2024 12:35 pm
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

Got it, thanks. Nice welcome.
by Sertik
Wed Aug 28, 2024 2:25 pm
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

I 'll answer myself ... Messages arrive, but both when connecting and when disconnecting the wifi client. This is a minus ...
by Sertik
Wed Aug 28, 2024 12:10 pm
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

Or is :return 0 required in the function?
by Sertik
Wed Aug 28, 2024 11:54 am
Forum: Scripting
Topic: mikrotik events script New abroach
Replies: 20
Views: 4671

Re: mikrotik events script New abroach

:global EventHandler do={
/log info "Connect new wifi-client=$Name";
:return true;
};

:execute {
:global EventHandler;
/ip dhcp-client print follow-only where [$EventHandler Name=$name]
};

And in this form, will your approach work when connecting a new wifi client?
by Sertik
Fri Jun 14, 2024 2:41 pm
Forum: Scripting
Topic: A few undocumented operators that are kind of neat.
Replies: 14
Views: 3001

Re: A few undocumented operators that are kind of neat.

I'm interested in all the secrets of Mikrotik ! :)
by Sertik
Fri Jun 14, 2024 10:37 am
Forum: Scripting
Topic: A few undocumented operators that are kind of neat.
Replies: 14
Views: 3001

Re: A few undocumented operators that are kind of neat.

We need examples of justified and effective use (>[]) and (<%%)
by Sertik
Fri Jun 14, 2024 10:28 am
Forum: Scripting
Topic: A few undocumented operators that are kind of neat.
Replies: 14
Views: 3001

Re: A few undocumented operators that are kind of neat.

That is, you can put both data and executable code into an array. This has been known for a long time.
In fact, it turns out that everything can be housed in one structure.
by Sertik
Fri Jun 14, 2024 10:15 am
Forum: Scripting
Topic: $INQUIRE - prompt user for input using arrays +$CHOICES +$QKEYS
Replies: 28
Views: 5534

Re: $INQUIRE - prompt user for input using array of questions + $CHOICES

No, I'm not asking for a new feature. Instead of :return ($lchoices->$isel->"val") you need to do: :global ValChoices ($lchoices->$isel->"val") and continue executing the $CHOICES function. My script will check $ValChoises and if a value appears in it, it will take it from there....
by Sertik
Thu Jun 13, 2024 8:52 pm
Forum: Scripting
Topic: $INQUIRE - prompt user for input using arrays +$CHOICES +$QKEYS
Replies: 28
Views: 5534

Re: $INQUIRE - prompt user for input using array of questions + $CHOICES

Dear, Amm0 ! Could you correct the $CHOISES function so that it would be possible to use the "enter" key to select a menu item WITHOUT COMPLETING THE WORK? That is, the function would transfer the selected item to some global variable, while remaining in the selection loop to select anothe...
by Sertik
Thu Jun 13, 2024 6:05 pm
Forum: Scripting
Topic: A few undocumented operators that are kind of neat.
Replies: 14
Views: 3001

Re: A few undocumented operators that are kind of neat.

:global inc (>[:set $counter ($counter+1)])
:global c {counter=0}
:put ($inc <%% $c)
:put $c

counter=1

!
by Sertik
Thu Jun 13, 2024 5:33 pm
Forum: Scripting
Topic: A few undocumented operators that are kind of neat.
Replies: 14
Views: 3001

Re: A few undocumented operators that are kind of neat.

:global f1 do={:return 5} :global f2 do={:return 7} :global add (>[:return ([$f1]+[$f2])]) :put ($add <%% {$f1;$f2}) 12 :global f1 do={:return $1} :global f2 do={:return $1} :global add (>[:return ([$f1 2]+[$f2 3])]) :put ($add <%% {$f1;$f2}) 5 :global f1 do={:return [/system clock get time]} :globa...
by Sertik
Tue Mar 26, 2024 1:19 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

Regarding the introduction of something new in functions, the type proposed by Amm0:
/system/scripts/function
developers should be careful. By introducing a new one, you should not violate the old features, as this will lead to the need to rewrite thousands of working scripts...
by Sertik
Tue Mar 26, 2024 12:52 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

As for the difficulties, I agree with Larsa and Amm0... I don't know how from the point of view of implementation, but the scripting language of the OS Router does not allow you to directly write :global $Name or :local $Name, so that $Name itself is a variable, this generates many difficulties, of ...
by Sertik
Tue Mar 26, 2024 12:41 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

# example Magical :parse # declaring a variable with substituting a value from Layer7 for it [[:parse ":global $vname [:to$vtype $[/ip firewall layer7 get [find where name=$vname] regexp]]"]] # Hack with array sorting (by Rextended) :set hackSort ($hackSort, [[:parse "[:toarray {\&quo...
by Sertik
Mon Mar 25, 2024 4:10 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

In this way, you can call functions whose names are not known in advance, that is, they will be determined during the script ! Let me try to explain: imagine that you have a certain process (function) that, in order to solve its tasks, must and can, depending on the initial conditions, use several d...
by Sertik
Mon Mar 25, 2024 4:06 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

Thank you so much, Rex! This is not nonsense, but a very necessary thing for me! That's the line I was waiting for from you and you helped me a lot in this.: :return [[:parse ":global $1 ; :return [\$$1 $2]"]] I found the solution myself, but I was wrong about one thing - I had to screen i...
by Sertik
Mon Mar 25, 2024 12:48 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

Hello Rex. I don't know what can be explained well here. I am writing a global function that should receive data from other global functions, the names of which would be passed to the first one as parameter $1, a $2 to be the parameter passed to the second function. Having received data from other f...
by Sertik
Mon Mar 25, 2024 10:06 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

I can't judge other scripting languages, I'm not a programmer...
by Sertik
Mon Mar 25, 2024 9:49 am
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

Re: execute & parse

:put [:return [[:parse ":global $1; return [$1 hello]"]]] expected command name In other words, Question: is how to call a function whose name is set by a parameter of another function? Or is this not possible because at the time of execution of :parse, the function declared in :global ha...
by Sertik
Sun Mar 24, 2024 7:56 pm
Forum: Scripting
Topic: execute & parse
Replies: 28
Views: 2950

execute & parse

The topic has been discussed many times, but everything is forgotten when there is little practice... Is it possible to access a variable whose name is not known in advance to the script function by passing it in a parameter? Something like this... :return [[:parse ":global \$1; return [\$1 hel...
by Sertik
Wed Mar 20, 2024 4:32 pm
Forum: RouterBOARD hardware
Topic: RouterBoard USB port not active?
Replies: 48
Views: 34216

Re: RouterBoard USB port not active?

[admin@MikroTik] > /system resource usb print Columns: DEVICE, VENDOR, NAME, SPEED # DEVICE VENDOR NAME SPEED 0 1-0 Linux 5.6.3 ehci_hcd RB400 EHCI 480 1 1-1 American Power Conversion Smart-UPS 750 FW:651.12.I USB FW:4.2 1.5 [admin@MikroTik] > /port print Columns: NAME, CHANNELS, USED-BY, BAUD-RATE...
by Sertik
Tue Feb 27, 2024 1:30 pm
Forum: Scripting
Topic: export scripts from the repository saved under a specific owner
Replies: 8
Views: 1812

Re: export scripts from the repository saved under a specific owner

Surely this can be done, but you need to write a whole large script that would select scripts from the repository according to the creator (owner), process each line of them with escaping the necessary symphols and inserting control symphols (and taking into account all the nuances of this process, ...
by Sertik
Tue Feb 27, 2024 8:44 am
Forum: Scripting
Topic: export scripts from the repository saved under a specific owner
Replies: 8
Views: 1812

Re: export scripts from the repository saved under a specific owner

Thank you very much, Rex! /system script export where owner=admin This is what I needed! But the problem is that this only works in ROS 7, starting with the version you specified and does not work at all in ROS 6, since there is no "where" for /export yet... /system script export <tab> (i...
by Sertik
Mon Feb 26, 2024 8:55 pm
Forum: Scripting
Topic: export scripts from the repository saved under a specific owner
Replies: 8
Views: 1812

Re: export scripts from the repository saved under a specific owner

It’s a pity that the Ikrotik developers didn’t think of making filters in /export... You don’t have a ready-made script or some kind of preparation that could assemble a file from individual scripts in the /export format, so that it would be correctly understood and restored by the /import command ?
by Sertik
Mon Feb 26, 2024 8:42 pm
Forum: Scripting
Topic: export scripts from the repository saved under a specific owner
Replies: 8
Views: 1812

Re: export scripts from the repository saved under a specific owner

Dear, Amm ! I do not understand you. I repeat the question: as you know, /system script export file=myscript.rsc will save all the repository scripts in myscript.rsc Scripts stored in the router repository have different properties, including the “owner” property (creator). Is it possible to somehow...
by Sertik
Mon Feb 26, 2024 7:19 pm
Forum: Scripting
Topic: export scripts from the repository saved under a specific owner
Replies: 8
Views: 1812

export scripts from the repository saved under a specific owner

I just can’t solve a seemingly simple problem: From all the scripts in the router repository, you need to select only those scripts that are saved under “owner”, for example “Sertik”, exporting them to one .rsc file It is clear that you can cycle through the contents of the scripts under the desired...
by Sertik
Tue Feb 20, 2024 7:48 pm
Forum: Scripting
Topic: $PIANO - interactive "player piano" & studio-quality recorder using :beep
Replies: 14
Views: 2583

Re: $PIANO - interactive "player piano" & studio-quality recorder using :beep

In terms of design and implementation, this is very cool! Thank you very much to the author!
And also a very good tutorial for writing scripts!
by Sertik
Wed Feb 14, 2024 1:53 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

I kind of understand that. You're saying that this construct filters out the same data. After all, router ports cannot have the same names (ROS does not make them the same itself and does not allow the user to set the same names to ports) .... But I think I got it... thanks ! Although the automatic ...
by Sertik
Wed Feb 14, 2024 12:53 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Yes, OK. I checked it works correctly, including a shortened design: { /port :foreach item in=[find where name~"usb" used-by="" !inactive] do={:put [get $item name]} } output: usb2 But it also works without where... { /port :foreach item in=[find name~"usb" used-by=&quo...
by Sertik
Wed Feb 14, 2024 11:09 am
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

{:foreach item in=[/port find where name~"usb" and used-by="" and !inactive ] do={:put [/port get $item name]}} output: <empty> {:foreach item in=[/port find name~"usb" and !inactive ] do={:put [/port get $item name]}} output: usb2 Port usb2 is free ... Is it really im...
by Sertik
Wed Feb 14, 2024 10:58 am
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

/port
:foreach item in=[find where name~"usb" and used-by="" and !inactive ] do={
    :put [get $item name]
}
This is correct ?
by Sertik
Wed Feb 14, 2024 10:50 am
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

I came to the realization that I don't understand the expression " where " at all... Not really knowing what it does, I've always tried not to use it in my scripts. The Mikrotik Wiki only says this: where - expressions followed by where parameter can be used to filter out matched entries B...
by Sertik
Tue Feb 13, 2024 5:40 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Thank you very much, dear friends of Rex & Amm0! If you'll excuse me, I (who in the scripts is up to both of you like the moon) That's what they call you.
by Sertik
Tue Feb 13, 2024 5:31 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

As a result, I "turned over" the Amm0 design and it worked like that!
:put [/port find used-by="" !inactive] 
Or just like that:
:put [/port find inactive=no used-by=""] 
The ROS is still the casket with the egg of kashchei the immortal !
by Sertik
Tue Feb 13, 2024 4:59 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

:put [/port find used-by=[]] <empty> :put [/port find used-by=""] *1 :put [/port find name~"^" used-by=""]] *1 :put [/port find name~"^"]] *1*2 !!! (That is, without selection by used-by, the construction finds two identifiers - that is, I have two ports!) :p...
by Sertik
Tue Feb 13, 2024 4:48 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Rex, I always read what you write! I try to read carefully, but I don't always understand because of my poor English and the quality of the auto-translation into Russian (I already talked about this earlier). Please make allowances for my profession too (you know it) and the way patients pull me at ...
by Sertik
Tue Feb 13, 2024 3:44 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Of course, I understand that the port can be occupied and freed, for example, by the console... My usb port is currently occupied by the modem, and serial0 is disconnected from the console, but ... :put [/port find name~"" !inactive !used-by] output: <empty> I don 't understand why... Mayb...
by Sertik
Tue Feb 13, 2024 3:34 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

You need to go through all the ports available on the router and select all of them that have the usb or serial type and only those that are active (!inactive) and only those that are not used by any devices (!used-by)...

I do this: (moment, please ....)
by Sertik
Tue Feb 13, 2024 3:28 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Rex, I'm so glad to talk to you!

It just happened that way:
:put [/port find used-by~""]]   
Now I will write what the actual matter is ...
by Sertik
Tue Feb 13, 2024 3:05 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

I will formulate the task once again (maybe I did not explain it clearly): How do I, when searching in :foreach, or just conditionally select only those ports from / port that are not used by anyone (free)? Or can't this be done for the used-by property? There must be a solution... After all, router...
by Sertik
Tue Feb 13, 2024 2:57 pm
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

Re: /port using the used-by property

Although you can get the contents of the "used-by" property to the Terminal, for example: /port print as-value output: .id=*1;baud-rate=auto;channels=1;device=;name=serial0;used-by=;.id=*2;baud-rate=9600;channels=7;device=1 -1;name=usb2;used-by=sms tool, PPP <ppp-out1> [/foreach count in=[...
by Sertik
Tue Feb 13, 2024 10:55 am
Forum: Scripting
Topic: ✂ Rextended Fragments of Snippets
Replies: 107
Views: 90492

Re: ✂ Rextended Fragments of Snippets

I haven’t visited the forum for a long time... I recently read this off-topic... This is what I would like to say: Dear Rex! We don’t know the true reasons for your decision to stop writing scripts... If it’s really some kind of resentment, the offended pride of a talented person or something like t...
by Sertik
Tue Feb 13, 2024 9:13 am
Forum: Scripting
Topic: /port using the used-by property
Replies: 20
Views: 2033

/port using the used-by property

Greetings to all ! It doesn’t seem like a difficult task at all, but I can’t cope: :put [/port find name=usb2] *1 :put [/port find name=usb2 !inactive] *1 :put [/port find name=usb2 !inactive !used-by] ... nothing :put [/port find name=usb2 !inactive used-by] ... nothing too ! :put [/port find !used...
by Sertik
Thu Jan 04, 2024 7:51 pm
Forum: RouterBOARD hardware
Topic: USB port not detected in RBM33G
Replies: 0
Views: 2304

USB port not detected in RBM33G

Greetings to all forum members and Happy New Year to everyone! Perhaps the question has been discussed, but it is not clear to me and I cannot find ready-made answers. I have several RBM33G boards. On some of them, the USB port is detected normally. On some, it simply isn't there. Neither the ROS up...
by Sertik
Mon Dec 25, 2023 11:59 am
Forum: Scripting
Topic: serial-MP3-player Catalex YX6300 for RBM33G or other RB with serial port
Replies: 3
Views: 1830

serial-MP3-player Catalex YX6300 for RBM33G or other RB with serial port

It turns out that Mikrotik can be voiced even without a tweeter or just a programmable beeper (which, by the way, the RBM33G does not have). I used a Chinese clone of the mp3/wav player module Catalex YX5300/YX6300. It can be connected to the serial port of any Mikrotik board. I used serial1 RBM33G....
by Sertik
Mon Dec 25, 2023 5:15 am
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

OK, thank you very much for everything. Solved the problem.
by Sertik
Sun Dec 24, 2023 3:59 pm
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

In addition, it turned out that not all commands for my device can be shortened and there are important commands that require the transmission of sequences containing zero bytes, without which the commands are not perceived. So the main problem is passing zeros (zero bytes)
by Sertik
Sun Dec 24, 2023 3:37 pm
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

I couldn't get the command to work: /interface ppp-client at-chat [find] input="\7E\FF\06\03\00\00\01\EF" If ppp-client is created and active, this command always produces an error: "failure: can't reuse channel while ppp-client running!" But, I finally managed to send commands t...
by Sertik
Fri Dec 22, 2023 12:16 pm
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

If you pass hexadecimal data as a string:
/interface ppp-client add name="scripttemp" dial-on-demand=no port=serial0 modem-init="\7E\FF\06\03\00\00\01\EF" null-modem=yes disabled=no
Are you sure that the data will be transmitted correctly?
by Sertik
Fri Dec 22, 2023 8:33 am
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

I checked it out. It doesn't work. My device works fine via the usb-serial adapter CH340, but does not work via ppp-out1. I think the fact is that the data is not being transmitted correctly. I will try to connect a Mikrotik cord with a serial-usb adapter to the serial port and look at the terminal ...
by Sertik
Thu Dec 21, 2023 9:12 am
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

Thank you very much! I will definitely check it out.
by Sertik
Wed Dec 20, 2023 9:46 am
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

Thank you very much, Amm0 for your answer. If I don't need to receive responses from the device, but only send it commands in the form of hexadecimal code (for example, I need to send 7EFF0603000001EF) via RS232, can I do this via a ppp-out interface like this: /interface ppp-client add name="s...
by Sertik
Tue Dec 19, 2023 9:31 am
Forum: Containers
Topic: "serial2http" — container to bridge serial to the RouterOS CLI
Replies: 15
Views: 9334

Re: "serial2http" — container to bridge serial to the RouterOS CLI

Thanks a lot to the author for the work done and the instructions for use. I translated the instructions into Russian for my comrades https://forummikrotik.ru/viewtopic.php?f=14&t=14835 . We haven't tried it yet, but we will definitely try it. I wanted to connect the so-called Serial MP3 Player ...
by Sertik
Wed Dec 13, 2023 2:05 pm
Forum: RouterOS beta
Topic: Fibocom L850-GL
Replies: 22
Views: 11843

Re: Fibocom L850-GL

There is no 5G in Russia. :D :D :D So far only fairy tales or tests.
by Sertik
Thu Dec 07, 2023 12:29 pm
Forum: RouterOS beta
Topic: Fibocom L850-GL
Replies: 22
Views: 11843

Re: Fibocom L850-GL

What's the news since then? How supported is fibocom l850 in Mikrotik today?

As far as I remember, /lte at-chat support is included in ROS for this modem, starting with ROS 7.11.2rc and the command above should work.

/interface lte at-chat lte1 input=ATG+USBMODE=7
by Sertik
Wed Dec 06, 2023 9:54 am
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

Thank you, friends. I guessed it myself. It's just that string parameters need additional escaping like "\" hello мамочка!\"" and then they are transmitted without problems !
by Sertik
Tue Dec 05, 2023 9:21 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

So far I have come to this final working design: [[:parse "[:parse [/system script get $scrName source]] Par1=[:to$[:typeof $Var1] $Var1] [:to$[:typeof $Var2] $Var2] [:to$[:typeof $Var3] $Var3] [:to$[:typeof $Var4] $Var4] [:to$[:typeof $VarN] $VarN]"]] Now I can pass parameters without los...
by Sertik
Tue Dec 05, 2023 9:17 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

I didn't expect this from you. It always seemed to me that you love mental exercises. Regarding my question, do you have any ideas or solutions?
by Sertik
Tue Dec 05, 2023 7:47 am
Forum: Scripting
Topic: Send a unicode symbol to Telegram from an array list
Replies: 4
Views: 3663

Re: Send a unicode symbol to Telegram from an array list

:return (($Symbols->$1) . "\EF\B8\8F"); If desired, you can return as many characters as you want from your array: :return (($Symbols->$1) . ($Symbols->$2). ($Symbols->$3). "\EF\B8\8F"); If $2 and $3 are not specified, they simply will not be refunded $tgFunc ("$[$SymbolByU...
by Sertik
Mon Dec 04, 2023 9:16 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

It turns out that you can pass parameters from a script to a script while preserving their type. This is done like this: # Script transfer :local scrName "scriptReceiver" :local Var1 "Par1=text" :local Var2 "Par2=12" :local Var3 14 :local Var4 192.168.0.1 :local Var5 [/...
by Sertik
Mon Dec 04, 2023 1:58 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

Да, можно передавать и именованные и позиционные, но всё равно все превращаются в тип "str" Yes, you can pass both named and positional ones, but still everything turns into the "str" type: scrTransfer: :local scrName "scriptReceiver" :local Var1 "12" :local V...
by Sertik
Mon Dec 04, 2023 1:41 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

Here, Russian friends gave me the idea that I was bothering a lot and that I could pass positional parameters like $0, $1, etc. from the script to the script ... with the same construction. We should try it too.

and catching them in script Receiver is just like :local Par1 $0
by Sertik
Mon Dec 04, 2023 12:43 pm
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Re: Passing a parameter from a script to another script

Rex and Amm0 where are you friends?
by Sertik
Mon Dec 04, 2023 11:10 am
Forum: Scripting
Topic: Passing a parameter from a script to another script
Replies: 10
Views: 4045

Passing a parameter from a script to another script

Hello everybody! This is not GPT! My question is: I want to pass a parameter from one script to another. What's easier, you say, do it through global variables. But I want to do without variables (the interest is purely academic) I managed to do it using this method: script Transfer: :local scrName ...
by Sertik
Sat Dec 02, 2023 3:06 pm
Forum: Scripting
Topic: AI GPT and Mikrotik`s scripts
Replies: 0
Views: 2914

AI GPT and Mikrotik`s scripts

That article that I promised to present:

https://habr.com/ru/articles/778020
by Sertik
Tue Nov 28, 2023 1:46 pm
Forum: Scripting
Topic: GPIO function for RBM33G
Replies: 1
Views: 2103

Re: GPIO function for RBM33G

My new article about RBM33G https://habr.com/ru/articles/776908/ 1. Control of the RBM33G Mikrotik via the second serial port 2. Connecting the remote control to the Microtik 3. Connecting the beeper module 4. Talking microtik - connecting the voice recording/playback module 5. Serial MP3 Player con...
by Sertik
Thu Nov 23, 2023 8:35 pm
Forum: Scripting
Topic: output data to serial port using script
Replies: 2
Views: 1662

Re: output data to serial port using script

Thanks Rex, but it's too complicated for me. I've found another way so far. I have a device that can do this and it is controlled by http requests. That is, I can send an http request to this device from Mikrotik, and it will already transfer the data to whoever needs it. It's a pity that Mikrotik c...
by Sertik
Thu Nov 23, 2023 12:47 pm
Forum: Scripting
Topic: output data to serial port using script
Replies: 2
Views: 1662

output data to serial port using script

already asked somewhere but no one answered. Maybe I asked in the wrong section of the forum. I’ll ask separately again: is it possible to somehow use a script to output data to the serial port of Mikrotik? As far as I understand from the descriptions, the output comes only from the keyboard, and I ...
by Sertik
Thu Nov 23, 2023 9:07 am
Forum: Scripting
Topic: Logging GPS Coordinates in File when LTE Disconnects
Replies: 3
Views: 1532

Re: Logging GPS Coordinates in File when LTE Disconnects

I think yes it can be done. When the connection is disconnected, the latest data remains in /system gps, unless the router has been rebooted. You can take it from there with a script and save it in a variable/file or ip firewall layer7. When the connection appears, you can transfer them. But what 's...
by Sertik
Wed Nov 22, 2023 11:56 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

There is no point in describing the advantages of machine AI over human AI: it has no physical shell (body), is N-times faster, does not depend on environmental conditions, does not get tired, does not need rest, can unlimitedly increase power by increasing the number of elements (humans do not have...
by Sertik
Wed Nov 22, 2023 11:21 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Nevertheless, one person, no matter how talented he is, can be effective in one (even several) areas. All of humanity is an example of the cooperation of many intellects (if you want elements of a global neural network). However, if an artificial superintelligence is created that surpasses humans in...
by Sertik
Wed Nov 22, 2023 11:16 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

I make do with what's available. Both in programming and in real life. I don't spend a single euro on plumbers, electricians, painters, and anything else, I do everything myself... I save a lot of money which I then spend on leisure. Well, as they say, “a talented person is talented in everything.”...
by Sertik
Tue Nov 21, 2023 9:00 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

And in fact, if you look at it now, the programmer performs the work of the machine in its pure form by 80% (if you remove the creative component of coming up with solutions and algorithms, which, by the way, have mostly already been invented). The programmer has to know from memory or find in refer...
by Sertik
Tue Nov 21, 2023 8:44 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Well, you really... I can find syntax errors most often, but coming up with constructions is worse. GPT4 in the latest release does not make mistakes like its predecessors. He doesn’t create non-existent commands, as he did before, he doesn’t fantasize - he produces maybe not super-optimal, but very...
by Sertik
Tue Nov 21, 2023 11:18 am
Forum: Virtualization
Topic: GoldenOrb (ROOter Firmware)
Replies: 0
Views: 3005

GoldenOrb (ROOter Firmware)

I will ask in this section: Has anyone used ROOter Firmware firmware for Microtik ?

https://www.ofmodemsandmen.com/firmware.html
by Sertik
Tue Nov 21, 2023 9:21 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Communicating on the forum, we not only exchange technical information (as machines), but also put our soul into it (as people), getting to know each other better and possibly enriching each other. And it's still more pleasant for me to communicate with Rex than with GPT. :D
by Sertik
Tue Nov 21, 2023 9:14 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

There is no sense in the bankruptcy of open artificial intelligence. Now there is already a race between the creators of artificial intelligence, there will be no open AI - there will be others, whether we want it or not. Now billions of dollars are pouring into them. Those who created television or...
by Sertik
Tue Nov 21, 2023 9:08 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

If many do not want to, we will not continue this topic. Believe me, I have no goal to promote technology, as someone said here. But I like the discussion with Rex, since he is an autodidact (self-taught) like me, and although he does not have systematic knowledge of philosophy, for example, he has ...
by Sertik
Mon Nov 20, 2023 9:33 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

As far as I understand, you Rex do not want to get your own personal experience with GPT. This is weird. Why ? Any scientist or researcher of something always wants to gain his own experience. No need to jump from the 99th floor because it is clear that you will crash. But when biologists tested the...
by Sertik
Mon Nov 20, 2023 3:45 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Contradict yourself. Say that knowledge is taken from experience and do not want to personally get this experience. Are you afraid that it will hurt ?
by Sertik
Mon Nov 20, 2023 2:45 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Intelligence does not exist, in any form. Even inventing something does not require intelligence, but knowledge. This is Rex's opinion. I think many will disagree with this. For now, knowledge can only be created and increased by people through intelligence. Let's stop here and see what happens nex...
by Sertik
Mon Nov 20, 2023 1:00 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

In my humble opinion, GPT4 today cannot create something fundamentally new, creating only what we (human programmers) know how to write. But after clarification, he is able to produce working code and significantly reduce the time for searching and writing significant pieces of the script. It’s clea...
by Sertik
Mon Nov 20, 2023 12:55 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

By the way, Rex himself never expressed his opinion about GPT4...
by Sertik
Mon Nov 20, 2023 12:53 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

To our respected and beloved Rex, in any case, good health, long years and new successes! I hope it will remain ahead of GPT for a long time! By the way, the last task - to write a script for transcoding text from 1251 to UTF8 GPT4 was also completed, but not completely (he avoids long tasks, at fir...
by Sertik
Mon Nov 20, 2023 12:45 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

No, gentlemen, it’s not like that. I gave GPT 3.5 three tasks (write a script for searching for active routes on the Internet, including marked ones; write a script for turning on a relay through the Laurent 5G module; write a script for transcoding the Cyrillic alphabet to send text to a Telegram b...
by Sertik
Mon Nov 20, 2023 8:34 am
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Despite the fact that the AI's success is impressive, it is important to keep in mind that the AI can only combine [*] the knowledge it has gained during training. Don't think like that. Regarding GPT4, he can, for example, search for knowledge on the Internet, climbing into any online manuals and ...
by Sertik
Fri Nov 17, 2023 1:06 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Rex, being a very smart person, understood all this and stopped writing scripts for Mikrotik, not wanting to train the neural network. :D In this sense, I most like the famous story by Cyril Kornblatt “Gomez” (if you haven’t read it, I recommend reading it).
by Sertik
Fri Nov 17, 2023 12:08 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Perhaps the timing of my forecasts is even too optimistic. And either humanity will stop working on instruments for its own destruction and find means of protection or...
by Sertik
Fri Nov 17, 2023 12:05 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

Thank you very much Amm0 for your answer. Jokes aside, the release of GPT5 is just around the corner. In addition, you need to clearly understand that what developers are now giving away online and what they are already giving in practice are two different things, because they are controlled by wars...
by Sertik
Thu Nov 16, 2023 9:58 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

I agree, this is not a good example.

And this is what GPT gave when asked to “write a script to search for active routes on the Internet”:
:put [/ip route print where dst-address~"0.0.0.0/0"]
It's better, isn't it?
by Sertik
Thu Nov 16, 2023 3:00 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

This is what GPT gave in 5 seconds when asked to contact a specific device with a specific OID. Yes, it's simple, but it replaces 10 minutes of my time writing and checking syntax. # settings :local deviceIP "192.168.1.1" :local snmpCommunity "public" :local relayOID "1.3.6....
by Sertik
Thu Nov 16, 2023 2:50 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

Re: GPT4 and writing scripts for Mikrotik

I only tried GPT3.5 This neural network, of course, cannot write the final script, but it can significantly reduce the time for a non-professional in writing scripts by providing ready-made code snippets upon request, instead of searching for them on forums. Considering that GPT4 is an order of magn...
by Sertik
Wed Nov 15, 2023 12:44 pm
Forum: Announcements
Topic: v7.13beta [testing] is released!
Replies: 467
Views: 102075

Re: v7.13beta [testing] is released!

Can someone clearly explain the syntax and use of the new commands:

:serialize
:deserialize
:onerror
:grep
by Sertik
Wed Nov 15, 2023 12:18 pm
Forum: Scripting
Topic: GPT4 and writing scripts for Mikrotik
Replies: 51
Views: 7626

GPT4 and writing scripts for Mikrotik

Has anyone tried to get GPT4 to write a script for Mikrotik? I wonder how it's going? I can’t try - I’m in Russia, I don’t have VDS abroad.
I wonder when GPT will be able to replace Rex ? :D
by Sertik
Wed Nov 15, 2023 12:14 pm
Forum: RouterBOARD hardware
Topic: SIM insertion
Replies: 7
Views: 2808

Re: SIM insertion

Well, we sorted out 88 and 188. Maybe the topicmaster doesn’t have an address on the interface at all?
Let him try to connect using the Mac address.
by Sertik
Tue Nov 14, 2023 10:22 am
Forum: RouterBOARD hardware
Topic: RBM33G GPIO and extra interfaces documentation
Replies: 4
Views: 4784

Re: RBM33G GPIO and extra interfaces documentation

It seems that a detailed description of the RBM33G pin does not exist or is not published... There is no response from the developers to our pleas. In general, Mikrotik has not released OEM boards for a long time. It would be nice to release a new board with the performance of the RB5009, built-in t...
by Sertik
Mon Nov 13, 2023 9:42 pm
Forum: RouterBOARD hardware
Topic: SIM insertion
Replies: 7
Views: 2808

Re: SIM insertion

I also cannot connect to 192.168.188.1, but I think that's a different issue...
In Mikrotik you usually need to connect to 192.168.88.1 ...
by Sertik
Mon Nov 13, 2023 11:12 am
Forum: RouterBOARD hardware
Topic: RBM33G serial ports [SOLVED]
Replies: 10
Views: 10320

Re: RBM33G serial ports [SOLVED]

... Although, if :put will pour data into the Terminal, and it is connected to serial1, then in theory everything should pour into the serial port, and accordingly be transferred to the usb serial Player... It is possible and will work. USB-serial Player of the latest version (I found 1.3.2) costs a...
by Sertik
Mon Nov 13, 2023 10:26 am
Forum: RouterBOARD hardware
Topic: RBM33G serial ports [SOLVED]
Replies: 10
Views: 10320

Re: RBM33G serial ports [SOLVED]

If you use the command :put to pour data into the console connected to the serial port, will this data pour into the port ? Like they should ?
by Sertik
Mon Nov 13, 2023 9:20 am
Forum: RouterBOARD hardware
Topic: RBM33G serial ports [SOLVED]
Replies: 10
Views: 10320

Re: RBM33G serial ports [SOLVED]

cIn theory, you should try this - сonnect the terminal to serial 1 port: /system serial-terminal serial1 After which you can send commands from the console. USB serial Player should catch them. But whether it will be possible to do this from a script ? is a big question... Probably not. It’s a pity ...
by Sertik
Mon Nov 13, 2023 8:01 am
Forum: RouterBOARD hardware
Topic: RBM33G GPIO and extra interfaces documentation
Replies: 4
Views: 4784

Re: RBM33G GPIO and extra interfaces documentation

Is there any documentation on RBM33G connectors ?
by Sertik
Sun Nov 12, 2023 8:48 pm
Forum: RouterBOARD hardware
Topic: RBM33G serial ports [SOLVED]
Replies: 10
Views: 10320

Re: RBM33G serial ports [SOLVED]

Greetings to all. I'm wondering if it's possible to use the additional serial1 port of the RBM33G to transmit and receive data? Including whether it is possible to connect a device that also has a similar serial port to PIN12-16 and control it from Mikrotik. For example, let it be Serial MP3 Player ...
by Sertik
Thu Nov 09, 2023 12:16 pm
Forum: Announcements
Topic: WinBox v3.40 released!
Replies: 165
Views: 169029

Re: WinBox v3.40 released!

I don’t really understand what we’re talking about here. Downloaded new Winbox. Launched. Everything is working. What is the BTH?
by Sertik
Tue Oct 31, 2023 3:52 pm
Forum: Scripting
Topic: GPIO function for RBM33G
Replies: 1
Views: 2103

GPIO function for RBM33G

I wrote a function to work with GPIO RBM33G I/O lines. Probably not everything is rational in it, since I wrote with little time for optimization, just to work. But it works. Take who needs it. See the parameters in the function code. In general, this is $1 - action, $2 - line number (or all), $3 &q...
by Sertik
Tue Oct 31, 2023 3:39 pm
Forum: Scripting
Topic: function "Escape" how to support CP1251?
Replies: 5
Views: 2357

Re: function "Escape" how to support CP1251?

Dear Rex , That's why I'm asking, because I don't want to try "idle". You, as an expert and an author, will tell me right away...
by Sertik
Fri Oct 27, 2023 12:47 pm
Forum: Scripting
Topic: function "Escape" how to support CP1251?
Replies: 5
Views: 2357

Re: function "Escape" how to support CP1251?

I have a lot of text in Russian in my scripts (for example, in comments). Will your Escape function work with them? Or do you need to replace the conversion tables in it?
by Sertik
Wed Oct 25, 2023 2:14 pm
Forum: Scripting
Topic: function "Escape" how to support CP1251?
Replies: 5
Views: 2357

function "Escape" how to support CP1251?

Rex once wrote a wonderful “escape” function that allowed you to escape characters for transferring scripts over SSH. https://forum.mikrotik.com/viewtopic.php?p=980088#p980088 It supports ASCII 1252 encoding. Is it possible to ask the author to remake it so that it supports ASCII 1251 (Cyrilic) enco...
by Sertik
Wed Oct 25, 2023 1:58 pm
Forum: Scripting
Topic: ✂ Rextended Fragments of Snippets
Replies: 107
Views: 90492

Re: ✂ Rextended Fragments of Snippets

Have you damaged 6 Mikrotik devices? It's hard to believe. What devices are these and how did this happen?
by Sertik
Wed Oct 25, 2023 12:27 pm
Forum: Scripting
Topic: ✂ Rextended Fragments of Snippets
Replies: 107
Views: 90492

Re: ✂ Rextended Fragments of Snippets

Rex has written almost every script you can think of.
What should we do now?
It's time to hack the Router OS (scientifically speaking, reverse engineer it).
by Sertik
Wed Oct 18, 2023 9:45 am
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Only other is did you update the firmware via /system/routerboard/upgrade? Yes, of course. Flashed ROS 7.11 stable with gjvjom. Netinstall. Rebooted the router. Made /system routerboard upgrade firmware. Rebooted the router again. Everything is as I usually do. No effect - the wifi interface does n...
by Sertik
Tue Oct 17, 2023 10:28 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

I also tried your advice, Amm0. After reflashing Netinstall ROS 7.11 did not help. The wifi interface does not appear in the list of interfaces. So most likely this is a factory defect.
by Sertik
Tue Oct 17, 2023 9:01 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

And it is unlikely that you will be able to return it or get warranty repairs, since the terms of the warranty are not met - the boards are “broken” out of the case, and they were not purchased from an official dealer. I'm now trying to understand how they were bought.
by Sertik
Tue Oct 17, 2023 8:56 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Dear Amm0! I'll probably try what you recommend. But it seems to me that the Netinstall version and the Router OS version have nothing to do with it. Otherwise, official technical support could have recommended this, but they didn’t. The Wifi interface must be defined in any version of Ros.
by Sertik
Tue Oct 17, 2023 8:13 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

This is what Mikrotik technical support told me: Hello, It looks like the device has an HW problem, please contact the distributor form witch you bought the device and ask about the possibility of repairing it. Best regards, Viesturs R. The answer must be, to put it mildly, exhaustive... I would lik...
by Sertik
Tue Oct 17, 2023 1:53 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Microtik technical support is still silent. Does anyone have any other thoughts?
by Sertik
Tue Oct 17, 2023 12:01 am
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

I created supout.rif as Normis said and sent it to support@mikrotik.com. Perhaps Mikrotik specialists will figure out what’s wrong?
by Sertik
Mon Oct 16, 2023 11:37 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Here is a photo of the board. In photo 2 (back side) traces of thermal paste are visible. What could be there?

Image

Image
by Sertik
Mon Oct 16, 2023 11:27 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Let me clarify that I only have the RB912 board on hand, and not the LtaP mini device in the case. Could the wifi have been damaged when removed from the case?
by Sertik
Mon Oct 16, 2023 11:24 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

I reflashed the router with Netinstall. Same effect. There is no wifi interface. Moreover, the one who gave me this board assures that he has 13 such boards. Could someone intentionally damage the wifi interface so that it does not work in this RB? Or could the Mikrotik company supply someone with a...
by Sertik
Mon Oct 16, 2023 10:55 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Since there is nothing else left, I'll try, thanks
by Sertik
Mon Oct 16, 2023 10:46 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

I apologize for the inaccuracy. The 6.49.10 long-term package is installed. As far as I understand, the wareless package is included in the main package and it appears in my /system package. Why should I install it separately?
by Sertik
Mon Oct 16, 2023 10:36 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Currently installed ROS 6.47.10 long-term main package.
by Sertik
Mon Oct 16, 2023 10:15 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Today I received the RB912R_2nD board without a case. The board boots up, everything is fine, except for one thing - there is no wifi interface as such. There is only eth1 in the list of interfaces (the LTE modem is not installed in the mini PCI-e slot). Am I missing something or where is the wifi i...
by Sertik
Sat Oct 14, 2023 8:25 pm
Forum: Scripting
Topic: Remove disk from /files
Replies: 10
Views: 2678

Re: Remove disk from /files

OK, Thanks !
by Sertik
Sat Oct 14, 2023 7:55 pm
Forum: Scripting
Topic: function convert UnicodeToURL
Replies: 3
Views: 1955

function convert UnicodeToURL

Our one Russian forum member wrote this recoding function. I can’t understand whether Rex already had one like this or not? :global fUnicodeToURL :if (!any $fUnicodeToURL) do={ :global fUnicodeToURL do={ :local Ubytes [:tonum $1] :local EscapeStr "" :local HighByte :local LowByte :local fi...
by Sertik
Fri Oct 13, 2023 2:38 pm
Forum: Scripting
Topic: Remove disk from /files
Replies: 10
Views: 2678

Re: Remove disk from /files

Come on. And should I upgrade to version 7 because of this? Why did she give herself up to me? I have a lot of devices on version 6 and I'm not going to update it.
by Sertik
Fri Oct 13, 2023 9:33 am
Forum: Scripting
Topic: Remove disk from /files
Replies: 10
Views: 2678

Re: Remove disk from /files

The fact of the matter is that the nasty Router Mukh stores the names of the disks somewhere and does not delete them from its memory after unmounting. If, say, disk1 was created, then ejected and a new disk is mounted, then it already receives the name disk2, and disk 1, no matter how you delete it...
by Sertik
Thu Oct 12, 2023 8:23 pm
Forum: Scripting
Topic: Remove disk from /files
Replies: 10
Views: 2678

Re: Remove disk from /files

Has no one encountered this?
by Sertik
Thu Oct 12, 2023 3:35 pm
Forum: Scripting
Topic: Remove disk from /files
Replies: 10
Views: 2678

Remove disk from /files

After using SDD or SD, it doesn’t matter, I can’t adequately remove the disk from /files. Even if you correctly eject and delete the directory with the disk from winbox or CLI, after rebooting the router it appears again. I still haven’t found a way to permanently remove the disk other than reflashi...
by Sertik
Mon Oct 09, 2023 2:32 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Thank you. I think those who used these boards were doing something wrong. I'll take one and try it myself. In any case, I will report the result.
by Sertik
Mon Oct 09, 2023 1:23 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

Again, is it possible to kill the wifi interface with the Ros7 firmware on this device?
by Sertik
Mon Oct 09, 2023 1:22 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

Re: LtAP mini (RB912R-2nD-LTm)

I don't have any configuration data yet. Just one person claims that he has 13 such RB, which does not work wifi. It's hard for me to believe this, both in the marriage of the factory, and in the fact that somehow you can kill the built-in wifi on this board. So I wanted to ask if there were similar...
by Sertik
Mon Oct 09, 2023 1:05 pm
Forum: RouterBOARD hardware
Topic: LtAP mini (RB912R-2nD-LTm)
Replies: 24
Views: 4373

LtAP mini (RB912R-2nD-LTm)

Has anyone heard of a defect in this RB's wifi?
There is a batch of devices where supposedly wifi is not detected in Winbox and naturally does not work.
by Sertik
Tue Sep 26, 2023 5:12 pm
Forum: Scripting
Topic: RBM33G GPIO used
Replies: 4
Views: 1891

Re: RB33G GPIO used

I tried it ! Yes, it works! As it turned out, the RBM33G does not really have analog lines, but it has as many as 6 digital ones, each of which can be configured for both input and output: /iot gpio digital print # NAME DIRECTION OUTPUT INPUT SCRIPT 0 pin3 input 0 1 1 pin5 input 0 1 2 pin15 input 0 ...
by Sertik
Tue Sep 26, 2023 9:14 am
Forum: Scripting
Topic: RBM33G GPIO used
Replies: 4
Views: 1891

Re: RB33G GPIO used

After rereading the documentation, I realized that for RBM33G, you can use GPIO lines 12,13,15,16 of its connector. At the same time, you must first disconnect them from serial1: /system/routerboard/settings/set gpio-function="" /system/reboot RBM33G has no analog lines. These four lines a...
by Sertik
Mon Sep 25, 2023 2:36 pm
Forum: Scripting
Topic: RBM33G GPIO used
Replies: 4
Views: 1891

Re: RB33G GPIO used

It's okay Rex. Maybe Amm0 has RBM33G?
by Sertik
Mon Sep 25, 2023 2:10 pm
Forum: Scripting
Topic: RBM33G GPIO used
Replies: 4
Views: 1891

RBM33G GPIO used

RBM33G has a GPIO, which can be used, in particular, by connecting script execution to them. Could respected gurus explain in detail how best to use this? Or is it related only to KNOT ? As far as I understand, you can connect analog outputs of equipment to PIN 2,3 and use a script to read the volta...
by Sertik
Mon Sep 25, 2023 1:28 pm
Forum: RouterBOARD hardware
Topic: Cooler for RBM33G
Replies: 8
Views: 4390

Re: Cooler for RBM33G

I'm interested in this too, it would be especially interesting to use GPIO to control an external relay. But no one says anything here... GPIO pinout M33 pinout is shown below: All output pins are open drain. Digital input voltage is 0 to 3.63 V max. To receive a logical "0" on the pin, th...
by Sertik
Mon Sep 25, 2023 1:19 pm
Forum: RouterBOARD hardware
Topic: support for third-party modems Cat 16-18
Replies: 0
Views: 2634

support for third-party modems Cat 16-18

Has anyone installed modems on RB Mikrotik M.2 via USB adapters ? I'm interested in the possibility of installing modems like: Fibocom 850 Fibocom 860 Foxconn FOXCONN-T77W968 Is it possible, in particular, to connect such modems in a USB adapter to the RB33G, which supports USB 3.0? Do the latest ve...
by Sertik
Thu Sep 21, 2023 9:59 am
Forum: Scripting
Topic: $YAML - convert arrays to pretty YAML-formated text
Replies: 3
Views: 2336

Re: $YAML - convert arrays to pretty YAML-formated text

Thank you very much to the author for this useful feature. I wanted to ask how YAML differs from the JParsePrint function from the Chupacabra JSON parser set ? :global fJParsePrint :if (!any $fJParsePrint) do={ :global fJParsePrint do={ :global JParseOut :local TempPath :global fJParsePrint :if ([:l...
by Sertik
Tue Sep 19, 2023 1:59 pm
Forum: Scripting
Topic: Laurent Telegram Terminal
Replies: 8
Views: 3086

Re: Laurent Telegram Terminal

by Sertik
Fri Sep 08, 2023 3:24 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

I wrote a short article for the Russian-speaking audience on the new commands of the scripting language in the Router OS based on the materials of this topic. I hope I didn't mix anything up. I also thanked our respected gurus Rextended and Amm0 in the article for their help, explanations and exampl...
by Sertik
Thu Sep 07, 2023 4:03 pm
Forum: Scripting
Topic: "foreach loop" behavior change in version 7
Replies: 9
Views: 3179

Re: "foreach loop" behavior change in version 7

Thank you very much. Now, with a simple example, everything is clear.
by Sertik
Thu Sep 07, 2023 3:29 pm
Forum: Scripting
Topic: "foreach loop" behavior change in version 7
Replies: 9
Views: 3179

Re: "foreach loop" behavior change in version 7

Still, Rex, could you add... What exactly has been fixed in the work on arrays in ROS7 relative to ROS6 ?
by Sertik
Thu Sep 07, 2023 2:23 pm
Forum: Scripting
Topic: "foreach loop" behavior change in version 7
Replies: 9
Views: 3179

Re: "foreach loop" behavior change in version 7

I have come across a description of this problem many times, in particular, on the Russian-language Microtik forum, our programmers complained about the behavior of RouterOS when working with arrays. But I, by virtue of my abilities, did not understand the essence of the problem. Can one of the resp...
by Sertik
Mon Sep 04, 2023 9:30 am
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

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: To enter a line from the Terminal, of course, you can write a small script using :terminal inkey like this: :local EnterString do={ :local cont; :local string :while ($cont...
by Sertik
Mon Sep 04, 2023 9:20 am
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

So, what we have today (to version 7.12): :timestamp :rndnum from=[num] to=[num] :retry command={abc} delay=1 max=2 on-error={} :rndstr from=[str] length=[num] :convert from=[arg] to=[arg] transform= :jobname :tonsec :terminal/ask preinput= prompt= :console/inspect as-value request= path= :task :ex...
by Sertik
Fri Sep 01, 2023 8:57 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

No, I think it's better to post here for now all the new commands of the entire Router OS 7.
by Sertik
Fri Sep 01, 2023 2:35 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

By the way, some descriptions of the new commands are present here:
https://help.mikrotik.com/docs/display/ROS/Scripting
by Sertik
Fri Sep 01, 2023 1:51 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

Is it possible to encode some data with a key using :convert, and then decode it only if this key is known?
by Sertik
Fri Sep 01, 2023 9:32 am
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

Thank you very much. Let's put in this topic everything that concerns the new Ros teams. It will be easy to search.
by Sertik
Thu Aug 31, 2023 10:12 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

Yeah interesting. It will probably solve many problems with various recodings and shorten scripts. Thanks a lot for the explanations.
by Sertik
Thu Aug 31, 2023 8:50 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

Forgive me for being stupid, but could you explain why the :convert command is needed at all? The transform parameters are reminiscent of encryption options...
by Sertik
Thu Aug 31, 2023 8:17 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

I can’t understand how the :convert command works, what features and parameters it has ?
by Sertik
Thu Aug 31, 2023 3:35 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

Re: New command in RouterOs 7

The only way ?
by Sertik
Thu Aug 31, 2023 3:30 pm
Forum: Scripting
Topic: New command in RouterOs 7
Replies: 35
Views: 11032

New command in RouterOs 7

As you know, the developers of Mikrotik finally took up the "scripts" section and supplemented the system with a number of new commands, such as, for example, : timestamp, : rndnum. Recent versions have received :convert, :jobname, tosec, /terminal/ask. But I did not find data on these com...
by Sertik
Thu Aug 31, 2023 3:26 pm
Forum: Scripting
Topic: All data types on RouterOS
Replies: 2
Views: 1990

Re: All data types on RouterOS

:D :lol: :lol:
by Sertik
Thu Aug 31, 2023 2:38 pm
Forum: Scripting
Topic: All data types on RouterOS
Replies: 2
Views: 1990

All data types on RouterOS

In a post viewtopic.php?p=1014223#p1014223 Rex wrote the following: All types of RouterOS, including those that have not yet been discovered from other users.... The usual ones nil nothing str (string) bool (truth value) num (integer number) time (time interval) ip (ip address) ip-prefix (ip prefix)...
by Sertik
Wed Aug 02, 2023 10:38 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Renamed one variable, it seems to work: :local Inlist "inlist" :local listblock "dahgers-list" :local count 4 /ip firewall address-list { :local ip2net do={:return [[:parse ":return $($1 & 255.255.255.0)/$2"]]} :local addr 0.0.0.0 :local net 0.0.0.0 :foreach item in...
by Sertik
Wed Aug 02, 2023 10:23 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Thanks a lot to Amm0 for supporting my idea of $1="help"! I'm trying to use a piece of Rex'a to implement the initial task of the topic. There is a mistake somewhere ... :local list "inlist" :local listblock "dahgers-list" :local count 4 /ip firewall address-list { :loc...
by Sertik
Tue Aug 01, 2023 2:58 pm
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Yes, no why, give a link, please, it might be useful.
by Sertik
Tue Aug 01, 2023 9:20 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Oh, friends, you've written something complicated here... It seems to me that my task is easier - to find addresses with the same first three octets in one particular NameList address sheet and mark the moment when there are more of them, say 5. The subnet mask is not taken into account, it can be d...
by Sertik
Mon Jul 31, 2023 3:24 pm
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Yes, probably so. I was thinking how can I use posix patterns to compare addresses...
And yes, probably, as you said, it will heavily load the processor
by Sertik
Mon Jul 31, 2023 1:21 pm
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

I don't know what this is for, one user from the Russian-speaking forum needs it. I don't care what he wants to do with it. God bless them with computing power. We need a script with probably a posix regexp template that allows you to select addresses with the same first three octets.
by Sertik
Mon Jul 31, 2023 10:27 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

I'll try to explain again... Let's say we have a certain address list, to which arbitrary addresses are added by some kind of firewall rule. Of course, we do not know these addresses in advance. Among them, there may be the same and similar. We need to catch addresses in this list with the same firs...
by Sertik
Mon Jul 31, 2023 10:12 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

Dear Amm0. If it were that easy, I wouldn't be asking. Addresses and subnets are not known in advance. Dear Amm0. If it were that easy, I wouldn't be asking. Addresses and subnets are not known in advance. This address list was given as an example
by Sertik
Mon Jul 31, 2023 9:17 am
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

Re: find addresses with same octets

You need to get a list of IP addresses from the address list myAddr, where the first three octets of the IP address are the same, but only the last one differs. for example: 192.168.88.3, 192.168.88.67; 192.168.88.12; 192.168.0.11; 192.168.67.5; 192.168.88.34 From these, addresses with the first thr...
by Sertik
Fri Jul 28, 2023 12:44 pm
Forum: Scripting
Topic: find addresses with same octets
Replies: 39
Views: 5526

find addresses with same octets

You need to get a list of IP addresses from the address list in which the first three octets of the IP addresses are the same, but only the last one is different and there are more than four such addresses. I understand that you need to use posix regex, but I'm not on friendly terms with this at all...
by Sertik
Thu Jul 27, 2023 11:11 am
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

Re: dual-band wifi adapters for Mikrotik

Firstly, it's about the price. And secondly, I am interested in a card that supports both 2.4 and 5 ranges by choice. Microtik doesn't seem to have one.
by Sertik
Thu Jul 27, 2023 10:29 am
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

Re: dual-band wifi adapters for Mikrotik

For example, it is known on which chips Microtik mini pci-e wifi modules are made: https://mikrotik.com/product/R11e-5HnD - AR9580 https://mikrotik.com/product/R11e-2HPnD - AR9582 https://mikrotik.com/product/R11e-2HnD - AR9582 https://mikrotik.com/product/R11e-5HacD - QCA9882 Will a wifi module fro...
by Sertik
Thu Jul 27, 2023 9:12 am
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

Re: dual-band wifi adapters for Mikrotik

Thanks, but that's not quite it. I need to put a pci-e wifi adapter in the RBM33G, not a wifi module in a Microtik based on an X86 PC. I know for sure that Atheros, whose model I wrote above, works. I would like to know what modern models of wifi modules Microtik supports. It is unlikely that they w...
by Sertik
Wed Jul 26, 2023 3:05 pm
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

Re: dual-band wifi adapters for Mikrotik

Well, at least wifi 2.4 MHz, what module can be installed other than the native Mikrotik ones?

Atheros AR5B95 ?

And which one is modern?
by Sertik
Wed Jul 26, 2023 1:37 pm
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

Re: dual-band wifi adapters for Mikrotik

I want to install a non-Mikrotik wifi adapter in RB33G pci-e ...
by Sertik
Wed Jul 26, 2023 11:56 am
Forum: RouterBOARD hardware
Topic: dual-band wifi adapters for Mikrotik
Replies: 9
Views: 3268

dual-band wifi adapters for Mikrotik

Tell me, what dual-band wifi adapters does Mikrotik Ros support, except for the brand's boards?
by Sertik
Mon Jul 24, 2023 10:34 am
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

Now multi-lingual RouterOS
no, a multilingual OS router is not needed, you only need the ability to install support packages for national languages to send SMS
by Sertik
Fri Jul 21, 2023 8:42 pm
Forum: Scripting
Topic: option "help" for user`s function
Replies: 1
Views: 1774

option "help" for user`s function

I suggest that every valued function include a "help" option as a possible first parameter ($1). This option provides a brief output of information about the use of the function, parameters and examples. In order not to litter the log help is displayed only in the CLI for example: :global ...
by Sertik
Fri Jul 21, 2023 4:16 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

Yes, but sends that from the CLI probably. And from a script?
by Sertik
Fri Jul 21, 2023 3:55 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

It's clear. So this is not possible with the help of the script. This can only be implemented by the developers of the Router OS, but they will not do this, since it is necessary to support not only the Russian language, but also all other national languages. Although they could make it possible to ...
by Sertik
Fri Jul 21, 2023 12:38 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

This is not a problem, but a desire. :)
by Sertik
Fri Jul 21, 2023 11:42 am
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

Sure. We will wait for you, Master.
by Sertik
Fri Jul 21, 2023 10:53 am
Forum: Scripting
Topic: Remove from the environment variables that satisfy the conditions
Replies: 6
Views: 2319

Re: Remove from the environment variables that satisfy the conditions

Wow!

(\\(code\\)

Why is code escaped with two slashes on both sides ?

Is one \ escaping (, and the second \ escaping the first \ ?
by Sertik
Fri Jul 21, 2023 9:37 am
Forum: Scripting
Topic: Remove from the environment variables that satisfy the conditions
Replies: 6
Views: 2319

Re: Remove from the environment variables that satisfy the conditions

Thank you very much. And if among the candidates for deletion there are functions created by the [:parse] method with content (code) ? /system script environment remove [find where (value~"^;\\(eva\?l ") and (value~"code") and (name~"^ABC")] OK? /system script environme...
by Sertik
Thu Jul 20, 2023 10:39 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

Yes, but the received data can no longer be sent using the /tool ​​sms send method. It will be necessary to send through the modem PDU mode, right? But we don’t have the function of creating a ready-made PDU ... Do I understand correctly?
by Sertik
Thu Jul 20, 2023 10:29 pm
Forum: Scripting
Topic: Remove from the environment variables that satisfy the conditions
Replies: 6
Views: 2319

Remove from the environment variables that satisfy the conditions

Only variables that are functions with a specific name pattern need to be removed from the environment For example, you want to remove all functions that contain code and whose names start with ABC. Yes, this can be easily done with a :foreach loop, but I want to do without it. Here are the beginnin...
by Sertik
Thu Jul 20, 2023 2:46 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

sometime in 2020 I wrote the function of transliterating Russian messages for Telegram There is not a complete CP table, but all the characters needed for transliteration. https://habr.com/ru/articles/519406/ # Function Translite of Russian characters for sending in Telegram # by Sertik 16/09/2020 #...
by Sertik
Thu Jul 20, 2023 2:18 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

Mi vsi brati, xochesh ne xochesh :D That's right. That is, we do not communicate with the PDU, but simply transliterate the SMS and send it using the usual /tool ​​sms send tool. This, of course, is not what I wanted, but also a way out. But in the link I already gave, it says that sending Russian-...
by Sertik
Wed Jul 19, 2023 1:42 pm
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

How now to transfer this to the modem using lte-at chat ? Just a line?

For PDU, after all, it is necessary to read and transmit the length of the SMS, the recipient's number and the SMS itself ...
by Sertik
Mon Jul 17, 2023 4:37 pm
Forum: Scripting
Topic: TLGRM - combined notifications script & launch of commands
Replies: 7
Views: 9157

Re: TLGRM - combined notifications script & launch of commands

An alternative system Telegram active Runner and Notifier (TaRaN) has also been created:

https://forummikrotik.ru/viewtopic.php?f=14&t=14281

the truth is not adapted yet under ROS7
by Sertik
Mon Jul 17, 2023 4:13 pm
Forum: Scripting
Topic: Built in function library
Replies: 142
Views: 154232

Re: Built in function library

As for the built-in functions, I will refrain from speaking for now, but what I would like is that it would be possible to create sections in the script repository , so that it would be possible to store scripts not in a common huge list. After all, the number of scripts in the repository of a moder...
by Sertik
Mon Jul 17, 2023 4:01 pm
Forum: Scripting
Topic: Built in function library
Replies: 142
Views: 154232

Re: Built in function library

We are considering to add commonly used functions as built-in. What functions would you like to see? For example, MD5hash, random number generator and so on. Please fix the "third function call" error at last. For example, we have a function: :local myFunc do {:log info "Hello world ...
by Sertik
Mon Jul 17, 2023 3:04 pm
Forum: Scripting
Topic: Frequent empty variables in scripts turned out to be Bug ?
Replies: 10
Views: 2608

Re: Frequent empty variables in scripts turned out to be Bug ?

No, they won't fix it. We reported a long time ago that when a function is executed twice in a subshell, it is executed three times. Woz and now there. Mikrotik doesn't know how to fix the error. [$myFunc] [$myFunc] Yes, I agree with Amm0, there is no "third time error" without a shell. $m...
by Sertik
Thu Jul 13, 2023 11:38 am
Forum: RouterBOARD hardware
Topic: M.2 modem for RBM33G
Replies: 1
Views: 2589

M.2 modem for RBM33G

Has anyone tried to install an M.2 modem on the RBM33G platform? Does RouterOS support such integration and with which modems?
by Sertik
Thu Jul 13, 2023 10:39 am
Forum: Scripting
Topic: $INQUIRE - prompt user for input using arrays +$CHOICES +$QKEYS
Replies: 28
Views: 5534

Re: $INQUIRE - prompt user for input using array of questions, ft. inline functions (>[])

Also, the Amm0 script is good as an example of using (>[]). Question to the author: now what do you think when in practice it is appropriate to use the new data type op (>[]) that you explored?
by Sertik
Thu Jul 13, 2023 10:22 am
Forum: Scripting
Topic: $INQUIRE - prompt user for input using arrays +$CHOICES +$QKEYS
Replies: 28
Views: 5534

Re: $INQUIRE - prompt user for input using array of questions, ft. inline functions (>[])

By the way, what is the /terminal cu command and when did it appear?
by Sertik
Thu Jul 13, 2023 8:45 am
Forum: Scripting
Topic: $INQUIRE - prompt user for input using arrays +$CHOICES +$QKEYS
Replies: 28
Views: 5534

Re: $INQUIRE - prompt user for input using array of questions, ft. inline functions (>[])

Very cool !
Practically a preceptron of a neural network. A little more and there will be artificial intelligence on Mikrotik. :D
by Sertik
Mon Jul 10, 2023 9:56 pm
Forum: Scripting
Topic: check the element for occurrence in the key array without circle
Replies: 9
Views: 2201

Re: check the element for occurrence in the key array without circle

If I may have one more small question, Rex: Can I somehow check for the occurrence of an element in several arrays at once? I try this - it doesn't work: :local array1 {"a1"="val1"; "a2"="val2"} :local array2 {"b1"="val3"; "b2"=&q...
by Sertik
Mon Jul 10, 2023 12:28 pm
Forum: Scripting
Topic: check the element for occurrence in the key array without circle
Replies: 9
Views: 2201

Re: check the element for occurrence in the key array witnout circle

I immediately saw this error, but I don't know how to fix the title of the post
by Sertik
Mon Jul 10, 2023 11:25 am
Forum: Scripting
Topic: check the element for occurrence in the key array without circle
Replies: 9
Views: 2201

Re: check the element for occurrence in the key array witnout circle

:if ([:typeof ($arrayCom->"key2")] != "nothing") do={
Thanks !
by Sertik
Mon Jul 10, 2023 10:02 am
Forum: Scripting
Topic: check the element for occurrence in the key array without circle
Replies: 9
Views: 2201

check the element for occurrence in the key array without circle

You can check an element for occurrence in a simple array like this: :local list [:toarray "a, b, c, d"]; :if ([:len [find key="a" in=$list ]] > 0) do={log warning "Yes"} else={:log error "No"} An attempt to similarly check in the key array fails: :global arra...
by Sertik
Mon Jul 10, 2023 9:07 am
Forum: Scripting
Topic: Convert cyrillic to PDU modem format for sending SMS
Replies: 31
Views: 5300

Re: Convert cyrillic to PDU modem format for sending SMS

It would be much easier if MT improves SMS tool
It is unlikely that we will wait for this, it's better to wait until Rex becomes freer. :D
  • 1
  • 2