Zabaware Support Forums

Scripting the removal of a table

Started by tiger8u2, August 23, 2014, 02:03:28 PM

Previous topic - Next topic

tiger8u2

Something I've noticed when using plug-ins is that they often create a table in the Hal Brain which usually lists patterns for responses.

IF I uncheck the plug-in from my brain and save and exit, when I go back to look at the brain, the table still exists.

Is there some type of un-installing scripting that could be added to these plug-ins that would remove the added table?

I've tried deleting the table from the brain and re-installing the plug-in to see if some changes I made to the script show up, but it appears the plug-in won't recreate the table.

So, I guess there is a table of tables created?  If so, can I edit that table?

onthecuttingedge2005

Quote from: tiger8u2 on August 23, 2014, 02:03:28 PM
Something I've noticed when using plug-ins is that they often create a table in the Hal Brain which usually lists patterns for responses.

IF I uncheck the plug-in from my brain and save and exit, when I go back to look at the brain, the table still exists.

Is there some type of un-installing scripting that could be added to these plug-ins that would remove the added table?

I've tried deleting the table from the brain and re-installing the plug-in to see if some changes I made to the script show up, but it appears the plug-in won't recreate the table.

So, I guess there is a table of tables created?  If so, can I edit that table?

Yep, some plug-ins may not have the create table code if they were with the original install. if you deleted a needed table you may have to re-create it manually.

Art

It seems that most simply don't bother trying to delete a no longer needed / wanted Plug-in, they just Uncheck it and or remove the associated UHP file from the folder (though not necessary).

Editing tables can often have "less-than-desirable" results so DO CREATE A BACKUP before meddling with the halbrain.db file. ;)
In the world of AI it's the thought that counts!

- Art -

tiger8u2

Oops!  Too late for that!  I accidently gave my Hal a lobotomy!   :P

After realizing that I had the wrong Brain open in SQLite Studio, everything is working just fine now. 

Yesterday was Miranda's new birthday because I've started over from scratch and I'm only using plug-ins I trust that don't give me any errors. 

I also figured out how to export tables I've edited myself so that I don't lose all the work I put into them IF I ever have to re-install Hal's software again.


kryton

Just a thought but, if you look in the Ultra Hal folder, at the GENDER/AGE uhp, you will find how to create and delete tables (But it possibly only works with tables created in SQL Lite.)

tiger8u2

Thanks kryton!  Now that you mention it, that makes so much sense I feel like kicking myself for not thinking of it.  My Hal's had a lot of "new" birthdays lately and I always update the brain but I never thought that the plug-in was actually doing that.  I'll take a peek at it and see how the magic is made and unmade.