Problems repeating trigger on same line

Posted by Larkin on Fri 22 Aug 2008 02:26 PM — 3 posts, 15,974 views.

#0
I wanted to simplify my code for capturing the contents of my rift (Lusternia) from a regex with three groups, two of them optional, to just one group that repeats. The repeat on same line option had no effect at all, however. Can anyone tell me if I'm doing something wrong?

Rift output shows:
Glancing into the Rift, you see:
  [  23] yarrow             [ 588] colewort           [ 144] wormwood
  [ 192] kombu              [ 158] reishi             [ 103] arnica
  [1305] coltsfoot          [ 201] yellowtint         [ 251] pearl
  [ 304] moonstone          [1077] platinum           [1200] gold
  [ 425] greentint          [ 297] marble             [1497] wood
  [ 502] rope               [  90] redtint            [ 279] amethyst
  [ 188] jade               [ 359] bloodstone         [ 298] bluetint
  [ 240] ruby               [ 105] turquoise          [ 351] beryl
  [ 260] emerald            [ 405] onyx               [ 300] gems
  [ 281] opal               [ 244] purpletint         [ 399] cloth
  [ 225] coral              [ 880] steel              [ 288] garnet
  [ 303] sapphire           [  21] goldtint           [ 100] coal
  [ 678] salt               [ 600] sulfur             [ 169] pennyroyal
  [ 682] sparkleberry       [ 152] earwort            [1056] marjoram
  [ 107] rosehips           [  11] sage               [ 180] silver
  [ 129] myrtle             [ 170] horehound          [  39] galingale
  [ 909] calamus            [ 174] kafe               [  29] merbloom
  [ 385] iron               [  26] juniper            [ 416] mistletoe
  [ 219] spices             [ 436] diamond            [ 328] leather
  [ 165] chervil            [ 200] sargassum


Trigger I tried that doesn't work:
<triggers>
  <trigger
   enabled="y"
   match="\s+[\s*(\d+)] (\w+)"
   regexp="y"
   repeat="y"
   send_to="12"
   sequence="10000"
  >
  <send>gear:rift("%2", %1)</send>
  </trigger>
</triggers>

(Also tried it with keep_evaluating="y" and that had no effect.)

Trigger I'm using that does work:
<triggers>
  <trigger
   enabled="y"
   match="^  [\s*(\d+)] (\w+)(?:\s+[\s*(\d+)] (\w+))?(?:\s+[\s*(\d+)] (\w+))?$"
   regexp="y"
   send_to="12"
   sequence="10000"
  >
  <send>gear:rift("%2", %1)
if #"%4" > 0 then
  gear:rift("%4", %3)
  if #"%6" > 0 then
    gear:rift("%6", %5)
  end
end</send>
  </trigger>
</triggers>
Netherlands #1
That is because "Repeat on same line" isn't meant for that. "Repeat on same line" only affects the colouring options of the trigger, not the scripting part.

Likewise: your trigger is botched. You should atleast try to escape the [] ones, since now it is treating them as a character class and not as literal characters.

Edit: if you want I can get you the triggers I use for Aetolia later. I think I used three seperate triggers, but I made them years ago when I just started scripting.
Amended on Fri 22 Aug 2008 02:45 PM by Worstje
#2
Ah. Okay. Didn't realize it was only for colors. :(

I do have the brackets escaped in my pattern. The forum stripped out the backslashes because of forum codes. Good eye, though!

Thanks for the help.