Remington makes a scope/rifle combo that does that now.
Was that book maybe Candle by John Barnes? There’s mention of that during some of the characters discussion of their time in the meme wars.
Since I never read that one...
Doesn’t mean the idea hasn’t been in more than one book :)
Or, in the case of Remington, in a (very expensive) product.