some kind of multiple line trigger

Posted by Tarrant on Wed 14 May 2003 10:24 PM — 9 posts, 27,800 views.

#0
the prompt on the mud I play looks like this:

< 699h/699H 166v/166V>

I have a lot of text gagged to reduce spam, and often it happens that everything in a round is gagged, while that lessens the spam i still see a lot of this kind of spam

< 699h/699H 166v/166V>
< 699h/699H 166v/166V>
< 699h/699H 166v/166V>
< 699h/699H 166v/166V>
< 699h/699H 166v/166V>

Because even though the text is gagged the rounds are still going by....I'm wondering how I can make it so every multiple line of my prompt would be gagged?
#1
And just to clarify...the numbers in the prompt will be changing...
Australia Forum Administrator #2
You mean, show it if it changes, but not otherwise?

I would make a trigger that matches on the prompt, and omits from output, eg.

< *h/*H *v/*V>

The trigger would call a script that compare the prompt to saved values (or just a saved prompt for that matter), and if different displays it, and then saves the new prompt.

Something like this:


<triggers>
  <trigger
   enabled="y"
   match="&lt;*h/*H *v/*V&gt;"
   omit_from_log="y"
   omit_from_output="y"
   script="DoPrompt"
   sequence="100"
  >
  </trigger>
</triggers>


And in your script file:


sub DoPrompt (name, line, wildcards)
  if GetVariable ("saved_prompt") <> wildcards (10) then
    ColourNote "white", "black", wildcards (10)
    SetVariable "saved_prompt", wildcards (10)
  end if
end sub

#3
hm doesnt seem to be working?

ex:

You dodge Meerflop's vicious attack.
You miss Meerflop.
< 711h/711H 141v/141V>
You dodge Meerflop's vicious attack.
You miss Meerflop.
< 711h/711H 141v/141V>
< 711h/711H 141v/141V>
You dodge Meerflop's vicious attack.
You miss Meerflop.
< 711h/711H 141v/141V>
< 711h/711H 141v/141V>
< 711h/711H 141v/141V>
< 711h/711H 141v/141V>
< 711h/711H 141v/141V>

#4
i'm guess there should be a variable named saved_prompt in my variable list? thats not getting created if so
Australia Forum Administrator #5
Is it matching? Try setting the trigger to colour the output, and omit the 'omit from output' for now. The fact that you are seeing the prompts suggests it isn't matching for some reason.
#6
Yeah put a color on and it doesnt seem to be matching
#7
I changed it to match < * just to see if it would work and it does in that case. then i tried < *> and it didnt work for some reason.
Australia Forum Administrator #8
There's probably a trailing space, or two. Triggers have to match literally, and a single space can throw them out. You could try putting a space at the end, but to be sure, click and select part of one of the relevant lines (eg. double-click a word on it), and then go to Display menu -> Text attributes (Ctrl+Alt+A) and then click the "Line Info" button. You can then see exactly what is on the line, like this:


Line 684 (684), Saturday, May 17, 6:44:43 AM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 23, last space = 22
 Text = "< 699h/699H 166v/168V> "


In this example you can see the space at the end because it puts the whole line in quotes.