Pirates menaced the coastal settlements, but by 1718 the pirates had been captured and killed