Mudlet features and API requests
Re: Mudlet API requests
I hear that a lot. 'It's not a bug, its a feature.' However, I do not agree with you. This is a bug. Copy (if its stated intention is to copy the formatting of a line over) then it needs to copy ALL formatting over, regardless of if the formatting is from a permTrigger or a TempTrigger. Currently this is not the case, and THIS is a bug.
-
- Posts: 186
- Joined: Sun Nov 14, 2010 5:57 am
Re: Mudlet API requests
When I created my highlighting triggers I used functions to return a color value useable by cecho, then I strip out the name, only one name per line on mine, prefix (WAR) or black space and then prefix [GROUP ID] and finally color the name, and then echo it wherever I want.
Code: Select all
[BR]Kulek Conclave Common Room
(WAR)[WR]Cedany Meeting Room
Re: Mudlet API requests
It's not a bug, it is copying all of the formatting at the time you called copy.
Perhaps a postProcessing event would be nice - I think I needed it for something else as well, if it won't impact performance too much.
Perhaps a postProcessing event would be nice - I think I needed it for something else as well, if it won't impact performance too much.
Re: Mudlet API requests
an alternate solution may be to simply parse triggers as they're appended into miniconsoles.
Re: Mudlet API requests
You mean re-parse triggers on lines that were appended? That'd require the triggers then to know their context...
-
- Posts: 186
- Joined: Sun Nov 14, 2010 5:57 am
Re: Mudlet API requests
Z/CMUD use tabbed windows which have their own settings. This may be what tsuujin is semi-suggesting, an ability to have miniconsoles to have their own triggers.
setTempTrigger("window", pattern, commands) ??
setTempTrigger("window", pattern, commands) ??
Re: Mudlet API requests
Ok, I've got something -partially- working.
All it does is work backwards from the last line until it finds the string you use for "channel" and then works from that point forwards appending as it goes.
if you just call it from the command line or an alias with some test word as the channel, it works great. However, if you attempt to call it from a tempLineTrigger(1,1...) then it does -not- work. I haven't figured out why this is yet, but the function itself is sound.
All it does is work backwards from the last line until it finds the string you use for "channel" and then works from that point forwards appending as it goes.
Re: Mudlet API requests
@Tsujin
Your script doesn't work in trigger mode because the current line that is being triggered on hasn't been wrapped yet and is represented in the buffer as one long line that includes all line breaks.
A few functions behave differently when in trigger mode (especially echo() and insertText(). However, if you run your script on any other buffer but the main console i.e. the mini console where you actually paste your copied text, it should work perfectly - also in trigger mode.
@Rakon
Your analysis of the problem is correct. However, changing the execution order of tempTrigs from bottom to top wouldn't really solve the problem in a general way because you might define tempTriggers that are dependent on some other trigger that is executed at a later point in time. A proper solution would be to add the same kind of forced order of parent->child execution that is being enforced for permanent trigger objects to tempTriggers. You could then make your own tempTrigger chains. I'll add something like this in the future.
Your script doesn't work in trigger mode because the current line that is being triggered on hasn't been wrapped yet and is represented in the buffer as one long line that includes all line breaks.
A few functions behave differently when in trigger mode (especially echo() and insertText(). However, if you run your script on any other buffer but the main console i.e. the mini console where you actually paste your copied text, it should work perfectly - also in trigger mode.
@Rakon
Your analysis of the problem is correct. However, changing the execution order of tempTrigs from bottom to top wouldn't really solve the problem in a general way because you might define tempTriggers that are dependent on some other trigger that is executed at a later point in time. A proper solution would be to add the same kind of forced order of parent->child execution that is being enforced for permanent trigger objects to tempTriggers. You could then make your own tempTrigger chains. I'll add something like this in the future.
Re: Mudlet API requests
Isn't this the point of a tempLineTrigger? To process something after the wrapping on the current line has already been done, and be able to go backwards?Heiko wrote:@Tsujin
Your script doesn't work in trigger mode because the current line that is being triggered on hasn't been wrapped yet and is represented in the buffer as one long line that includes all line breaks.
A few functions behave differently when in trigger mode (especially echo() and insertText(). However, if you run your script on any other buffer but the main console i.e. the mini console where you actually paste your copied text, it should work perfectly - also in trigger mode.
Re: Mudlet API requests
It's one of the uses... not the whole point though, I'd say. The 'span over multiple lines without requiring a trigger pattern' lends itself to easy 'forward' on-demand triggers.