Luascripts line killing orthanc restart

I am wanting my orthanc VM Ubuntu 18 to auto forward a study when it receives it.

I have successfully done this on a raspberry pi physical machine with orthanc installed from the normal repositories
I have the line

“LuaScripts” : [“/etc/orthanc/lua/first.lua”
],

in the orthanc.json

On the pi machine it works just dandy with first.lua being

Function OnStoredInstance(instanceId, tags, metadata)

SendToModality(instanceId, ‘AUX’)

end

I have also chmod +x first.lua

but trying to do the same thing on the 18 machine orthanc will not restart until I comment out the luascripts line

I have AUX as a valid AET and can echo it from either machine.

I have pored over the syntax to make sure it’s not a typing error.

Is there a difference between versions? or is this a known error?

And thanks to the developer(s) this is generally wonderful, but it would be great if orthanc threw an error message when the config file

is kludged, instead of just not starting.

Odd… I found the orthanc log… and it’s choking on the lua script… same script that works on the pi doesn’t work on the ubuntu

ver 1.2.0 on the pi ver 1.3.1 on the ubuntu

Error while executing lua script: [string “line”]:1:1 ‘=’ expected near ‘OnStoredInstance’

anyone know what the new lua script should look like for this?

Holy Friggin Crap…

3 hours of my life and I tripped across the fact that function cant have a capitol F

Function OnStoredInstance(instanceId, tags, metadata)

SendToModality(instanceId, ‘AUX’)

end

fais

function OnStoredInstance(instanceId, tags, metadata)

SendToModality(instanceId, ‘AUX’)

end

works… What the Function Talk about a picky scripting language…