Originally Posted by
Dan the man
If you aren't using the SRL include, you could use a similar method that the SRL.DismissRandom() function uses.
The function searches for the overhead text that includes your display name, then uses the minimap to get the main screen point of the NPC. Instead of using the minimap (because that method is exclusive to SRL), you could use the overhead text to identify if a random is after you, then have a bank of NPC objects to search through (colours to identify them uniquely). The benefit of this is you aren't having to search every colour for every potential random event multiple times a minute, but rather relying on the common denominator: your screen name.