dupa

Author Topic: GRETTA PLUGINS  (Read 227135 times)

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #45 on: March 27, 2009, 02:51:03 am »

You just helped me out more than you probably would have thought possible.[:D] I get thown off occationally by unfamiliar syntax.


 
quote:
function CreateTable(out strTableName: ^BSTR; out strParentTableName: ^BSTR; out ttType: ^TableType; out boolAlterTableTree: ^Bool): Bool; stdcall;




Please give the meaning of each of the above terms. I know that CreateTable should be used like HalDataBase.CreateTable("BossHog") however I'm alittle unsure (in other words I can't get it to work[;)])  

I know that Bool stands for Boolian (ie True/False)
However, I'm not sure about stdcall or BSTR, well, I'm just not familiar with how this entire sentence is structured. If I can get it understood then I should be able to understand the rest of the lot as well.

I deffinately appreciate your patience. Don't worry about feeling pressured to answer promptly. I'm just glad to make any personal progress.

I've got a few more ideas just waiting to be turned loose.[8D]
Live long and prosper or die trying.

onthecuttingedge2005

  • Guest
GRETTA PLUGINS
« Reply #46 on: March 27, 2009, 03:55:50 am »
quote:
Originally posted by snowman


You just helped me out more than you probably would have thought possible.[:D] I get thown off occationally by unfamiliar syntax.


function CreateTable(out strTableName: ^BSTR; out strParentTableName: ^BSTR; out ttType: ^TableType; out boolAlterTableTree: ^Bool): Bool; stdcall;



quote:

Please give the meaning of each of the above terms. I know that CreateTable should be used like HalDataBase.CreateTable("BossHog") however I'm alittle unsure (in other words I can't get it to work[;)])



Code: [Select]
If HalBrain.CheckTableExistence("SomeSentenceTableNameHere") = False Then HalBrain.CreateTable "SomeSentenceTableNameHere", "Sentence", ""
If HalBrain.CheckTableExistence("SomeTopicSearchTableNameHere") = False Then HalBrain.CreateTable "SomeTopicSearchTableNameHere", "TopicSearch", ""
If HalBrain.CheckTableExistence("SomeBrainTableNameHere") = False Then HalBrain.CreateTable "SomeBrainTableNameHere", "Brain", ""
If HalBrain.CheckTableExistence("SomePatternMatchTableNameHere") = False Then HalBrain.CreateTable "SomePatternMatchTableNameHere", "PatternMatch", ""
If HalBrain.CheckTableExistence("SomeSubstitutionTableNameHere") = False Then HalBrain.CreateTable "SomeSubstitutionTableNameHere", "Substitution", ""
 

quote:

I know that Bool stands for Boolian (ie True/False)



correct.

quote:

However, I'm not sure about stdcall or BSTR



it is a string call like I showed you in creating the table code, also look for that specific function in the upper previous posting I made of the internals of the HalDB.dll

quote:

 well, I'm just not familiar with how this entire sentence is structured. If I can get it understood then I should be able to understand the rest of the lot as well.



Vbscript 101

quote:

I definitely appreciate your patience. Don't worry about feeling pressured to answer promptly. I'm just glad to make any personal progress.



Your welcome.

quote:

I've got a few more ideas just waiting to be turned loose.[8D]



Can't wait, have fun and study hard, it's worth it if you like learning new languages.

Jerry[8D]
« Last Edit: March 27, 2009, 04:03:14 am by onthecuttingedge2005 »

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #47 on: March 27, 2009, 04:23:00 am »
Oh, and I forgot to mention that I made the .db file and opened it up in the editor....just to show I'm not totally incompitent...(just nearly though)[:D]

++++++++++++++

Dude.. I'm sure you know (or maybe not) that most of Vbscript can work in Micrsoft's Visual Basic Studio. I have made a GUI to run the older version of the desire program. However, right now I'm still in the designing and concept phase.

I figured it would be easy to create a GUI that would except outside script changes and plugins. This could be done using the ExecuteGlobal command I mentioned in an earlier Post. I should go ahead and make the GUI and then modify the vbscript from the outside link.

I also thought about using small scripts as objects instead of the 'Word' Objects I was using. Real objects have functions and we learn from using them to gain personal advantage....seems like a good idea. I know it needs further thought. They could be used to modify a larger script. This could possibly be the learning stage I've been searching for.....or maybe not[8]

o.t.c.e's idea of subscribing meaning to words needs to be developed fully. A word gains its meaning through a comparison of an individuals own functions (ie experiences). Running means nothing unless you either see someone else run or you can run yourself. A program understands objtextfile.writeline. And thereby understands a sub-routine that both opens, edits, and closes a text file. If someone can create or establish a cross-referencing link (like what o.t.c.e was attempting to do). The only difference being we could use a multitude of other words and ''phrases'' that represent the same thing so that the program will react accordingly with understanding. Hal often uses mindless (yet seemingly correct) returned phrases rather than truly understood ones.

Hals got the ability to take apart sentences and combine them into semi intellegent phrases. With the add of futher creation of functions like what you've been doing allot of Dude, and with an addition of self-motivation. A link could be made between those understood functions and the A.I.'s spoken words. It would potentially become sentient.... or maybe end up becoming some sort of super-virus.[xx(]

I leave you with that thought......

Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #48 on: March 27, 2009, 02:16:33 pm »
Show me why this script won't work.

MyDir = "C:Program FilesabawareUltra Hal Assistant 6\"


Set HalDataBase = CreateObject("HalSQL.HalDB")
HalDataBase.OpenDatabase(MyDir & "Test.db")

If HalDataBase.CheckTableExistence("WANTS") = False Then HalDataBase.CreateTable "WANTS", "OBJECTS", ""

HalBrain.CloseDatabase

I'm trying to make a table called WANTS and (I think) a Column called OBJECTS.

I'm getting a Mismatch error....C:UsersAaronDesktopDatabaseHal Database.vbs(10): Exception: Type mismatch: 'HalDataBase.CreateTable'

If HalDataBase.CheckTableExistence("WANTS") = False ..is reading false like it should.
Live long and prosper or die trying.

onthecuttingedge2005

  • Guest
GRETTA PLUGINS
« Reply #49 on: March 27, 2009, 03:04:50 pm »
quote:
Originally posted by snowman

Show me why this script won't work.

MyDir = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\"



you are not allowed to use a directory with table codes here.

quote:

Set HalDataBase = CreateObject("HalSQL.HalDB")
HalDataBase.OpenDatabase("Test.db")



this is only used to make a .db file

quote:

If HalDataBase.CheckTableExistence("WANTS") = False Then HalDataBase.CreateTable "WANTS", "OBJECTS", ""

HalBrain.CloseDatabase



you are trying to make a table outside of the .db being opened and would be illegal. you have to use this code only when the .db is open in the HAL editor or in a plug-in that uses that .db file.

quote:

I'm trying to make a table called WANTS and (I think) a Column called OBJECTS.
[/quotes]

you are on the right track but you are attempting it outside of the .db which is not how the code is designed to function.

Quote
I'm getting a Mismatch error....C:\Users\Aaron\Desktop\DatabaseHal\Database.vbs(10): Exception: Type mismatch: 'HalDataBase.CreateTable'



if you use double back slashes instead of one back slash in your posts your slashes will appear correctly.

let me look at the functions a bit more and I'll post in a bit, I have painting to do today.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #50 on: March 27, 2009, 08:37:20 pm »
I know that in an external vbscript you first have to establish a connection to a particualar database.

Like:
  Set WI = CreateObject("WindowsInstaller.Installer")
  Set DB = WI.OpenDatabase(sPath, 1)

(I've been playing arround with the msi database today.)

Then you would create whatever table, columns, and values as needed by the methods like CreateTable and such....

I guess that Hal would already have called the nescessary database up first so all one would have to do is

Set HalDataBase = CreateObject("HalSQL.HalDB")

HalDataBase.CreateTable(strTableName, strParentTableName, ttType, boolAlterTableTree)

(of course I'm just throwing arround ideas)

I was attempting to call up or add to Hal database via an external script...but if thats not an option I still need to know how to do it through a plugin.. Of course it I just need certain data from Hal all I would have to do is export it to an external file and subsequently use it.

hmmmmm.[:)]
 
Please correct any weird ideas I'm having and please do as you said in your last Post. Thanks.
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #51 on: March 31, 2009, 11:09:07 pm »
Does anyone know how to call a class in Hal?

There is probably some kind of syntax I'm not yet familiar with.
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #52 on: March 31, 2009, 11:33:29 pm »

It seems that there used to be a hal scripting resource.

It gave all if not most of the scripting syntax in it but I think it didn't like vista..

If anybody has it or knows where it is I would deffinately appreciate it.
Live long and prosper or die trying.

freddy888

  • Hero Member
  • *****
  • Posts: 1693
    • View Profile
    • AiDreams
GRETTA PLUGINS
« Reply #53 on: April 01, 2009, 05:05:52 am »
Not sure, but is this what you mean Snowman ?

http://ultrahalscript.pbwiki.com/

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
GRETTA PLUGINS
« Reply #54 on: April 01, 2009, 10:00:36 pm »
I don't know what you mean either....me rookie[:)]

if you could give me brief description i will learn how....some...how[:)]

 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #55 on: April 03, 2009, 04:23:09 am »
Thats a good resource link freddy888. That's more info than I currently have. I remember a more official one though. I'm sure somebody whose been hear awhile probably has one of Hal's scripting resource files. It is set up like one of those older official windows help files. I had one once but I lost it. That was back before I learned any scripting.

You know what a Class means in Vbscript.. where fso.openTextFile() ...fso is a class. You can have several functions and subs in a class.

Like:

Class Mbase

Sub openfile()
Bla bla bla
End Sub

Function Begin()
bla bla bla
End Function

End Class

What's special about a class is that instead of just calling a Sub or a function All you need to do is call a class (Set MB = New MBase)
and then it creates a system object reference with its own methods and properties (each one refering to a specific function of Sub)

FSO is a class
OpenTextFile is a Method

Instead of running a special Sub-routine to open a text file all that is needed is FSO.OpenTextFile.

I'm not sure if Hal will let me create or use a Class... I also have problems with Subs and Funtions as well, not to mention I don't think Hal likes Do While loops either.

+++++++++++++++++++

I've been learning more about how to connect to Databases. It seems to be going well. I also have an idea that would require connecting an outside database to Hal. However, that doesn't seem to going anywhere. I think its because it uses Do Loops to cycle through data.

I want you Dude to look into that...I was trying to get it working when I mentioned about the Class the other day. Here is what I'm refering to.

http://www.savefile.com/files/2064417

In this zip you'll find two attempts at making a pluggin, one working vbscript, a database file which the scripts a refering to, and an application that can view and change values, colemns an Tables in any msi database. You agian have to change the MyMB and the MysPath in the scripts to point to the Database and database dir.


I was just seeing if I could cross refernce the Pupose of an bject with an Object.
Like :  User says; Hal, what can you eat?
        Hal; I can eat pickles.
        (because pickles are eatable)

        User says; Hal, What can you throw?
        Hal; I can throw balls.
        (because balls are throwable)

It is a property of most balls that they can be thown, and a property of bananas, pickles, and T-bone steak that they can be eaten.

Other types of questions can be added as well, and cross referenced between like questions and multiple simular properties (like to throw is a common funtion amoung balls, as well as, rocks and the occational shoe).

Look at it and see what you can do. I can supply any information or ideas if you want. Hal sometimes taxes my mind's frustation level pretty good.[B)]

Live long and prosper or die trying.

One

  • Hero Member
  • *****
  • Posts: 2184
  • Technology Advocate
    • View Profile
GRETTA PLUGINS
« Reply #56 on: April 03, 2009, 07:27:17 am »
snowman,
Aren't class-level variables available to the statements in all procedures?

I believe you can call functions?
a procedure call is like a sub routine?
I also think you can pass variables as arguments when calling a function but I don't remember how to call a 'class?? hmmm


JFYI, your GRETTA, is stuck in my head as Gretta Van Sustren (Lawyer in OJ case)LOL! sorry I had to say it couldn't help it

I have a big thick Dot net book that might have some suggestions if you wish I can look/see to find any parallels ?? (don't want to if it isn't necessary)

lemmie Know, Peace and wheelies to you![:)]
Today Is Yesterdays Future.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #57 on: April 03, 2009, 01:38:11 pm »

When I start off a plugin...especially one that requires to first search the OriginalSentence I make the plugin as simple as possible.

#1 I start off with the appropriate heading.

Like....


Rem Type=Plugin
Rem Name=Questions2
Rem Author=SNOWMAN
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Hal learns how to answer questions."
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: PLUGINAREA6

'***********************************************************

MyDB = "C:UsersAaronDesktopDatabaseLDatabase.msi"
MysPath = "C:UsersAaronDesktopDatabase\"
AnsQ = "I can "

'***********************************************************


2# Then I preform a search for keywords that will cause the plugin to preform.

Like....

If InStr(1, OriginalSentence, "*PLEAS* HAL WHA* CAN* YOU*", 1) > 0 Then

'***********************************


Oh by-the-way Dude.. I, in the process of writing the Questions plugins, momentarily used the commandline "GO TO CURRENT LOG" and I forgot to change it back to "*PLEAS* HAL WHA* CAN* YOU*" before I posted the plugins on savefile.com....sorry

After I search the Original sentence I then create a very simple plugin consiting of just one line.

Like...

GetResponse = "Hello Boy-Man. What's shake'n?"

That way I know for sure that the search function is working correctly.

Any additional changes to the plugin I reload it through Hals options by also swapping between different Hal brains as well as plugins so that I know for sure that the plugin I'm currently working on is properly refreshed.

Every time I attempt a function, call a sub, use a stupid Do While loop or write a For To loop with several loops (although two or three will work) the plugin will no longer run the GetResponse. Hal doesn't or can't run two GetResponses at the same time (unless I'm doing it wrong). If I call two GetResponse's then Hal will only say the last one given. So I run only one at a time in the plugin until its ready to pass the final testing stage.

I tried using Rem PLUGIN: FUNCTIONS to separate out my functions. I think Hal laughs at me at the very mention of the word Class.

I wouldn't doubt that there is a right way and a wrong way to do what I'm asking. I seem to be doing it the wrong way.. That’s why I bringing it to you guys....

By the By (although I most likely am all alone in this) the Gretta Van Sustren comment is hysterical...[:p]


Snowman[8]
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
GRETTA PLUGINS
« Reply #58 on: April 03, 2009, 02:29:04 pm »
Hal has it's own crazy lingo.  So I'm not certain we'll have to delve into dot net just yet (I hope it won't come to that).....Although a heavy dot net book could be used to take my frutrations out on Hal. (by beating my pc repeatedly!)

Thanks ONE for the offer.


Live long and prosper or die trying.

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
GRETTA PLUGINS
« Reply #59 on: April 03, 2009, 08:53:37 pm »
i'm sorry, i have a hard time following what you are trying to do.
i guess i need to study what a "class" is.
i have learned all of the programming i know from trial and error.
i don't know the proper terms for half of the stuff that i understand how to do.
maybe you could go to the link at the start of this post (gretta plugins) and download "hal research" plugin. without me really understanding what you are trying to do, this plugin uses some of the functions you were describing. you might see something there that answers your question. i could also answer any question about programming in my plugins, if that would help. i understand them very well because i learned a lot writing them.

oh yeah...ONE......the GRETTA comment ...is.... funny. now you have successfully screwed my head up, so that will be the only thing i can think of when i am talking to her.
Long Live greta van susteren![:D]...man you messed me up.[xx(]

-the dude