|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 9:01 am
capturing and gagging (partial) |
Quote: |
[25 Human Dru] Pullak the Druid Hound
[34 Fire A-P] (PK) Gardell
[8 D-Elf Hea] Swivinl Desharn the Taker of Life
Players found: 2 |
For the above-
-I want to copy it to another window (called wholist).
-Keep it on the original window.
-On the wholist window I want to hide/gag the title (if there is one).. anything that comes after the name (or last name)
-Show the time it was captured on the wholist window under the capture.
-Color certain names in database Enemies red
-Color certain names in database Friends blue
I'm only just beginning to use zuggsoft again and have only had experience with zMud, not cMud.
What I have so far is:
Code: |
<trigger priority="1090" id="109">
<pattern>~[(%1) (%2) (%3)~] (%4)</pattern>
<value>#CAP wholist</value>
</trigger> |
and
Code: |
<trigger priority="1390" id="139">
<pattern>Players found: (%1)</pattern>
<value>#cap wholist</value>
</trigger> |
and for the wholist window
Code: |
<trigger priority="1140" id="114">
<pattern>Players found: (%1)</pattern>
<value>#say %time(h:nnam/pm)</value>
</trigger> |
Very keen on seeing the "better" way to do this, and also getting help with the gagging and coloring.
Thanks!! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 28, 2015 1:19 pm |
1. You have figured out #CAP, but your trigger pattern needs work:
#TR {^~[%d *~]} {#CAP Wholist}
%1 and %2 and the like are actually anonymous variables to reference captured substrings of your pattern
they should never be used in the pattern itself
use pattern matching wildcards instead
There is a link to them in #HELP #TRIGGER
2. Doing nothing more will keep it in the main window.
3. Best method is to make a trigger in the wholist window to capture just the titles
#TR {the taker of life} {#SUB {}}
4: Turn on timestamps in the wholist window:
Click in the window to give it focus.
Click on the 'Prefs' button.
Click on the session tab on the left.
Click on the Scrollback tab on the top.
Check show timestamps.
5&6. Populate friend and enemy variables to trigger off of.
#ADDITEM friend {some friend}
#TR {%q{@friend}%q} {#CW dodgerblue} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 4:16 pm |
Thanks very much, when I get home I'll definitely be a lot closer to accomplishing the desired result!
One thing is:
How do I deal with the fact that the title will always be changing (with every level etc) and also sometimes there are 30+ people in the wholist so making a trigger for each will be a monstrous job. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 28, 2015 5:31 pm |
you make a variable for it like with friends and enemies
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 5:58 pm |
Still not home sorry. Di you mean something like:
#TR {^~[%d *~] %d the %d} {#var title {the %3}}
Then
TR {the @title} {#SUB {}} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 28, 2015 6:45 pm |
Very close, but you need to make a few changes:
To capture a substring you wrap it in (parenthesis).
To expand a variable list in a pattern you wrap it in {curly braces}
Also %d is only for integers, check out the link in #HELP #TRIGGER for other pattern matching wildcards.
#TR {^~[%d *~] * the (*)} {#ADDITEM title %1}
Should help you populate a list of titles.
#TR {the {@title}} {#SUB {}}
Would then suppress the titles, but you will want to drag that to your wholist window in the settings editor, so it only fires in that window. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 9:47 pm |
Just starting to implement it now!
#TR {^~[%d *~]} {#CAP Wholist}
The above is working, except -- it is not picking up a the trigger if the first number is a single digit.. example:
Quote: |
[25 Human Dru] Pullak the Druid Hound
[ 8 D-Elf Hea] Swivinl Desharn the Taker of Life
Players found: 2 |
The above only pulls over Pullak and not Swivinl.. it does it with all "[ # " but not the "[## ".
Just as a side note, what is the "^" in the trigger actually doing? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 28, 2015 9:53 pm |
the ^ anchors the pattern to the start of the line
and the issue here would be the leading space before the number
This should work:
#TR {^~[{ |}%d *~]} {#CAP Wholist}
That inserts an anonymous variable array that either contains a single space, or nothing at all. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 10:03 pm |
Perfect, thanks.. I'm now working on the #sub part to delete off the titles of characters.
#TR {the {@title}} {#SUB {}}
It too is working very well, except on the following:
Quote: |
[25 Human Dru] Pullak the Legend of the Battlefield
[ 8 D-Elf Hea] Swivinl Desharn the Taker of Life
Players found: 2 |
the above would pop out:
Quote: |
[25 Human Dru] Pullak the Legend of the
[ 8 D-Elf Hea] Swivinl Desharn |
So it is getting confused with the double "the" |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sat Nov 28, 2015 10:09 pm |
the issue there would be with the trigger that is gathering the titles
since names are always either one or two words, change the wildcard before the 'the' from * to {%w|%w %w}
An anonymous variable that is, as you guessed, one or two words.
you will have to manually delete the faulty entry from your titles variable |
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 10:22 pm |
Okay, that seems to work, except it doesn't pick it up right for names like:
[51 Mino Sha] Detrana Mel'a Lakilea the Champion of the Virtues
also, it's not #sub 'ing it right in the wholist window anymore.. |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Sat Nov 28, 2015 11:03 pm |
It is gagging some sorry:
Currently, this:
Quote: |
[51 Gnome Shf] Scrange the Grand Master of Changelings
[49 Dwarf War] Balindorf the Disciple of Ancient Ways
[20 Storm Pal] Aabos the Paladin
[37 D-Elf A-P] Mhirnal Dhu'mri the LightSlayer
[51 Dwarf War] Varnon Magmacarn the Dogged Warmonger, Commander of Battle
[51 D-Elf Hea] Calcabrizzo de Bezaudun the Affirmation of Life, Imperial Priest
[22 Felar Ran] Qrestle the Wild
[51 Dwarf Pal] Gulrom Ironbeard the Champion of the Virtues
[36 Human Tra] Meirldes De'delom Phan the Master of the Mind
[ 5 H-Elf Shf] Shendrar the Advanced Spell Student
[51 Arial War] (WANTED) Xigon HighGround the Legend of the Battlefield
[25 Human Ran] Jamm the Forestwalker
[13 Duerg Thi] Truntlik the Trickster
Players found: 13 |
becomes:
Quote: |
[51 Gnome Shf] Scrange
[49 Dwarf War] Balindorf
[20 Storm Pal] Aabos
[37 D-Elf A-P] Mhirnal Dhu'mri the LightSlayer
[51 Dwarf War] Varnon Magmacarn
[51 D-Elf Hea] Calcabrizzo de Bezaudun the Affirmation of Life, Imperial Priest
[22 Felar Ran] Qrestle
[51 Dwarf Pal] Gulrom Ironbeard
[36 Human Tra] Meirldes De'delom Phan the Master of the Mind
[ 5 H-Elf Shf] Shendrar the Advanced Spell Student
[51 Arial War] (WTD) Xigon HighGround the Legend of the Battlefield
[25 Human Ran] Jamm
[13 Duerg Thi] Truntlik
Players found: 13 |
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Nov 29, 2015 2:09 am |
you can change the %w's to %x for a more generic word with punctuation
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Nov 29, 2015 3:11 am |
#TR {^~[%d *~] {~(*~) |}{%w|%w %x|%w %x %x} the (*)} {#ADDITEM title %1}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Mon Nov 30, 2015 1:45 am |
#TR {%q{@friend}%q} {#CW dodgerblue
Is there a way to make sure it only hits the name of the friend? Currently it is carrying over into my
[TRB]'s on following lines..
Which comes from:
#SUB {[TRIBUNAL]} {[TRB]} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Mon Nov 30, 2015 2:26 am |
not sure why it would do that... is it a regular thing, or a one off glitch?
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Mon Nov 30, 2015 2:29 am |
Seems to be regular if a [TRB] follows a friend and/or enemy
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Mon Nov 30, 2015 3:49 am |
change the priority so they fire in reverse order?
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|