16MB is really no argument at all. I've been running PCs from Floppies (5 1/4) and worked with Amiga which had only about 512kb of RAM and even managed to hava a full blown GUI. You can get a hell lot of stuff into 16MB.Whole system has to fit in 16MB, so there are some limits on how many features scripting can have... so no linter to find the "use of undefined global in function". There is ":import verbose=yes <scriptfile.rsc>" that helps find what line something is failing.
You really want to kill meFWIW, a function can also be a member of an array. This is another approach to storing functions for re-use (e.g. a single global array, with function as named elements). But similar to locals, functions-in-array do not have access to the containing array (& limits use of array as "class"). And, confusingly, the stack gets shifted so $0 is first parameter to a function in an array (see viewtopic.php?t=181142)
There are a lot of oddities in RouterOS scripting.

(BTW I'm just using it for my home setup, nothing fancy. Just my nerdy way of approaching the home network. Actually the main driver was that the router I had before didn't manage QoS well so when someone was downloading a bigger file at max speed it broke IPTV. At least that works now

Statistics: Posted by MakroTok — Fri Mar 01, 2024 7:03 pm