Jango:

1) Does the variable $agent_path point to the proper directory where the merlin.acs character file resides.

2) Place this:

?"Error @error : @serror"

after the next function call in your script.

Run your script again and if it's Error 0, move it to after your next function call.

Keep doing this until you get an error code displayed. This will be your trouble spot !

Shawn.