This post details how I set up an automated decal numbering system. A random number is assigned to a dummy object that matches a name convention and any decal objects attached to that dummy assume the same ID. The ID can be used for material assignment purposes, in this case it is to drive a sprite sheet that renders that number to a material.
At a minimum the script should be a good jump point for automating parts of procedural artwork.
As used in this image: