at the restoration the privy council established a force of an unknown number of infantry regiments and a few troops of horse. the commonwealth fortresses were abandoned, but garrisons were placed in edinburgh, stirling, dumbarton and blackness castles. there were attempts to found a national militia on the english model. the standing army was mainly employed in the suppression of covenanter rebellions and the guerilla war undertaken by the cameronians in the east. units included a regiment of foot guards, later known as the scots guards and le regiment of douglas, formed and serving in france since 1633, it returned, eventually became the royal regiment of foot. pikemen became less important in the late seventeenth century and after the introduction of the socket bayonet, a process complete by 1702, disappeared altogether, while matchlock muskets were replaced by the more reliable flintlock. three troops of scots dragoons were raised in 1678 and another three were added to make the royal regiment of scots dragoons in 1681. on the eve of the glorious revolution the standing army in scotland was about 3,000 men in various regiments and another 268 veterans in the major garrison towns, at an annual cost of about £80,000. after the glorious revolution the scots were drawn into king william ii's continental wars, beginning with the nine years' war in flanders (1689–97).