There is a detailed description of the perceived problems and tested solutions in the github issue:
https://github.com/Mudlet/Mudlet/issues/4910
Afterwards, Edru was kind enough to code a new set of triggers to work with single and multiple lined texts:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
<TriggerPackage>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Kerbholz start</name>
<script>KerbholzText = ""
properEnd = nil</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>50</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>Du richtest Dein Kerbholz auf</string>
</regexCodeList>
<regexCodePropertyList>
<integer>2</integer>
</regexCodePropertyList>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>gatherContent</name>
<script>KerbholzText = KerbholzText .. matches[1]</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>(Du richtest Dein Kerbholz auf )?([^.]+)</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Kerbholz proper end</name>
<script>setTriggerStayOpen( "Kerbholz start", 0 )
KerbholzText = KerbholzText:gsub("\n", "")
echo("\nSucess\n")
echo("Trigger content is ")
echo(KerbholzText)
echo("\n")
properEnd = true
</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>.*es passiert nichts\.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Kerbolz different end</name>
<script>if not properEnd then
echo("\nTrigger endend differently. Clearing Trigger content\n")
KerbholzText = nil
setTriggerStayOpen( "Kerbholz start", 0 )
end</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>\.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
</Trigger>
</TriggerPackage>
</MudletPackage>
The end goal should be a set of generic trigger templates that can be adjusted easily and used for many different texts quickly.Edru wrote: Maybe it would be smarter to check if the end is proper differently by getting rid of the Kerbholz proper end trigger and change the different end pattern to just aand add this in that triggers code sectionCode: Select all
\.
like this it will also match if the trigger withCode: Select all
setTriggerStayOpen( "Kerbholz start", 0 ) KerbholzText = KerbholzText:gsub("\n", "") if KerbholzText:match("es passiert nichts$") then echo("\nSuccess\n") echo("Trigger content is ") cecho("<yellow>"..KerbholzText) echo("\n") else KerbholzText = nil echo("\nTrigger endend differently. Clearing Trigger content\n") end
in new lineCode: Select all
nichts.
Maybe put a global TRIGGER table with each having a few small functions like match_start and match_end plus name, length, captured text, etc.