I made a trigger that matches ^(\D+)(\d+)\s+(\D.*)$ which has the associated script:
the ihFlag variable is just there to keep the pattern from matching at inappropriate times. Anyways, the links show up and work properly, except if I click one of them (either the add or remove buttons) it only pattern matches the last item in the room description. In this case, if I click any of the 'add' links, then it'll call the function addHuntTarg("a runic totem"). So what appears to be happening is that ihDescription is not sticking to the clickable link itself, but the link accesses the value of ihDescription at the time I click it. How do I get the desired behavior?
EDIT: I'm going to be accomplishing this particular task through GMCP, but I'd still love to hear the solution as I intend to write similar scripts in the near future that will have the same problem.