I’m in the process of writing an extremely long script and it appears I’ve hit a 30,000 character limitation. Anybody know how to get past this? Like in other programming languages, is it possible to include other script files in this script?
Check run command to execute scripts in another scripts.
/system script run script
Like this script
You can setup/change a variable with the file name like this example.
http://wiki.mikrotik.com/wiki/Log_Parser_-_Event_Trigger_Script
I’ll give that a shot. I think that may work, I will just need to convert to global variables instead.
I know it’s been a while since this thread was started, but this is the only thread I’ve seen when I googled for the 30,000 MikroTik character limit, so in case anyone else comes across this, I thought I’d update it.
Basically, I doubt that there is a setting anywhere to disable the limit, but it appears that the limit is only set for writing characters in WinBox. That basically means that if you create your massive script outside of WinBox and import it using an rsc file, it will import without a problem. If you open the script in WinBox after that, you’ll be able to read the entire script, but you won’t be able to write any new characters until you delete enough characters to be below the 30,000 character limit. Annoying, but effective.
I am unable to make my script run another script because my script needs to create other large scripts in certain cases, and not others. I might figure something out so that my script doesn’t need to create large secondary scripts (scripts within scripts are a pain to code anyway), but I hadn’t needed one until I hit the limit a few minutes ago so I haven’t looked into it yet.
I’m intrigued what your 30,000 line script is doing.
The script is so big that it actually requires using three script files and I will be rolling it out soon for public consumption. It is an automated configuration script called Redundant Multi-WAN Site to Site VPN with Automatic Failover that can be ran on each site to create a fully meshed VPN tunnel network using IPSec over IPIP tunnels. I decided to write the automated script after I created all the rules manually which took several days on end so that should tell you how much configuration is involved when you get up to like 7 sites fully interconnected each with dual WANs.