///// The 1-key was hit by player 0

macro "p06"//This is a macro

loop
get "player16"
mark 1//floats 1-3 contain position of the target town
seti 1,0
loadi "life",2
if i,2,>,1

setb 1,true//true throughout this script
setb 3,true//true when a free missile base was found

//Now find a missile base that is not shooting
get "player01"
loadb "busy",2
if b,2,=,1
get "player02"
loadb "busy",2
if b,2,=,1
get "player03"
loadb "busy",2
if b,2,=,1
get "player04"
loadb "busy",2
if b,2,=,1
get "player05"
loadb "busy",2
if b,2,=,1
get "player06"
loadb "busy",2
if b,2,=,1
//all missile bases are busy
player
setb 3,false
endif
endif
endif
endif
endif
endif

if b,3,=,1
storef "targetX",1
storef "targetY",2
storef "targetZ",3
storeb "busy",1
endif
else
player
mark
seti 1,9
sndplay
endif

endloop