Once again thanks for all the feedback - makes all the effort of jumping around various people's scripts, the boards and the wiki trying to learn javascript for Oolite worthwhile.
On Detection Rate:
It is 100% and I think it should remain at 100%. The core game function of giving a penalty when the player launches from a main station with contraband is as far as I know 100% and the original reason for this OXP was to emulate that function for docking with a main station to close down what to me is a exploit in a multi dockable objects Ooniverse.
In game I see as all Galcop stations (and my understanding of canon is that all main stations are run jointly between Galcop and whatever planetary government there is) are fitted with high tech scanning equipment in the docking tunnel which scans holds on the way in and out and don't fail.
Having said that it's quite conceivable that in some less lawful systems, local officials may not be so concerned about upholding the letter of the law and could be susceptible to a little bribery to let a contraband cargo pass without penalty. Of course attempting to bribe an official who is a stickler about the law could see even greater penalties applied...
So I plan to offer a third option on the first mission screen - which will basically be offer a bribe.
I may also rewrite the code to allow for a detection rate, and penalty levels etc to be held as variables and clearly commented in the script so that end-users can tweak if they so wish.
Hypercargo + Vortex:
Thanks Thargoid and Okti for the heads up. I've downloaded both OXP's and think I understand the code. I think it's easy enough to do an equipment check for Hypercargo and I should be able to hack the this.shipLaunchedFromStation = function(station) from the Hypercargo script to perform a similar function on docking. I'll shout if I get stuck.
However looking through the Vortex scripts I can't find any code that would give a legal penalty on launching from a station. Do Vortex pilots get an penalty if they launch from a main station with contraband in one of the multibays? If not I'll leave the Vortex out of this OXP - you get some bonuses for such an expensive ship after all.
Plans:
Work on another release with the option to bribe, make compatible with Hypercargo, and tidy up the mission screens a little more. The basics of 1.1 were written in my lunchhour on Friday and bugfixed about 5am yesterday morning (early riser), but the brain isn't always firing on full at that time of the day, hence the odd typo and the room for misunderstanding on the penalty screen.
Then start working on some 'rescued slaves' make contact and offer rewards missions. I've got some nice ideas for this.
No time-scales - Oolite time is generally limited to an hour or so before work on weekdays and a couple of hours at weekends.