Crons are bad for this. You want to process it with misns instead so that someone can take off, fire, land and reload immediately. In other words, you need a BITEC.
Outfit ... OnPur ......... OnSel ............. Function
1 .......... D3 .............. G3 ................. Standard missile ammo, max of 12
2 .......... D3 .............. G3 ................. Wacky missile ammo, max of 12
3 ...................................................... Missiles allowed
4 ...................................................... Temp counter
5 ...................................................... Temp holder
6 ......... G7 (G3)*12 ... D7 (D3) *12 ... Standard launcher, increases max of 1 by 12
7 ...................................................... Wacky launcher, increases max of 2 by 12
Using increase max means that you can't just buy the launcher, buy some missiles, sell of the launcher, buy the launcher, buy some missiles etc. in order to get over the limit. You can only sell the launcher if you've sold the rack.
Due to the odd behaviour of the fields for weapons, may need over Gxxx and Dxxx operators in there.
Syst ... Visability
1 ....... ((O1 & b1) | (O2 & b2) | (O5 & (b4)) | (O4 & b3)) & !b0
2 ....... ((!O1 & b1) | (!O2 & b2) | (!O5 & (b4)) | (!O4 & b3)) | b0
Each syst contains spob 1
Misn ... OnSuc . ...... On Ab
1 ............................ b1 (!b0 S2 b0 A2)*12 !b1 b4 (!b0 S3 b0 A3)*12 !b4 b2 (!b0 S4 b0 A4)*12 !b2 b4 (!b0 S5 b0 A5)*12 !b4 (D3)*12 b3 (!b0 S6 b0 A6)*12 !b3
2 ........ D1 G4 G5 .......
3 ........ D5 G1 ............
4 ........ D2 G4 G5 .......
5 ........ D5 G2 ............
6 ........ D3 D4 ............
The misn destination is spob 1. Misn 1 auto starts when you enter an outfitter and autoaborts instantly.
Requires: 6 misn, 5 ncb, 5 outf, 2 syst, 1 spob.
May be necessary to use 2 misns in place of the first of the character limit is too small, bearing in mind that anything with (Zxxx)*n means type out Zxxx n times. In that case you would simply have misn 1 start and abort the misn holding the rest of the code.
Note that this works only if you have 1 rack. I think it should work fine if you capture more than 12 missiles. There would be ways to do it for more than 1 rack, involving nesting a few more misns.
------------------
(url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)