D
D
Dnishe2021-04-02 02:33:48
Mikrotik
Dnishe, 2021-04-02 02:33:48

How to remove the first character from a variable in routerOS (mikrotik)?

"I am writing" a bot for Mikrotik with receiving commands via telegrams. Found a few bots and copy-pasted them. The bot works fine, but when I started to bring beauty I ran into a problem.
I don't understand how to parse text into a command without the "/" character.

When I write a command in a telegram without a slash, everything works. After I add a slash, for convenience, the program does not perform actions

A photo
606654cbeeb5f047047787.png


Tell me how to remove the first character from the "$command" variable or how to create a new variable that will be without a slash.

system script run $command

I did not find how to work with text in RouterOS scripting (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-04-02
@Dnishe

https://wiki.mikrotik.com/wiki/Manual:Scripting#Gl...
Use the pick command to get a substring

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question