Problem matching output with valid regexp
Re: Problem matching output with valid regexp
What freezes Mudlet is most likely your database code or something else in your code that slows down everything. Post your script (->export) along with a replay of you getting the 500 designs output so people can reproduce your problem without having to log into your MUD.
Re: Problem matching output with valid regexp
What's slow is making each database entry (welcome to databases!). What will be fast however is doing it in bulk. So you want to save all your data in a table, and then, when done with it all, update your database.
(or, when you get better, you could turn off the automatic lock/unlocks and do them manually, but for now and safety, go with that method)
(or, when you get better, you could turn off the automatic lock/unlocks and do them manually, but for now and safety, go with that method)
Re: Problem matching output with valid regexp
More specifically, you want to BEGIN TRANSACTION before you start making bulk entries, and COMMIT TRANSACTION when you're complete. This is very fast.
Re: Problem matching output with valid regexp
@Heiko: I believe Vadi and Tsujinn are right, what's causing the minute or so freeze for Mudlet is the constant add/commit from adding records to the database. So, in a way, you could say it is the DB code that I'm using causing the issue.
@Vadi: If I could figure out how to get the information in a table and then retrieve it in some fashion, I just may forgo using a database entirely. The question I run into though, is how many characters is a table entry capable of holding? As I'm sure you know, some of the item examined descriptions from Lusternia are QUITE long (2000 characters is the max I run into). I also run into issues whenever I try to automate/script nested tables. Here's an example setup I'm attempting to do. Going to step by step it (though I'm sure it's unnecessary) just to be sure I show all of what I do.
Making my table
@Tsujinn: I assume that this means before I do any db:add calls, I first need to do something like mydb._begin(), then after I've done all of the db:add calls, I would want to call mydb._commit(), then finally mydb._end() ? If so, I've tried in that order, and the database remains blank. As with Vadi, any insights you wish to offer are greatly appreciated.
@Vadi: If I could figure out how to get the information in a table and then retrieve it in some fashion, I just may forgo using a database entirely. The question I run into though, is how many characters is a table entry capable of holding? As I'm sure you know, some of the item examined descriptions from Lusternia are QUITE long (2000 characters is the max I run into). I also run into issues whenever I try to automate/script nested tables. Here's an example setup I'm attempting to do. Going to step by step it (though I'm sure it's unnecessary) just to be sure I show all of what I do.
Making my table
Next, I have a trigger that capture on the following regexp.
Here is what is it catching.
Then, when the trigger fires, it calls the following code to try and enter the bits of information I actually want into the table.
If you have any insight you wish to offer, it would be greatly appreciated.
@Tsujinn: I assume that this means before I do any db:add calls, I first need to do something like mydb._begin(), then after I've done all of the db:add calls, I would want to call mydb._commit(), then finally mydb._end() ? If so, I've tried in that order, and the database remains blank. As with Vadi, any insights you wish to offer are greatly appreciated.
Re: Problem matching output with valid regexp
I have no idea how the container that ships with mudlet works, sadly. I wrote my own so that I could send raw SQL to the server.
Re: Problem matching output with valid regexp
Is that the one that's floating around here in the forums?
Re: Problem matching output with valid regexp
I have used the container that ships with mudlet... not that hard to use but is poorly documented...
Most of the tables that I use, I have set up a unique key and setup the behavior to replace upon any violations....
then to update any entry you can just use db:add and it will replace the entry with the key value...
You can also use the db:fetch command to load a set of records and then db:update to update them.... (there are example in the manual, with a little work it is doable)....
It is a little slow to get stuff in and out of the database and I use it just for storage (I like it better than saving the lua table).... I load my db into a lua tables upon start and update the database when needed.
Most of the tables that I use, I have set up a unique key and setup the behavior to replace upon any violations....
then to update any entry you can just use db:add and it will replace the entry with the key value...
You can also use the db:fetch command to load a set of records and then db:update to update them.... (there are example in the manual, with a little work it is doable)....
It is a little slow to get stuff in and out of the database and I use it just for storage (I like it better than saving the lua table).... I load my db into a lua tables upon start and update the database when needed.