Quote: infinite loops weren't just a possibility, they happened all the time I see the nb comment about stack overflows.
Quote: If we only match once (on the newly displayed line) then only one change gets made. Precisely this.
Quote: If we match more than once, what limit do you impose? I would impose the limit that a given trigger can only fire once (the repeat on same line checkbox should re-fire as many times as necessary until done and then not fire again after that) for each new line index. Rather than checking all triggers, check only the ones that have not yet fired from a listing that resets upon each new line.
Quote: Indeed, if a "prompt" trigger matches more than once there is the potential for "xp counting" triggers to be wrong (if it matches twice you count the XP twice). One reason why any given trigger should only be allowed to fire once per line.
Quote: Then you have the issue, if a line matches, and gets omitted and redisplayed, what line do subsequent triggers match on? The original? Or the modified one? Subsequent trigger checks should be matched against the new line, not the original line. The once-per-line limit should not reset until new unrelated data is shown.
Example for above statements:
Say there are four triggers, numbered in order of sequence...
1) match="{channel_tag}*", omits from output, sends SimNote("%1")
2) match="Fiendish says*", omits from output
3) match="*Fiendish*", omits from output, sends SimNote("%1jerkface%2")
4) match="*", omits from output, sends SimNote(string.gsub("%1","pants","Fiendish"))
Now the first trigger is in a plugin. As far as the user knows, it doesn't exist. As far as the user knows, the server sends the output of the resulting Note. The second trigger is created by the user to just block all instances of me saying something. The third is created to replace my name in other instances with something more suitable. The fourth trigger is only there because I'm not feeling hugely creative right now and am having a hard time thinking of more legitimate loops from reprocessing.
So when the mud sends:
Quote: {channel_tag}Fiendish says your pants are on backwards. Trigger 1 fires, removing the {channel_tag} and leaving just
Quote: Fiendish says your pants are on backwards. Trigger 2 fires, eliminating the line. Triggers 3 and 4 do not fire.
And when the mud sends:
Quote: {channel_tag}Your pants say that Fiendish is on backwards. Trigger 1 fires again. Trigger 2 does not fire. Trigger 3 fires and produces
Quote: Your pants say that jerkface is on backwards. Trigger 4 fires and produces
Quote: Your Fiendish say that jerkface is on backwards. Trigger 3 does not fire again. Trigger 4 does not fire again.
Now I know that Etzli wants a new function/option that handles substitution as a special case. And maybe that's the best way to deal with this. Or maybe Simulate isn't so bad for this particular use case? |