I made a very simple one a few weeks ago..
All it does, is sets a random number as a variable, then it is told to include ad + randomnumbervar + .txt
And then I put into say.. ad15.txt what I want to be included, eg. an img tag and a link.
If you want me to write a little demo thing get back ot me, if you want something a little more professional and random...i cant help sorry!
Andrew