buffer size limitation?

Spiny

Member
I'm working on a script right now that creates a detailed table of information based on data in an external map file. Everything is being stored in a buffer created via table.append and when I run it, the first runthru is fine, but if I run it again, the gCLI just blanks itself out without showing the table of data. If I eliminate one item from the table, it runs thru fine time after time.

Adding in a line of code to get the length of the buffer reports a length of at least 25845, this could vary depending on various quantities on hand of items being considered.

So how can I increase the size of the buffer to get my full table to print when I run the script?

Thanks,
 
Last edited:

Catch-22

Active member
I could be wrong, but I don't think KoLmafia puts a limitation on the buffer type. Maybe you have found a bug?
 

Veracity

Developer
Staff member
She's talking about the gCLI buffer, not the ASH buffer type. I ran into the same issue with my mmg-log script: when you ask it to display the table of bets by player, the resulting HTML is too big.

The problem is, the gCLI gets slower and slower the more lines you add to the buffer; there must be something n-squared about appending lines to the HTML in it. So, when I boosted the size from 25K to 128K, say, people here complained vigorously about how KoLmafia was now really slow and was pegging their CPU. I put it back to 25K.

I think I'd rather have a "display_html" function which pops up a frame containing the HTML, rather than adding it to the gCLI buffer. No appending; the contents would be fixed.
 

Catch-22

Active member
She's talking about the gCLI buffer, not the ASH buffer type. I ran into the same issue with my mmg-log script: when you ask it to display the table of bets by player, the resulting HTML is too big.

The problem is, the gCLI gets slower and slower the more lines you add to the buffer; there must be something n-squared about appending lines to the HTML in it. So, when I boosted the size from 25K to 128K, say, people here complained vigorously about how KoLmafia was now really slow and was pegging their CPU. I put it back to 25K.

I think I'd rather have a "display_html" function which pops up a frame containing the HTML, rather than adding it to the gCLI buffer. No appending; the contents would be fixed.

Ah I see.. Yes this is one of the reasons why I think there should be functionality to pipe CLI output to a text file. Closest thing we have to that at the moment is "debug on".
 

Catch-22

Active member
Or mirror <filename>.txt

Oh wow, I didn't know about that one. You don't get all the extra crap that comes with debug logs, haha.

It still fills up the CLI though. It would be nice to pipe out and have nothing in the CLI except maybe a line such as:

>ash some_function() > pipe.txt
 
Top