Community discussions

MikroTik App

Search found 13 matches

by Chupakabra303
Thu Oct 24, 2019 4:11 pm
Forum: Scripting
Topic: Replace characters in string (url encode)
Replies: 15
Views: 13049

Re: Replace characters in string (url encode)

This mikrotik parser bug! works correctly: [admin@MikroTik] > :local arr1 ({}); :set ($arr1->"\$") "%24"; :put ($arr1->"\$") %24 correct and not working! [admin@MikroTik] > :local arr1 {"\$"="%24"}; :put ($arr1->"\$") Wrong but next works! But without one quotes: "\$ " work again [admin@MikroTik] >...
by Chupakabra303
Sat Jul 20, 2019 5:14 pm
Forum: Scripting
Topic: How to check if array is empty [SOLVED]
Replies: 3
Views: 1975

Re: How to check if array is empty [SOLVED]

:if ([:len $array1] > 0) do={
by Chupakabra303
Thu May 16, 2019 4:47 pm
Forum: Scripting
Topic: How to check if value is empty?
Replies: 6
Views: 6181

Re: How to check if value is empty?

Magic word "any":
[find where !any routing-mark and dst-address=0.0.0.0/0 and active=yes]
by Chupakabra303
Thu Apr 18, 2019 11:42 am
Forum: Scripting
Topic: macros bug [SOLVED]
Replies: 14
Views: 3712

Re: macros bug [SOLVED]

It's not working in scripts with log. if i did it in terminal it's work perfect.
Declare a global variable before use in function!
global print do={
:global test
if ( $test = yes) do={/log info yes} else={/log info no}
}
by Chupakabra303
Tue Oct 23, 2018 12:53 pm
Forum: General
Topic: Cloud Backup
Replies: 21
Views: 5707

Re: Cloud Backup

It would be great. But it better to learn fetch tool to upload file (backup) (multipart/form-data) over http(s) on my server?
by Chupakabra303
Wed Sep 26, 2018 4:28 pm
Forum: Scripting
Topic: Empty array initialization
Replies: 5
Views: 3307

Re: Empty array initialization

I found out incorrect work for syntax :local Array1 ({}) Works correctly :local Array1 [:toarray ""] :global fArrayTest do={ # correct work :local Array1 [:toarray ""] # :local Array1 [:toarray ""] # BUG, incorrect work :local Array1 ({}) :local Array1 ({}) :set ($Array1->([:len $Array1])) [:len $Ar...
by Chupakabra303
Wed Sep 26, 2018 4:08 pm
Forum: Scripting
Topic: Parser bug
Replies: 1
Views: 486

Re: Parser bug

:put [[:parse "({$("a" ."b")=1;$("b"."a")=2;\"ab\"=3})"]]

:local a "AAA"; :local b "BBB"; :put [[:parse "({\"$a$b\"=1;ab=2})"]]
by Chupakabra303
Mon Sep 10, 2018 5:45 pm
Forum: Scripting
Topic: Replace characters in string (url encode)
Replies: 15
Views: 13049

Re: Replace characters in string (url encode)

# ------------------- fURLEncode ---------------------- :global fURLEncode :if (!any $fURLEncode) do={ :global fURLEncode do={ :local Chars {" "="%20";"!"="%21";"\""="%22";"#"="%23";"$"="%24";"%"="%25";"&"="%26";"'"="%27";"("="%28";")"="%29";"*"="%2A";"+"="%2B";","="%2C";"-"="%2D";"."="%2E";"/"="%2...
by Chupakabra303
Thu Jul 05, 2018 11:26 am
Forum: General
Topic: Please fix fetch so we can use data: variable in scripts.
Replies: 4
Views: 1033

Re: Please fix fetch so we can use data: variable in scripts.

I join the aforementioned.
Another way to get public ip:
:put [:resolve domain-name="myip.opendns.com" server=resolver1.opendns.com]
by Chupakabra303
Wed Apr 18, 2018 1:55 pm
Forum: Scripting
Topic: Built in function library
Replies: 60
Views: 26408

Re: Built in function library

LUA +1
Internal JSON parser to associative array variable (by type http://www.embest.ru/mikrotik/json-parser-script)
by Chupakabra303
Wed Apr 18, 2018 1:39 pm
Forum: General
Topic: Feature requests
Replies: 1216
Views: 262255

Re: Feature requests

file get contents
Increase threshold 4096 byte, while reading the file or make the file reading by pieces. 4K is too little!
by Chupakabra303
Wed Apr 18, 2018 11:41 am
Forum: Announcements
Topic: v6.42 [current]
Replies: 147
Views: 34686

Re: v6.42 [current]

*) fetch - added "output" option for all modes in order to return result to file, variable or ignore it;
I have failed to write in variable. Any way.
by Chupakabra303
Tue Jan 09, 2018 11:18 am
Forum: General
Topic: RAMdisk
Replies: 12
Views: 2237

Re: RAMdisk

+1
RAM disk is very good.
I have 2 scripts that use priodical call fetch function.