Scripts won't run

None of my scripts will execute, even the simple ones. When I click the Run Script button (or execute the command using the terminal) nothing happens. No error, no execution, nothing.

What is causing this?

what version of RouterOS are you running, and also please show us one of your simple scripts.

Could you be so kind and post script that isn’t working?

maybe ur scripts rights as a command .. but there is no thing to do it !!

pleaes tell us what the script wirung for .. ans what is the script :question:

DynamicIP Script

:log info "Dynamic IP Update Via Mail: Begin"

:global dip-interface "I-Burst"

:global dip-ip [ /ip address get [/ip address find interface=$dip-interface] address ]

:if ([ :typeof $dip-lastip ] = nil ) do={ :global dip-lastip 0.0.0.0/0 }

:if ([ :typeof $dip-ip ] = nil ) do={

  :log info ("Dynamic IP Update Via Mail: No ip address present on " . $dip-interface . ", please check.")

} else={

  :if ($dip-ip != $dip-lastip) do={

    :log info "Dynamic IP Update Via Mail: Attempting to Send Updated IP ". $dip-ip
    /tool e-mail send to="ip@internetguy.co.za" body=$dip-ip subject=([/system identity get name] . " New IP Address " . $dip-ip)
    :log info "Dynamic IP Update Via Mail: Sending UPDATE!"
    :global dip-lastip $dip-ip

  } else={ 

    :log info "Dynamic IP Update Via Mail: No change" 

  }

}

:log info "Dynamic IP Update Via Mail: End"

Script2

I attempted to run the following one line command, again nothing happens when I execute a command or click the button, to run the script. There is also no log messages.

/tool e-mail send to="ip@internetguy.co.za" body=$dip-ip subject=([/system identity get name] . " New IP Address " . $dip-ip)

Strangely enough, I wrote a new script this morning to add a user and it runs.

/ tool user-manager user 
add subscriber=Justin name="Test" password="test" first-name="Justin" \
    last-name="Minnaar" phone="011 849 5336" location="Howick Gardens #56" \
    email="Test@Region.co.za" download-limit=100000000 \
    upload-limit=100000000 comment="Test account with 100k up and 100k down" disabled=no

Any advice would be appreciated.

:log info "Dynamic IP Update Via Mail: Attempting to Send Updated IP ". $dip-ip

the above line is incorrect. Put ( ) around the text so it evaluates the statement.

Sam

Thank you for your help. I have resolved the problem by deleting the offending line. I could not get ( ) around the string . string to work correctly and figured I would probably have to create a local variable but it was not neccessary. Anyway, the script runs now successfully! Funny enough, other lines have ( ) for logging info and work fine.

correct code would be:

:log info ( "Dynamic IP Update Via Mail: Attempting to Send Updated IP " . $dip-ip )

and it works.

Has anyone yet made an attempt at writing a basic syntax compiler for MT Scripts?

Or is MT Scripts based on a scripting language that has a compiler. Even if it wont compile completely, but just check the syntax symbols?

Syntax “compiler” is already built in.
Write a script and if there are any syntax errors
/system script print will highlight them.

I think the request was for an external syntax checker with diagnostics. That would definitely be a very useful tool.

That would definitely be a very useful tool.

Yip. That would be great! Some form of a tool to guide you in the right direction when debugging. I sat once for 3 hours staring at a uncompilable script just to find a simple math error.

Has there been attempts at producing such a tool?