fiendish / aardwolfclientpackage

Get the Aardwolf MUSHclient Package installer at
https://fiendish.github.io/aardwolfclientpackage/
Other
86 stars 33 forks source link

wrapped_captures/tagged_output: parameter to count endlines and terminate after n times #315

Open AardCrowley opened 1 year ago

AardCrowley commented 1 year ago

Given:

Posts in the Bugs forum :
+------+------------+-------------+-------------------------------------+----+
| Post#| Date/Time  | Author      | Subject                             |Size|
+------+------------+-------------+-------------------------------------+----+
| 20406|26 Feb 16:05| Vega        | Danaan's Sash in SKD                |   4|
| 20407|26 Feb 20:23| Lasher      | Re: Accessing keys buy ID +         |   5|
| 20409|26 Feb 20:49| Neeper      | enchanters focus (maybe) no longer  |  10|
| 20410|26 Feb 20:59| Grbano      | Re: enchanters focus (maybe) no lon |   8|
+------+------------+-------------+-------------------------------------+----+

... it would be nice to be able to do:

Capture.tagged_output("note list", "Post in the \\w+ forum :", "^[\\-\\+]+", true, ... 3)

where '3' means "The end line should be ignored until it has been processed 3 times, then end the capture."

It's probably a small market of need, but if this could be added, it might help with some captures regardless.

fiendish commented 1 year ago

You could use the untagged_output function here instead, no?

AardCrowley commented 1 year ago

Hmm, the untagged_output does seem to work in this case, as far as notes go.

I think it's hit or miss with untagged_output for me, which is why I've been hesitant to use it. If I do:

\\\function my_callback(lines, startline, endline) for _,v in ipairs(lines) do Simulate(stylesToANSI(v) .. "\n") end end Capture.untagged_output("friend ago", true, true, true, my_callback, false)

for instance, it takes all of 4-5 seconds to run the command (at least, on my end). Of course, tagged output with number of lines wouldn't help in this case. I think I half-expected it to be the same problem with note list output, too, but it seems to work there.

fiendish commented 1 year ago

it takes all of 4-5 seconds to run the command

That's a problem on your computer or between you and Aardwolf. The time difference between the two should be imperceptible.

AardCrowley commented 1 year ago

I'm wondering if it's the amount of data that's being received, then. If I change the line to not omit output, it shows 'friend ago' immediately. It's not until 2-3 seconds later that it displays the Simulate. I have 119 friends on flist, it's processing that many lines, which may be where the slowness comes in.

fiendish commented 1 year ago

I get two instantaneous displays. There's no scenario where it should take 3 seconds to process 119 lines.

fiendish commented 1 year ago

note to self: Apparently mortal players get several seconds of command lag after friend ago.