M/scripts and refs

afaik only ScriptExceptions should be used here