Zabaware Support Forums

Zabaware Forums => Ultra Hal 7.0 => Topic started by: tiger8u2 on August 23, 2014, 02:03:28 pm

Title: Scripting the removal of a table
Post by: 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?
Title: Re: Scripting the removal of a table
Post by: onthecuttingedge2005 on August 23, 2014, 09:14:29 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.
Title: Re: Scripting the removal of a table
Post by: Art on August 24, 2014, 09:21:38 am
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. ;)
Title: Re: Scripting the removal of a table
Post by: tiger8u2 on August 24, 2014, 08:26:15 pm
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.

Title: Re: Scripting the removal of a table
Post by: kryton on September 01, 2014, 08:46:50 am
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.)
Title: Re: Scripting the removal of a table
Post by: tiger8u2 on September 01, 2014, 06:25:40 pm
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.