Added addScriptVar function and its helpers