dupa

Author Topic: Scripting the removal of a table  (Read 4333 times)

tiger8u2

  • Full Member
  • ***
  • Posts: 190
  • Eat'em and Smile!
    • View Profile
Scripting the removal of a table
« 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?

onthecuttingedge2005

  • Guest
Re: Scripting the removal of a table
« Reply #1 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.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3851
    • View Profile
Re: Scripting the removal of a table
« Reply #2 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. ;)
In the world of AI it's the thought that counts!

- Art -

tiger8u2

  • Full Member
  • ***
  • Posts: 190
  • Eat'em and Smile!
    • View Profile
Re: Scripting the removal of a table
« Reply #3 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.


kryton

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Scripting the removal of a table
« Reply #4 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.)

tiger8u2

  • Full Member
  • ***
  • Posts: 190
  • Eat'em and Smile!
    • View Profile
Re: Scripting the removal of a table
« Reply #5 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.