|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Sat Apr 24, 2021 12:07 am
I'm stumped |
the following code snippet has been manually tested for pattern match for all possible matches... yet it consistently fails to fire for about 6-8 matches... the same ones too
I am at a loss as to what's going on lol.
Code: |
<trigger name="AlphabetDungeon" priority="9540" regex="true" id="954">
<pattern>^M:Letter (\w)\.$</pattern>
<value>$mobList="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z"
#IF (%ismember(%1,$mobList)) {kList = %additem("letter",@kList)}</value>
</trigger> |
I use 'k' to 'kill %pop(kList)'
or for automated version #IF (%numitems(@kList) > 0) {kill %pop(kList)} in my kTrig
a full run through all 28 rooms of this area ( room 1 has nothing to kill )
Code: |
Letter a :
Letter f :
Letter b :
Letter c :
Letter d :
Letter e :
Letter h :
Letter m :
Letter l :
Letter k :
Letter n :
Letter o :
Letter t :
Letter y :
Letter x :
Letter w :
Letter v : |
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Fri Apr 30, 2021 12:16 pm |
#IF (%ismember(%1,$mobList)) {kList = %additem("letter",@kList)}
This snippet of code in particular confuses me for the following reasons:
1. The odds of a false positive firing seems too low to bother with the error-proofing in using an #IF, though its always good to check
2. It's always doing the same thing anyway, not even incorporating %1 in the %additem.
What good is having @klist with a value of "letter|letter|letter|letter|etc"? |
|
_________________ Discord: Shalimarwildcat |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Fri Apr 30, 2021 11:59 pm |
After reading your comment, and reviewing the whole trig... it's my bad habit of over-complicating things needlessly.
You are correct in that it is moot to do it this way as the pattern will always be "M:Letter ?" where ? is one of the letters in the alphabet.
Originally the trigger was used in a more universal setting and instead of 'M:Letter' it was 'M:\w+' to match a large number of descriptive wording.
Very rarely would any monster in a room be a single word so it was used to match and ignore the first word.
The reason for the %additem in this case is another moot point as it is a single entity per room, but some rooms in different areas will call for help
and using %additem to append to the kList will allow me to ensure I will clear the room fully before progressing to the next. |
|
|
|
|
|