[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Problems repeating trigger on same line

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Problems repeating trigger on same line
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Larkin   (278 posts)  [Biography] bio
Date Fri 22 Aug 2008 03:19 PM (UTC)  quote  ]
Message
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.
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Fri 22 Aug 2008 02:39 PM (UTC)  quote  ]

Amended on Fri 22 Aug 2008 02:45 PM (UTC) by Worstje

Message
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.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Fri 22 Aug 2008 02:26 PM (UTC)  quote  ]
Message
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>
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,739 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]