icewolfz / jiMUD

MUD client for ShadowMUD.com using electron
http://www.shadowmud.com
7 stars 0 forks source link

Add Multi-Line Triggers and Multi-Condition Triggers #153

Closed icewolfz closed 2 years ago

icewolfz commented 2 years ago

Add a multi system like mudlet offers to match multiple lines some how

https://wiki.mudlet.org/w/Manual:Trigger_Engine#.22multiline_.2F_AND.22_and_.22OR.22_Condition_Triggers

icewolfz commented 2 years ago

Multistate-triggers branch is the work on multi state triggers

icewolfz commented 2 years ago

Due to the complexity of trigger alarms they will not support multi state triggering and will not be allowed as a sub type

icewolfz commented 2 years ago

Temp multistate triggers will not be removed until all states have been successfully triggerd, sub states can not be temp

icewolfz commented 2 years ago

Profile manger editing, do it like how context menus work and have the sub states as child nodes off main trigger and hide alarm type for sub triggers and show sub type only types when supported

icewolfz commented 2 years ago

Alarms now support sub states, by caching any trigger that as a sub state that is an alarm

icewolfz commented 2 years ago

went with a drop down navigation and buttons in profile manger editor as easier then trying to use tree view due to trigger vs tigger sub states being same type

icewolfz commented 2 years ago

Merged with, officially supported, will add remaining missing features as time allows

icewolfz commented 2 years ago

Expression system needs profile variables or converting the variable[name] to use function wrappers like profile variable to properly trigger when something changes, even so still not 100% reliable due to expressions could change a variable multiple times before completed but can only trigger after expression is over when the scope is set, while not perfect only way to do expression triggers, will wait until i merge profile variables to add expression type

Expression triggers should only fire if a variable in the expression changes, meaning have to parse valid possible varibales in expression and test against those if changed

//get all ids not in quotes, cache to improve performancelater on
//it first removes all quoted strings to ensure not false matches, then it looks for any valid matching words
_cachedIds = [...(EXPRESISONSTRING.replace(/"(.*)"/, "").matchAll(/\b([a-zA-Z_$][a-zA-Z_$0-9]*)\b/gm))].map(v => v[0]);
//to test if var is in exprssion or not
_cacheIds.indexOf('VAR') !== -1
//multiids
['var1', 'var2'].every(i => _cacheIds.indexOf(i) !== -1)
icewolfz commented 2 years ago

The parse variable branch has fully working expression types, once merged all trigger types will be supported