I posted one on the wiki a while a go that I changed slightly so it takes into account lightrange.