Scripts do not have access to global variables when schedule

I hit a wierd problem that i think is a bug in 3.0rc10

I made a script that uses global variables (by another script)

When i run the script manually everything works as expected, but when i schedule it it didnt work
Too me a while to trace where the problem is but it appears that when scheduled, scripts have no access to already defined global variables.

for example if i define :global MYTEST 200 in one script or in the console and create script as follows:
:global MYTEST
:log info ($MYTEST)

When runing the script manually everything is working
byt when runing it with scheduler i get nothing

Is this a bug or am i doing something wrong?

Kind regards

this broke a lot of my scripts too … global isn’t really global anymore I think. Please fix it : )

http://forum.mikrotik.com/t/global-variables-are-not-global/17039/1

I don’t think you have to use :global definition before using the variable.
Try removing the line that says “:global MYTEST” (which by 2.9.x definition would also unset $MYTEST)

global variables are accessible if they are defined by one user, for example if user admin defined variable myVar from console, and added scheduler script to access this variable, It won’t work.