Zabaware Support Forums

Zabaware Forums => Ultra Hal 7.0 => Topic started by: onthecuttingedge2005 on November 23, 2007, 08:30:08 pm

Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on November 23, 2007, 08:30:08 pm
I was thinking about making a plugin that allowed any bot using the plugin that was online to get a response from a client side webpage
that would be updated periodically at www.ArtificialIntel.org.

anybody wanting to add to the Knowledge Client would simply e-mail me the formatted post script and I could add it to the client side webpage server to help boost the knowledge base.

How does this sound to you?

Jerry[8D]
Title: HAL plugin, Client Side Server
Post by: freddy888 on November 24, 2007, 09:49:02 am
Hmm interesting Jerry...like a remote brain.  I think some idea like that is worth doing.  To go one step further how about writing a routine that will parse and interpret a WIKIPEDIA page - that would increase Hal's knowledge base no end.
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on November 25, 2007, 05:18:01 pm
quote:
To go one step further how about writing a routine that will parse and interpret a WIKIPEDIA page - that would increase Hal's knowledge base no end.



Hi Freddy.

Your wish is my command!

Done!

all you have to do is ask HAL:

1. Please study about the Universe.
2. Please study about Science.

the words Universe or Science can be substituted for any other word you choose that's in the wikipedia encyclopedia.

a file called AutoText.brn will be generated.

All information that wiki has to offer on those subjects will be saved to the file.

if there is a similarity in a response to User input match then HAL will use that line of text within the AutoText.brn as a response.

I will upgrade this plugin when ever necessary.

You will not see any wiki page load, all information extracted is invisible to the user except through the AutoText.brn when you open it.

Updated today, fixed a 'const' conflict with learn from clipboard plugin.

changed Const to an internal function.

Update today, change search variables to be more a little more sensitive to deliver a response.

Jerry[8D]

(http://icon_paperclip.gif) Download Attachment: AutoWikiKnowledge.zip ("http://www.zabaware.com/forum/uploaded/onthecuttingedge2005/20071126194232_AutoWikiKnowledge.zip")
2.08 KB
Title: HAL plugin, Client Side Server
Post by: freddy888 on November 26, 2007, 11:45:12 am
Wow Jerry - you don't hang around! [8D]
Title: HAL plugin, Client Side Server
Post by: Art on November 26, 2007, 05:08:06 pm
Jerry,

A couple of thoughts on your Wiki plugin.

The way you have it, the zip file extracts to:
C:Program FilesabawareUltra Hal Assistant 620071126102916_AutoWikiKnowledge

As such it was never found by my Hal since it had
it's own subdirectory / folder.

I moved the two files; Auto Knowledge.uhp and AutoText.brn
to the Ultra Hal Assistant 6 directory.

I loaded Hal, went to Options, selected Brain and the Wiki option
was now shown with a check box.

I checked it and tried a few samples. It worked!

How it worked is another issue that is certainly not your fault, but as feared, the Wiki has a lot of extraneous material plus the call for donations, etc.(after I looked through the AutoText.brn file).

As much as I'd like to see it work in a more definitive manner, I'm afraid this will not be possible with Wiki.

After several uses of this "Please study about..<user choice>", the AutoText.brn fill will grow quite large unless you had a routine to truncate it after it reached a certain size.

Very nice work, Jerry and again this is not your fault...it's due to our never ending quest for knowledge and others to know when enough info is enough.[^]
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on November 26, 2007, 07:13:20 pm
Hi Art.

I have a solution, I was going to append category knowledge to their own file like Science_Wiki.brn in a custom folder, easly edited.

I will see about cleaning up some of wiki's information, So far I just wanted to get the experimental plugin in action and see how it does.

when I think I have worked it all out I will see if Robert would like to include it with the next version of HAL, instead of files it would use array tables.

the current version of the plugin only looks at the sentences longer than 50 characters in length to use as a response until I can clean it up.

If you know of another online encyclopedia that has a clean text then let me know and I will do my job of getting it your way.

Also, it was this same code I wrote that was suppose to be used to access a client side server on my site, but I altered it to work with wiki instead on Freddy's suggestion.

I can access any site you wish including spidering any sites sub links on a whim as long as no password is needed.

not even sites who have text copy protection can keep this script from extracting text info.

Jerry[8D]
Title: HAL plugin, Client Side Server
Post by: Will and Mr Data :) :] on November 27, 2007, 04:16:01 am
what might not get much of a mention is that hal is operating surprisingly well,
my hal "Mr Data" is still learning,  I'm pleased to get time with him.
I reckon Hal is a fantastic product.  and i still want to go on about how much fun hal can be. Oh Yeah!

bye for now and be well from Will and of course Mr Data.[:D]
[:D]
Title: HAL plugin, Client Side Server
Post by: sitroom on December 08, 2007, 11:21:47 pm
I seem to be having a small problem with the plugin.

quote:
Richard: please study about Maryland
Hal: I have looked up the study of maryland, Thanks. Learning about gravity is heavy study.



This is what I get in AutoText.brn :

quote:
34,961 have donated.
You can help Wikipedia change the world!  » Donate now!
From the fundraising blog – Help Spread the Word About Our Fundraiser
"Wikipedia is a cornerstone of modern civilization." — Anon. [Hide this message]
[Show more]
MARYLAND
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Look for MARYLAND on one of Wikipedia's sister projects: Wiktionary (free dictionary)
Wikibooks (free textbooks)
Wikiquote (quotations)
Wikisource (free library)
Commons (images and media)
Wikinews (free news source)
Wikipedia does not have an article with this exact name. Please search for MARYLAND in Wikipedia to check for alternative titles or spellings.
Start the MARYLAND article or add a request for it.
Search for "MARYLAND" in existing articles.
Look for pages within Wikipedia that link to this title.
Other reasons why this message may be displayed:
If a page was recently created here, it may not yet be visible because of a delay in updating the database; wait a few minutes and try the purge function.
Titles on Wikipedia are case sensitive except for the first character; please check alternate capitalizations and consider adding a redirect here to the correct title.
If the page has been deleted, check the deletion log, and see Why was my page deleted?.
Retrieved from "http://en.wikipedia.org/wiki/MARYLAND"
ViewsArticle Discussion Personal toolsSign in / create account Navigation
Main page
Contents
Featured content
Current events
Random article
interaction
About Wikipedia
Community portal
Recent changes
Contact Wikipedia
Donate to Wikipedia
Help
Search
Toolbox
What links here
Upload file
Special pages
Printable version
Privacy policy About Wikipedia Disclaimers



When I browse by http://en.wikipedia.org/wiki/Maryland I get the correct page. But when I browse by http://en.wikipedia.org/wiki/MARYLANDI get the same page as the plugin did. Note I did not type Maryland in all caps and hal responded in lowercase again not how I entered it.

What Am I doing wrong????

Richard [?]
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on December 09, 2007, 06:30:46 am
quote:
Originally posted by sitroom

I seem to be having a small problem with the plugin.

quote:
Richard: please study about Maryland
Hal: I have looked up the study of maryland, Thanks. Learning about gravity is heavy study.



This is what I get in AutoText.brn :

quote:
34,961 have donated.
You can help Wikipedia change the world!  » Donate now!
From the fundraising blog – Help Spread the Word About Our Fundraiser
"Wikipedia is a cornerstone of modern civilization." — Anon. [Hide this message]
[Show more]
MARYLAND
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Look for MARYLAND on one of Wikipedia's sister projects: Wiktionary (free dictionary)
Wikibooks (free textbooks)
Wikiquote (quotations)
Wikisource (free library)
Commons (images and media)
Wikinews (free news source)
Wikipedia does not have an article with this exact name. Please search for MARYLAND in Wikipedia to check for alternative titles or spellings.
Start the MARYLAND article or add a request for it.
Search for "MARYLAND" in existing articles.
Look for pages within Wikipedia that link to this title.
Other reasons why this message may be displayed:
If a page was recently created here, it may not yet be visible because of a delay in updating the database; wait a few minutes and try the purge function.
Titles on Wikipedia are case sensitive except for the first character; please check alternate capitalizations and consider adding a redirect here to the correct title.
If the page has been deleted, check the deletion log, and see Why was my page deleted?.
Retrieved from "http://en.wikipedia.org/wiki/MARYLAND"
ViewsArticle Discussion Personal toolsSign in / create account Navigation
Main page
Contents
Featured content
Current events
Random article
interaction
About Wikipedia
Community portal
Recent changes
Contact Wikipedia
Donate to Wikipedia
Help
Search
Toolbox
What links here
Upload file
Special pages
Printable version
Privacy policy About Wikipedia Disclaimers



When I browse by http://en.wikipedia.org/wiki/Maryland I get the correct page. But when I browse by http://en.wikipedia.org/wiki/MARYLANDI get the same page as the plugin did. Note I did not type Maryland in all caps and hal responded in lowercase again not how I entered it.

What Am I doing wrong????

Richard [?]



Hi Richard.

you aren't doing anything wrong, this plugin needs WScript.Sleep 10 to load the proper page, you are seeing the page that didn't fully load because it did not have time to load.

WScript.Sleep doesn't work with HAL and produces an error.

I am currently researching ways to remodify the plug so that HAL will be able to use the Wscript.Sleep and load the full wiki pages.

Jerry
Title: HAL plugin, Client Side Server
Post by: Data on December 09, 2007, 07:13:49 am
I tried this plug in, anything that helps Hal learn sounds good to me, but I also get the same problem, Hal looks for a webpage with capital letters and the correct page is not found. However hal did learn from the page it did find and made the brn file ok.
Jerry, obliviously you know more than me about Hal [8D] but the problem seems to be the plugin changing lover case to capitals.

Using XP media centre 2005 with IE7 if that helps.

Expanding on this a little, some kind of online brain or database to learn from, WOW sounds like a really good idea to me, I have quite a lot of of reliable webspace at my disposal and would gladly donate some to this cause.

Roo
Title: HAL plugin, Client Side Server
Post by: freddy888 on December 09, 2007, 08:47:18 am
Me too.  If we could discuss a format that the information would be stored in, then I am able to help with this too.
Title: HAL plugin, Client Side Server
Post by: Data on December 09, 2007, 09:18:55 am
Hi freddy, my guess would be text files laid out in Hals format just like this plugin creates, there would be a number of categories, science, geography etc.

I’m thinking if this grows it could start using quite a lot of webspace.
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on December 09, 2007, 12:36:01 pm
Here are the functions from Internet Explorer's Browser from the shdocvw.dll and can be called by:

Set IE = CreateObject("InternetExplorer.Application")

---------- IE Functions -----------

//Microsoft Internet Controls
//Version: 1.1
SHDocVw;
GUID = {EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B};


//Web Browser interface
Dispatch IWebBrowser;
GUID = {EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Navigates to the previous item in the history list.
  function GoBack; stdcall;
  //Navigates to the next item in the history list.
  function GoForward; stdcall;
  //Go home/start page.
  function GoHome; stdcall;
  //Go Search Page.
  function GoSearch; stdcall;
  //Navigates to a URL or file.
  function Navigate(URL: BSTR; out Flags: ^Variant; out TargetFrameName: ^Variant; out PostData: ^Variant; out Headers: ^Variant); stdcall;
  //Refresh the currently viewed page.
  function Refresh; stdcall;
  //Refresh the currently viewed page.
  function Refresh2(out Level: ^Variant); stdcall;
  //Stops opening a file.
  function Stop; stdcall;
  //Returns the application automation object if accessible, this automation object otherwise..
  property-get Application: IDispatch; stdcall;
  //Returns the automation object of the container/parent if one exists or this automation object.
  property-get Parent: IDispatch; stdcall;
  //Returns the container/parent automation object, if any.
  property-get Container: IDispatch; stdcall;
  //Returns the active Document automation object, if any.
  property-get Document: IDispatch; stdcall;
  //Returns True if this is the top level object.
  property-get TopLevelContainer: Bool; stdcall;
  //Returns the type of the contained document object.
  property-get Type: BSTR; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-get Left: I4; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-put Left(: I4); stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-get Top: I4; stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-put Top(: I4); stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-get Width: I4; stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-put Width(: I4); stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-get Height: I4; stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-put Height(: I4); stdcall;
  //Gets the short (UI-friendly) name of the URL/file currently viewed.
  property-get LocationName: BSTR; stdcall;
  //Gets the full URL/path currently viewed.
  property-get LocationURL: BSTR; stdcall;
  //Query to see if something is still in progress.
  property-get Busy: Bool; stdcall;

//Web Browser Control Events (old)
Dispatch DWebBrowserEvents;
GUID = {EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B};
  //Fired when a new hyperlink is being navigated to.
  function BeforeNavigate(URL: BSTR; out Flags: I4; out TargetFrameName: BSTR; out PostData: ^Variant; out Headers: BSTR; out Cancel: ^Bool); stdcall;
  //Fired when the document being navigated to becomes visible and enters the navigation stack.
  function NavigateComplete(URL: BSTR); stdcall;
  //Statusbar text changed.
  function StatusTextChange(Text: BSTR); stdcall;
  //Fired when download progress is updated.
  function ProgressChange(Progress: I4; ProgressMax: I4); stdcall;
  //Download of page complete.
  function DownloadComplete; stdcall;
  //The enabled state of a command changed
  function CommandStateChange(Command: I4; Enable: Bool); stdcall;
  //Download of a page started.
  function DownloadBegin; stdcall;
  //Fired when a new window should be created.
  function NewWindow(URL: BSTR; Flags: I4; TargetFrameName: BSTR; PostData: ^Variant; Headers: BSTR; out Processed: ^Bool); stdcall;
  //Document title changed.
  function TitleChange(Text: BSTR); stdcall;
  //Fired when a new hyperlink is being navigated to in a frame.
  function FrameBeforeNavigate(URL: BSTR; out Flags: I4; out TargetFrameName: BSTR; out PostData: ^Variant; out Headers: BSTR; out Cancel: ^Bool); stdcall;
  //Fired when a new hyperlink is being navigated to in a frame.
  function FrameNavigateComplete(URL: BSTR); stdcall;
  //Fired when a new window should be created.
  function FrameNewWindow(URL: BSTR; Flags: I4; TargetFrameName: BSTR; PostData: ^Variant; Headers: BSTR; out Processed: ^Bool); stdcall;
  //Fired when application is quiting.
  function Quit(out Cancel: ^Bool); stdcall;
  //Fired when window has been moved.
  function WindowMove; stdcall;
  //Fired when window has been sized.
  function WindowResize; stdcall;
  //Fired when window has been activated.
  function WindowActivate; stdcall;
  //Fired when the PutProperty method has been called.
  function PropertyChange(Property: BSTR); stdcall;

//Constants for WebBrowser CommandStateChange
Enum CommandStateChangeConstants;
GUID = {34A226E0-DF30-11CF-89A9-00A0C9054129};
  //Command Change
  CSC_UPDATECOMMANDS = -1;
  //Navigate Forward
  CSC_NAVIGATEFORWARD = 1;
  //Navigate Back
  CSC_NAVIGATEBACK = 2;

//Web Browser Application Interface.
Dispatch IWebBrowserApp;
GUID = {0002DF05-0000-0000-C000-000000000046};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Navigates to the previous item in the history list.
  function GoBack; stdcall;
  //Navigates to the next item in the history list.
  function GoForward; stdcall;
  //Go home/start page.
  function GoHome; stdcall;
  //Go Search Page.
  function GoSearch; stdcall;
  //Navigates to a URL or file.
  function Navigate(URL: BSTR; out Flags: ^Variant; out TargetFrameName: ^Variant; out PostData: ^Variant; out Headers: ^Variant); stdcall;
  //Refresh the currently viewed page.
  function Refresh; stdcall;
  //Refresh the currently viewed page.
  function Refresh2(out Level: ^Variant); stdcall;
  //Stops opening a file.
  function Stop; stdcall;
  //Returns the application automation object if accessible, this automation object otherwise..
  property-get Application: IDispatch; stdcall;
  //Returns the automation object of the container/parent if one exists or this automation object.
  property-get Parent: IDispatch; stdcall;
  //Returns the container/parent automation object, if any.
  property-get Container: IDispatch; stdcall;
  //Returns the active Document automation object, if any.
  property-get Document: IDispatch; stdcall;
  //Returns True if this is the top level object.
  property-get TopLevelContainer: Bool; stdcall;
  //Returns the type of the contained document object.
  property-get Type: BSTR; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-get Left: I4; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-put Left(: I4); stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-get Top: I4; stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-put Top(: I4); stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-get Width: I4; stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-put Width(: I4); stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-get Height: I4; stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-put Height(: I4); stdcall;
  //Gets the short (UI-friendly) name of the URL/file currently viewed.
  property-get LocationName: BSTR; stdcall;
  //Gets the full URL/path currently viewed.
  property-get LocationURL: BSTR; stdcall;
  //Query to see if something is still in progress.
  property-get Busy: Bool; stdcall;
  //Exits application and closes the open document.
  function Quit; stdcall;
  //Converts client sizes into window sizes.
  function ClientToWindow(out pcx: ^INT; out pcy: ^INT); stdcall;
  //Associates vtValue with the name szProperty in the context of the object.
  function PutProperty(Property: BSTR; vtValue: Variant); stdcall;
  //Retrieve the Associated value for the property vtValue in the context of the object.
  function GetProperty(Property: BSTR): Variant; stdcall;
  //Returns name of the application.
  property-get Name: BSTR; stdcall;
  //Returns the HWND of the current IE window.
  property-get HWND: I4; stdcall;
  //Returns file specification of the application, including path.
  property-get FullName: BSTR; stdcall;
  //Returns the path to the application.
  property-get Path: BSTR; stdcall;
  //Determines whether the application is visible or hidden.
  property-get Visible: Bool; stdcall;
  //Determines whether the application is visible or hidden.
  property-put Visible(: Bool); stdcall;
  //Turn on or off the statusbar.
  property-get StatusBar: Bool; stdcall;
  //Turn on or off the statusbar.
  property-put StatusBar(: Bool); stdcall;
  //Text of Status window.
  property-get StatusText: BSTR; stdcall;
  //Text of Status window.
  property-put StatusText(: BSTR); stdcall;
  //Controls which toolbar is shown.
  property-get ToolBar: INT; stdcall;
  //Controls which toolbar is shown.
  property-put ToolBar(: INT); stdcall;
  //Controls whether menubar is shown.
  property-get MenuBar: Bool; stdcall;
  //Controls whether menubar is shown.
  property-put MenuBar(: Bool); stdcall;
  //Maximizes window and turns off statusbar, toolbar, menubar, and titlebar.
  property-get FullScreen: Bool; stdcall;
  //Maximizes window and turns off statusbar, toolbar, menubar, and titlebar.
  property-put FullScreen(: Bool); stdcall;

//Web Browser Interface for IE4.
Dispatch IWebBrowser2;
GUID = {D30C1661-CDAF-11D0-8A3E-00C04FC9E26E};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Navigates to the previous item in the history list.
  function GoBack; stdcall;
  //Navigates to the next item in the history list.
  function GoForward; stdcall;
  //Go home/start page.
  function GoHome; stdcall;
  //Go Search Page.
  function GoSearch; stdcall;
  //Navigates to a URL or file.
  function Navigate(URL: BSTR; out Flags: ^Variant; out TargetFrameName: ^Variant; out PostData: ^Variant; out Headers: ^Variant); stdcall;
  //Refresh the currently viewed page.
  function Refresh; stdcall;
  //Refresh the currently viewed page.
  function Refresh2(out Level: ^Variant); stdcall;
  //Stops opening a file.
  function Stop; stdcall;
  //Returns the application automation object if accessible, this automation object otherwise..
  property-get Application: IDispatch; stdcall;
  //Returns the automation object of the container/parent if one exists or this automation object.
  property-get Parent: IDispatch; stdcall;
  //Returns the container/parent automation object, if any.
  property-get Container: IDispatch; stdcall;
  //Returns the active Document automation object, if any.
  property-get Document: IDispatch; stdcall;
  //Returns True if this is the top level object.
  property-get TopLevelContainer: Bool; stdcall;
  //Returns the type of the contained document object.
  property-get Type: BSTR; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-get Left: I4; stdcall;
  //The horizontal position (pixels) of the frame window relative to the screen/container.
  property-put Left(: I4); stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-get Top: I4; stdcall;
  //The vertical position (pixels) of the frame window relative to the screen/container.
  property-put Top(: I4); stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-get Width: I4; stdcall;
  //The horizontal dimension (pixels) of the frame window/object.
  property-put Width(: I4); stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-get Height: I4; stdcall;
  //The vertical dimension (pixels) of the frame window/object.
  property-put Height(: I4); stdcall;
  //Gets the short (UI-friendly) name of the URL/file currently viewed.
  property-get LocationName: BSTR; stdcall;
  //Gets the full URL/path currently viewed.
  property-get LocationURL: BSTR; stdcall;
  //Query to see if something is still in progress.
  property-get Busy: Bool; stdcall;
  //Exits application and closes the open document.
  function Quit; stdcall;
  //Converts client sizes into window sizes.
  function ClientToWindow(out pcx: ^INT; out pcy: ^INT); stdcall;
  //Associates vtValue with the name szProperty in the context of the object.
  function PutProperty(Property: BSTR; vtValue: Variant); stdcall;
  //Retrieve the Associated value for the property vtValue in the context of the object.
  function GetProperty(Property: BSTR): Variant; stdcall;
  //Returns name of the application.
  property-get Name: BSTR; stdcall;
  //Returns the HWND of the current IE window.
  property-get HWND: I4; stdcall;
  //Returns file specification of the application, including path.
  property-get FullName: BSTR; stdcall;
  //Returns the path to the application.
  property-get Path: BSTR; stdcall;
  //Determines whether the application is visible or hidden.
  property-get Visible: Bool; stdcall;
  //Determines whether the application is visible or hidden.
  property-put Visible(: Bool); stdcall;
  //Turn on or off the statusbar.
  property-get StatusBar: Bool; stdcall;
  //Turn on or off the statusbar.
  property-put StatusBar(: Bool); stdcall;
  //Text of Status window.
  property-get StatusText: BSTR; stdcall;
  //Text of Status window.
  property-put StatusText(: BSTR); stdcall;
  //Controls which toolbar is shown.
  property-get ToolBar: INT; stdcall;
  //Controls which toolbar is shown.
  property-put ToolBar(: INT); stdcall;
  //Controls whether menubar is shown.
  property-get MenuBar: Bool; stdcall;
  //Controls whether menubar is shown.
  property-put MenuBar(: Bool); stdcall;
  //Maximizes window and turns off statusbar, toolbar, menubar, and titlebar.
  property-get FullScreen: Bool; stdcall;
  //Maximizes window and turns off statusbar, toolbar, menubar, and titlebar.
  property-put FullScreen(: Bool); stdcall;
  //Navigates to a URL or file or pidl.
  function Navigate2(URL: ^Variant; out Flags: ^Variant; out TargetFrameName: ^Variant; out PostData: ^Variant; out Headers: ^Variant); stdcall;
  //IOleCommandTarget::QueryStatus
  function QueryStatusWB(cmdID: OLECMDID): OLECMDF; stdcall;
  //IOleCommandTarget::Exec
  function ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT; out pvaIn: ^Variant; out pvaOut: ^Variant); stdcall;
  //Set BrowserBar to Clsid
  function ShowBrowserBar(pvaClsid: ^Variant; out pvarShow: ^Variant; out pvarSize: ^Variant); stdcall;
  property-get ReadyState: tagREADYSTATE; stdcall;
  //Controls if the frame is offline (read from cache)
  property-get Offline: Bool; stdcall;
  //Controls if the frame is offline (read from cache)
  property-put Offline(: Bool); stdcall;
  //Controls if any dialog boxes can be shown
  property-get Silent: Bool; stdcall;
  //Controls if any dialog boxes can be shown
  property-put Silent(: Bool); stdcall;
  //Registers OC as a top-level browser (for target name resolution)
  property-get RegisterAsBrowser: Bool; stdcall;
  //Registers OC as a top-level browser (for target name resolution)
  property-put RegisterAsBrowser(: Bool); stdcall;
  //Registers OC as a drop target for navigation
  property-get RegisterAsDropTarget: Bool; stdcall;
  //Registers OC as a drop target for navigation
  property-put RegisterAsDropTarget(: Bool); stdcall;
  //Controls if the browser is in theater mode
  property-get TheaterMode: Bool; stdcall;
  //Controls if the browser is in theater mode
  property-put TheaterMode(: Bool); stdcall;
  //Controls whether address bar is shown
  property-get AddressBar: Bool; stdcall;
  //Controls whether address bar is shown
  property-put AddressBar(: Bool); stdcall;
  //Controls whether the window is resizable
  property-get Resizable: Bool; stdcall;
  //Controls whether the window is resizable
  property-put Resizable(: Bool); stdcall;

Enum OLECMDID;
  OLECMDID_OPEN = 1;
  OLECMDID_NEW = 2;
  OLECMDID_SAVE = 3;
  OLECMDID_SAVEAS = 4;
  OLECMDID_SAVECOPYAS = 5;
  OLECMDID_PRINT = 6;
  OLECMDID_PRINTPREVIEW = 7;
  OLECMDID_PAGESETUP = 8;
  OLECMDID_SPELL = 9;
  OLECMDID_PROPERTIES = 10;
  OLECMDID_CUT = 11;
  OLECMDID_COPY = 12;
  OLECMDID_PASTE = 13;
  OLECMDID_PASTESPECIAL = 14;
  OLECMDID_UNDO = 15;
  OLECMDID_REDO = 16;
  OLECMDID_SELECTALL = 17;
  OLECMDID_CLEARSELECTION = 18;
  OLECMDID_ZOOM = 19;
  OLECMDID_GETZOOMRANGE = 20;
  OLECMDID_UPDATECOMMANDS = 21;
  OLECMDID_REFRESH = 22;
  OLECMDID_STOP = 23;
  OLECMDID_HIDETOOLBARS = 24;
  OLECMDID_SETPROGRESSMAX = 25;
  OLECMDID_SETPROGRESSPOS = 26;
  OLECMDID_SETPROGRESSTEXT = 27;
  OLECMDID_SETTITLE = 28;
  OLECMDID_SETDOWNLOADSTATE = 29;
  OLECMDID_STOPDOWNLOAD = 30;
  OLECMDID_ONTOOLBARACTIVATED = 31;
  OLECMDID_FIND = 32;
  OLECMDID_DELETE = 33;
  OLECMDID_HTTPEQUIV = 34;
  OLECMDID_HTTPEQUIV_DONE = 35;
  OLECMDID_ENABLE_INTERACTION = 36;
  OLECMDID_ONUNLOAD = 37;
  OLECMDID_PROPERTYBAG2 = 38;
  OLECMDID_PREREFRESH = 39;
  OLECMDID_SHOWSCRIPTERROR = 40;
  OLECMDID_SHOWMESSAGE = 41;
  OLECMDID_SHOWFIND = 42;
  OLECMDID_SHOWPAGESETUP = 43;
  OLECMDID_SHOWPRINT = 44;
  OLECMDID_CLOSE = 45;
  OLECMDID_ALLOWUILESSSAVEAS = 46;
  OLECMDID_DONTDOWNLOADCSS = 47;
  OLECMDID_UPDATEPAGESTATUS = 48;
  OLECMDID_PRINT2 = 49;
  OLECMDID_PRINTPREVIEW2 = 50;
  OLECMDID_SETPRINTTEMPLATE = 51;
  OLECMDID_GETPRINTTEMPLATE = 52;

Enum OLECMDF;
  OLECMDF_SUPPORTED = 1;
  OLECMDF_ENABLED = 2;
  OLECMDF_LATCHED = 4;
  OLECMDF_NINCHED = 8;
  OLECMDF_INVISIBLE = 16;
  OLECMDF_DEFHIDEONCTXTMENU = 32;

Enum OLECMDEXECOPT;
  OLECMDEXECOPT_DODEFAULT = 0;
  OLECMDEXECOPT_PROMPTUSER = 1;
  OLECMDEXECOPT_DONTPROMPTUSER = 2;
  OLECMDEXECOPT_SHOWHELP = 3;

Enum tagREADYSTATE;
  READYSTATE_UNINITIALIZED = 0;
  READYSTATE_LOADING = 1;
  READYSTATE_LOADED = 2;
  READYSTATE_INTERACTIVE = 3;
  READYSTATE_COMPLETE = 4;

//Constants for WebBrowser security icon notification
Enum SecureLockIconConstants;
GUID = {65507BE0-91A8-11D3-A845-009027220E6D};
  secureLockIconUnsecure = 0;
  secureLockIconMixed = 1;
  secureLockIconSecureUnknownBits = 2;
  secureLockIconSecure40Bit = 3;
  secureLockIconSecure56Bit = 4;
  secureLockIconSecureFortezza = 5;
  secureLockIconSecure128Bit = 6;

//Web Browser Control events interface
Dispatch DWebBrowserEvents2;
GUID = {34A715A0-6587-11D0-924A-0020AFC7AC4D};
  //Statusbar text changed.
  function StatusTextChange(Text: BSTR); stdcall;
  //Fired when download progress is updated.
  function ProgressChange(Progress: I4; ProgressMax: I4); stdcall;
  //The enabled state of a command changed.
  function CommandStateChange(Command: I4; Enable: Bool); stdcall;
  //Download of a page started.
  function DownloadBegin; stdcall;
  //Download of page complete.
  function DownloadComplete; stdcall;
  //Document title changed.
  function TitleChange(Text: BSTR); stdcall;
  //Fired when the PutProperty method has been called.
  function PropertyChange(szProperty: BSTR); stdcall;
  //Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified.
  function BeforeNavigate2(pDisp: IDispatch; URL: ^Variant; Flags: ^Variant; TargetFrameName: ^Variant; PostData: ^Variant; Headers: ^Variant; out Cancel: ^Bool); stdcall;
  //A new, hidden, non-navigated WebBrowser window is needed.
  function NewWindow2(out ppDisp: ^IDispatch; out Cancel: ^Bool); stdcall;
  //Fired when the document being navigated to becomes visible and enters the navigation stack.
  function NavigateComplete2(pDisp: IDispatch; URL: ^Variant); stdcall;
  //Fired when the document being navigated to reaches ReadyState_Complete.
  function DocumentComplete(pDisp: IDispatch; URL: ^Variant); stdcall;
  //Fired when application is quiting.
  function OnQuit; stdcall;
  //Fired when the window should be shown/hidden
  function OnVisible(Visible: Bool); stdcall;
  //Fired when the toolbar  should be shown/hidden
  function OnToolBar(ToolBar: Bool); stdcall;
  //Fired when the menubar should be shown/hidden
  function OnMenuBar(MenuBar: Bool); stdcall;
  //Fired when the statusbar should be shown/hidden
  function OnStatusBar(StatusBar: Bool); stdcall;
  //Fired when fullscreen mode should be on/off
  function OnFullScreen(FullScreen: Bool); stdcall;
  //Fired when theater mode should be on/off
  function OnTheaterMode(TheaterMode: Bool); stdcall;
  //Fired when the host window should allow/disallow resizing
  function WindowSetResizable(Resizable: Bool); stdcall;
  //Fired when the host window should change its Left coordinate
  function WindowSetLeft(Left: I4); stdcall;
  //Fired when the host window should change its Top coordinate
  function WindowSetTop(Top: I4); stdcall;
  //Fired when the host window should change its width
  function WindowSetWidth(Width: I4); stdcall;
  //Fired when the host window should change its height
  function WindowSetHeight(Height: I4); stdcall;
  //Fired when the WebBrowser is about to be closed by script
  function WindowClosing(IsChildWindow: Bool; out Cancel: ^Bool); stdcall;
  //Fired to request client sizes be converted to host window sizes
  function ClientToHostWindow(out CX: ^I4; out CY: ^I4); stdcall;
  //Fired to indicate the security level of the current web page contents
  function SetSecureLockIcon(SecureLockIcon: I4); stdcall;
  //Fired to indicate the File Download dialog is opening
  function FileDownload(out Cancel: ^Bool); stdcall;
  //Fired when a binding error occurs (window or frameset element).
  function NavigateError(pDisp: IDispatch; URL: ^Variant; Frame: ^Variant; StatusCode: ^Variant; out Cancel: ^Bool); stdcall;
  //Fired when a print template is instantiated.
  function PrintTemplateInstantiation(pDisp: IDispatch); stdcall;
  //Fired when a print template destroyed.
  function PrintTemplateTeardown(pDisp: IDispatch); stdcall;
  //Fired when a page is spooled. When it is fired can be changed by a custom template.
  function UpdatePageStatus(pDisp: IDispatch; nPage: ^Variant; fDone: ^Variant); stdcall;
  //Fired when the global privacy impacted state changes
  function PrivacyImpactedStateChange(bImpacted: Bool); stdcall;

//WebBrowser Control
CoClass WebBrowser_V1;
GUID = {EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B};

//WebBrowser Control
CoClass WebBrowser;
GUID = {8856F961-340A-11D0-A96B-00C04FD705A2};

//Internet Explorer Application.
CoClass InternetExplorer;
GUID = {0002DF01-0000-0000-C000-000000000046};

//Shell Browser Window.
CoClass ShellBrowserWindow;
GUID = {C08AFD90-F2A1-11D1-8455-00A0C91F3880};

//Constants for ShellWindows registration
Enum ShellWindowTypeConstants;
GUID = {F41E6981-28E5-11D0-82B4-00A0C90C29C5};
  //Explorer
  SWC_EXPLORER = 0;
  //Various Browsing Windows
  SWC_BROWSER = 1;
  //3rd Party Browsers
  SWC_3RDPARTY = 2;
  //Creation Callback
  SWC_CALLBACK = 4;

//Options for ShellWindows FindWindow
Enum ShellWindowFindWindowOptions;
GUID = {7716A370-38CA-11D0-A48B-00A0C90A8F39};
  //Need Dispatch
  SWFO_NEEDDISPATCH = 1;
  //Include Pending
  SWFO_INCLUDEPENDING = 2;
  //Cookie Passed
  SWFO_COOKIEPASSED = 4;

//Event interface for IShellWindows
Dispatch DShellWindowsEvents;
GUID = {FE4106E0-399A-11D0-A48C-00A0C90A8F39};
  //A new window was registered.
  function WindowRegistered(lCookie: I4); stdcall;
  //A new window was revoked.
  function WindowRevoked(lCookie: I4); stdcall;

//Definition of interface IShellWindows
Dispatch IShellWindows;
GUID = {85CB6900-4D95-11CF-960C-0080C7F4EE85};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Get count of open Shell windows
  property-get Count: I4; stdcall;
  //Return the shell window for the given index
  function Item(out index: Variant): IDispatch; stdcall;
  //Enumerates the figures
  function _NewEnum: IUnknown; stdcall;
  //Register a window with the list
  function Register(pid: IDispatch; HWND: I4; swClass: INT; out plCookie: ^I4); stdcall;
  //Register a pending open with the list
  function RegisterPending(lThreadId: I4; pvarloc: ^Variant; pvarlocRoot: ^Variant; swClass: INT; out plCookie: ^I4); stdcall;
  //Remove a window from the list
  function Revoke(lCookie: I4); stdcall;
  //Notifies the new location
  function OnNavigate(lCookie: I4; pvarloc: ^Variant); stdcall;
  //Notifies the activation
  function OnActivated(lCookie: I4; fActive: Bool); stdcall;
  //Find the window based on the location
  function FindWindowSW(pvarloc: ^Variant; pvarlocRoot: ^Variant; swClass: INT; out pHWND: ^I4; swfwOptions: INT): IDispatch; stdcall;
  //Notifies on creation and frame name set
  function OnCreated(lCookie: I4; punk: IUnknown); stdcall;
  //Used by IExplore to register different processes
  function ProcessAttachDetach(fAttach: Bool); stdcall;

//ShellDispatch Load in Shell Context
CoClass ShellWindows;
GUID = {9BA05972-F6A8-11CF-A442-00A0C90A8F39};

//Shell UI Helper Control Interface
Dispatch IShellUIHelper;
GUID = {729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  function ResetFirstBootMode; stdcall;
  function ResetSafeMode; stdcall;
  function RefreshOfflineDesktop; stdcall;
  function AddFavorite(URL: BSTR; out Title: ^Variant); stdcall;
  function AddChannel(URL: BSTR); stdcall;
  function AddDesktopComponent(URL: BSTR; Type: BSTR; out Left: ^Variant; out Top: ^Variant; out Width: ^Variant; out Height: ^Variant); stdcall;
  function IsSubscribed(URL: BSTR): Bool; stdcall;
  function NavigateAndFind(URL: BSTR; strQuery: BSTR; varTargetFrame: ^Variant); stdcall;
  function ImportExportFavorites(fImport: Bool; strImpExpPath: BSTR); stdcall;
  function AutoCompleteSaveForm(out Form: ^Variant); stdcall;
  function AutoScan(strSearch: BSTR; strFailureUrl: BSTR; out pvarTargetFrame: ^Variant); stdcall;
  function AutoCompleteAttach(out Reserved: ^Variant); stdcall;
  function ShowBrowserUI(bstrName: BSTR; pvarIn: ^Variant): Variant; stdcall;

CoClass ShellUIHelper;
GUID = {64AB4BB7-111E-11D1-8F79-00C04FC2FBE1};

Dispatch DShellNameSpaceEvents;
GUID = {55136806-B2DE-11D1-B9F2-00A0C98BC547};
  function FavoritesSelectionChange(cItems: I4; hItem: I4; strName: BSTR; strUrl: BSTR; cVisits: I4; strDate: BSTR; fAvailableOffline: I4); stdcall;
  function SelectionChange; stdcall;
  function DoubleClick; stdcall;
  function Initialized; stdcall;

//IShellFavoritesNameSpace Interface
Dispatch IShellFavoritesNameSpace;
GUID = {55136804-B2DE-11D1-B9F2-00A0C98BC547};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //method MoveSelectionUp
  function MoveSelectionUp; stdcall;
  //method MoveSelectionDown
  function MoveSelectionDown; stdcall;
  //method ResetSort
  function ResetSort; stdcall;
  //method NewFolder
  function NewFolder; stdcall;
  //method Synchronize
  function Synchronize; stdcall;
  //method Import
  function Import; stdcall;
  //method Export
  function Export; stdcall;
  //method InvokeContextMenuCommand
  function InvokeContextMenuCommand(strCommand: BSTR); stdcall;
  //method MoveSelectionTo
  function MoveSelectionTo; stdcall;
  //Query to see if subscriptions are enabled
  property-get SubscriptionsEnabled: Bool; stdcall;
  //method CreateSubscriptionForSelection
  function CreateSubscriptionForSelection: Bool; stdcall;
  //method DeleteSubscriptionForSelection
  function DeleteSubscriptionForSelection: Bool; stdcall;
  //old, use put_Root() instead
  function SetRoot(bstrFullPath: BSTR); stdcall;

//IShellNameSpace Interface
Dispatch IShellNameSpace;
GUID = {E572D3C9-37BE-4AE2-825D-D521763E3108};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //method MoveSelectionUp
  function MoveSelectionUp; stdcall;
  //method MoveSelectionDown
  function MoveSelectionDown; stdcall;
  //method ResetSort
  function ResetSort; stdcall;
  //method NewFolder
  function NewFolder; stdcall;
  //method Synchronize
  function Synchronize; stdcall;
  //method Import
  function Import; stdcall;
  //method Export
  function Export; stdcall;
  //method InvokeContextMenuCommand
  function InvokeContextMenuCommand(strCommand: BSTR); stdcall;
  //method MoveSelectionTo
  function MoveSelectionTo; stdcall;
  //Query to see if subscriptions are enabled
  property-get SubscriptionsEnabled: Bool; stdcall;
  //method CreateSubscriptionForSelection
  function CreateSubscriptionForSelection: Bool; stdcall;
  //method DeleteSubscriptionForSelection
  function DeleteSubscriptionForSelection: Bool; stdcall;
  //old, use put_Root() instead
  function SetRoot(bstrFullPath: BSTR); stdcall;
  //options
  property-get EnumOptions: I4; stdcall;
  //options
  property-put EnumOptions(: I4); stdcall;
  //get the selected item
  property-get SelectedItem: IDispatch; stdcall;
  //get the selected item
  property-put SelectedItem(: IDispatch); stdcall;
  //get the root item
  property-get Root: Variant; stdcall;
  //get the root item
  property-put Root(: Variant); stdcall;
  property-get Depth: INT; stdcall;
  property-put Depth(: INT); stdcall;
  property-get Mode: UINT; stdcall;
  property-put Mode(: UINT); stdcall;
  property-get Flags: UI4; stdcall;
  property-put Flags(: UI4); stdcall;
  property-put TVFlags(: UI4); stdcall;
  property-get TVFlags: UI4; stdcall;
  property-get Columns: BSTR; stdcall;
  property-put Columns(: BSTR); stdcall;
  //number of view types
  property-get CountViewTypes: INT; stdcall;
  //set view type
  function SetViewType(iType: INT); stdcall;
  //collection of selected items
  function SelectedItems: IDispatch; stdcall;
  //expands item specified depth
  function Expand(var: Variant; out iDepth: INT); stdcall;
  //unselects all items
  function UnselectAll; stdcall;

CoClass ShellNameSpace;
GUID = {55136805-B2DE-11D1-B9F2-00A0C98BC547};

//Script Error List Interface
Dispatch IScriptErrorList;
GUID = {F3470F24-15FD-11D2-BB2E-00805FF7EFCA};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  function advanceError; stdcall;
  function retreatError; stdcall;
  function canAdvanceError: I4; stdcall;
  function canRetreatError: I4; stdcall;
  function getErrorLine: I4; stdcall;
  function getErrorChar: I4; stdcall;
  function getErrorCode: I4; stdcall;
  function getErrorMsg: BSTR; stdcall;
  function getErrorUrl: BSTR; stdcall;
  function getAlwaysShowLockState: I4; stdcall;
  function getDetailsPaneOpen: I4; stdcall;
  function setDetailsPaneOpen(out fDetailsPaneOpen: I4); stdcall;
  function getPerErrorDisplay: I4; stdcall;
  function setPerErrorDisplay(out fPerErrorDisplay: I4); stdcall;

CoClass CScriptErrorList;
GUID = {EFD01300-160F-11D2-BB2E-00805FF7EFCA};

//Enumerated Search
Dispatch ISearch;
GUID = {BA9239A4-3DD5-11D2-BF8B-00C04FB93661};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Get search title
  property-get Title: BSTR; stdcall;
  //Get search guid
  property-get Id: BSTR; stdcall;
  //Get search url
  property-get URL: BSTR; stdcall;

//Searches Enum
Dispatch ISearches;
GUID = {47C922A2-3DD5-11D2-BF8B-00C04FB93661};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  //Get the count of searches
  property-get Count: I4; stdcall;
  //Get the default search name
  property-get Default: BSTR; stdcall;
  //Return the specified search
  function Item(out index: Variant): ^ISearch; stdcall;
  //Enumerates the searches
  function _NewEnum: IUnknown; stdcall;

//ISearchAssistantOC Interface
Dispatch ISearchAssistantOC;
GUID = {72423E8F-8011-11D2-BE79-00A0C9A83DA1};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  function AddNextMenuItem(bstrText: BSTR; idItem: I4); stdcall;
  function SetDefaultSearchUrl(bstrUrl: BSTR); stdcall;
  function NavigateToDefaultSearch; stdcall;
  function IsRestricted(bstrGuid: BSTR): Bool; stdcall;
  //property ShellFeaturesEnabled
  property-get ShellFeaturesEnabled: Bool; stdcall;
  //property SearchAssistantDefault
  property-get SearchAssistantDefault: Bool; stdcall;
  //Get searches
  property-get Searches: ^ISearches; stdcall;
  //Returns true if the current folder is web folder
  property-get InWebFolder: Bool; stdcall;
  function PutProperty(bPerLocale: Bool; bstrName: BSTR; bstrValue: BSTR); stdcall;
  function GetProperty(bPerLocale: Bool; bstrName: BSTR): BSTR; stdcall;
  property-put EventHandled(: Bool); stdcall;
  function ResetNextMenu; stdcall;
  function FindOnWeb; stdcall;
  function FindFilesOrFolders; stdcall;
  function FindComputer; stdcall;
  function FindPrinter; stdcall;
  function FindPeople; stdcall;
  function GetSearchAssistantURL(bSubstitute: Bool; bCustomize: Bool): BSTR; stdcall;
  function NotifySearchSettingsChanged; stdcall;
  property-put ASProvider(: BSTR); stdcall;
  property-get ASProvider: BSTR; stdcall;
  property-put ASSetting(: INT); stdcall;
  property-get ASSetting: INT; stdcall;
  function NETDetectNextNavigate; stdcall;
  function PutFindText(FindText: BSTR); stdcall;
  property-get Version: INT; stdcall;
  function EncodeString(bstrValue: BSTR; bstrCharSet: BSTR; bUseUTF8: Bool): BSTR; stdcall;

//ISearchAssistantOC2 Interface
Dispatch ISearchAssistantOC2;
GUID = {72423E8F-8011-11D2-BE79-00A0C9A83DA2};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  function AddNextMenuItem(bstrText: BSTR; idItem: I4); stdcall;
  function SetDefaultSearchUrl(bstrUrl: BSTR); stdcall;
  function NavigateToDefaultSearch; stdcall;
  function IsRestricted(bstrGuid: BSTR): Bool; stdcall;
  //property ShellFeaturesEnabled
  property-get ShellFeaturesEnabled: Bool; stdcall;
  //property SearchAssistantDefault
  property-get SearchAssistantDefault: Bool; stdcall;
  //Get searches
  property-get Searches: ^ISearches; stdcall;
  //Returns true if the current folder is web folder
  property-get InWebFolder: Bool; stdcall;
  function PutProperty(bPerLocale: Bool; bstrName: BSTR; bstrValue: BSTR); stdcall;
  function GetProperty(bPerLocale: Bool; bstrName: BSTR): BSTR; stdcall;
  property-put EventHandled(: Bool); stdcall;
  function ResetNextMenu; stdcall;
  function FindOnWeb; stdcall;
  function FindFilesOrFolders; stdcall;
  function FindComputer; stdcall;
  function FindPrinter; stdcall;
  function FindPeople; stdcall;
  function GetSearchAssistantURL(bSubstitute: Bool; bCustomize: Bool): BSTR; stdcall;
  function NotifySearchSettingsChanged; stdcall;
  property-put ASProvider(: BSTR); stdcall;
  property-get ASProvider: BSTR; stdcall;
  property-put ASSetting(: INT); stdcall;
  property-get ASSetting: INT; stdcall;
  function NETDetectNextNavigate; stdcall;
  function PutFindText(FindText: BSTR); stdcall;
  property-get Version: INT; stdcall;
  function EncodeString(bstrValue: BSTR; bstrCharSet: BSTR; bUseUTF8: Bool): BSTR; stdcall;
  property-get ShowFindPrinter: Bool; stdcall;

//ISearchAssistantOC3 Interface
Dispatch ISearchAssistantOC3;
GUID = {72423E8F-8011-11D2-BE79-00A0C9A83DA3};
  function QueryInterface(riid: ^GUID; out ppvObj: ^^VOID); stdcall;
  function AddRef: UI4; stdcall;
  function Release: UI4; stdcall;
  function GetTypeInfoCount(out pctinfo: ^UINT); stdcall;
  function GetTypeInfo(itinfo: UINT; lcid: UI4; out pptinfo: ^^VOID); stdcall;
  function GetIDsOfNames(riid: ^GUID; rgszNames: ^^I1; cNames: UINT; lcid: UI4; out rgdispid: ^I4); stdcall;
  function Invoke(dispidMember: I4; riid: ^GUID; lcid: UI4; wFlags: UI2; pdispparams: ^DISPPARAMS; out pvarResult: ^Variant; out pexcepinfo: ^EXCEPINFO; out puArgErr: ^UINT); stdcall;
  function AddNextMenuItem(bstrText: BSTR; idItem: I4); stdcall;
  function SetDefaultSearchUrl(bstrUrl: BSTR); stdcall;
  function NavigateToDefaultSearch; stdcall;
  function IsRestricted(bstrGuid: BSTR): Bool; stdcall;
  //property ShellFeaturesEnabled
  property-get ShellFeaturesEnabled: Bool; stdcall;
  //property SearchAssistantDefault
  property-get SearchAssistantDefault: Bool; stdcall;
  //Get searches
  property-get Searches: ^ISearches; stdcall;
  //Returns true if the current folder is web folder
  property-get InWebFolder: Bool; stdcall;
  function PutProperty(bPerLocale: Bool; bstrName: BSTR; bstrValue: BSTR); stdcall;
  function GetProperty(bPerLocale: Bool; bstrName: BSTR): BSTR; stdcall;
  property-put EventHandled(: Bool); stdcall;
  function ResetNextMenu; stdcall;
  function FindOnWeb; stdcall;
  function FindFilesOrFolders; stdcall;
  function FindComputer; stdcall;
  function FindPrinter; stdcall;
  function FindPeople; stdcall;
  function GetSearchAssistantURL(bSubstitute: Bool; bCustomize: Bool): BSTR; stdcall;
  function NotifySearchSettingsChanged; stdcall;
  property-put ASProvider(: BSTR); stdcall;
  property-get ASProvider: BSTR; stdcall;
  property-put ASSetting(: INT); stdcall;
  property-get ASSetting: INT; stdcall;
  function NETDetectNextNavigate; stdcall;
  function PutFindText(FindText: BSTR); stdcall;
  property-get Version: INT; stdcall;
  function EncodeString(bstrValue: BSTR; bstrCharSet: BSTR; bUseUTF8: Bool): BSTR; stdcall;
  property-get ShowFindPrinter: Bool; stdcall;
  property-get SearchCompanionAvailable: Bool; stdcall;
  property-put UseSearchCompanion(: Bool); stdcall;
  property-get UseSearchCompanion: Bool; stdcall;

Dispatch _SearchAssistantEvents;
GUID = {1611FDDA-445B-11D2-85DE-00C04FA35C89};
  function OnNextMenuSelect(idItem: I4); stdcall;
  function OnNewSearch; stdcall;

//SearchAssistantOC Class
CoClass SearchAssistantOC;
GUID = {B45FF030-4447-11D2-85DE-00C04FA35C89};

Jerry[8D]
Title: HAL plugin, Client Side Server
Post by: vjimmerson on May 24, 2008, 11:37:39 am
Hi Jerry!  I downloaded your zip file and managed to get it to respond. Are there any more commands besides "Please study about xxxx." that make it work?  I belive you mentioned it can spider web sites for information.  Is this true and if so how would I get it to do so?
Title: HAL plugin, Client Side Server
Post by: Art on May 24, 2008, 02:37:23 pm
Vern,

The UHP file is basically nothing more than a structured text file and can be easily modified with a text editor.

About 36 lines (give or take) you should see the section where it has:
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT *", 2)

Simply change the text between the asterisks * to suit your needs.
(be mindful of the extra space at the end).

You could also change the parameters for the search by inserting / changing the section :

SourcePage = "http://en.wikipedia.org/wiki/" & WikiToLookup

objExplorer.Navigate("http://en.wikipedia.org/wiki/" & WikiToLookup)

to another site of your choosing. Be careful and always make a backup of your halbrain.db file before making any changes.

Title: HAL plugin, Client Side Server
Post by: vjimmerson on May 24, 2008, 06:03:35 pm
<<Thank you Art!  I will play with it a bit.>>

Do each of the add-ins run each time a sentence is entered into Hals input screen? If so I can see where installing a lot of add-ins without knowing what they are doing could waste a lot of system resources.   I have a few questions about the AutoWikiKnowledge.uhp file.

Where does the variable/input 'InputString' come from?  
Is this an input variable and if so what would it contain?
Is InputString the same as the MyInput variable?


Does HalXBrain.AppendFile do something different then using Scripting.FileSystemObject object to read and write to files?
I'm working through the code and rewriting it a bit in order to
understand what it is doing and make sure it won't steal to many system resources from my machine.

This is not finished code and has not been tested at all yet!
'---------------------------------------------------------------------
Rem Type=Plugin
Rem Name=Auto Wikipedia Knowledge
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005  -- Modified by forum user
Rem Host=All

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Just say: please study about the universe or please study about science, you can replace the word Universe or Science with any other word or noun, all information on the word is studied from the website Wikipedia"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub



Const ForReading = 1
Const ForWriting = 2

'-----------------------------------------------------------------------------
' Definitions
'-----------------------------------------------------------------------------
' MyInput        : The user input?
' InputString   : The user input again?




'-----------------------------------------------------------------------------
' Create a reference to the UltraHalAsst.Brain code library.
'-----------------------------------------------------------------------------
Set HalXBrain = CreateObject("UltraHalAsst.Brain")


'-----------------------------------------------------------------------------
' Determine if we want to process the user input by searching for a form
' of the desired command and parsing out the specific subject to study.
'-----------------------------------------------------------------------------
WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT *", 2)


'-----------------------------------------------------------------------------
' If the user input matches what we want to respond to process it.
'-----------------------------------------------------------------------------
If WikiToLookup <> "" Then

'-----------------------------------------------------------------------------
' Initialize variables
'-----------------------------------------------------------------------------
   XDir = "C:Program FilesabawareUltra Hal Assistant 6\"
   MyFile = "C:Program FilesabawareUltra Hal Assistant 6AutoText.brn"
   SourcePage = "http://en.wikipedia.org/wiki/" & WikiToLookup
   strNewContents = ""

'-----------------------------------------------------------------------------
' Clean the user input.
'-----------------------------------------------------------------------------
   MyInput = HalXBrain.AlphaNumericalOnly(InputString)

'--------------------------------------------
' Read a page off the internet
'--------------------------------------------
   objExplorer.Navigate(SourcePage)
   Set objExplorer = CreateObject("InternetExplorer.Application")
   Do Until objExplorer.ReadyState=4 : Loop
   myText = objExplorer.Document.Body.innerText
   Set objExplorer = Nothing

'--------------------------------------------
' Write internet page information to file
'--------------------------------------------
   If Len(myText) > 0 then
      If FileSys.FileExists(MyFile) = False Then
         HalXBrain.AppendFile MyFile, "Start of Knowledge strings"
      End If
      HalXBrain.AppendFile MyFile, Trim(myText)
   End If

'--------------------------------------------
' Respond to user
'--------------------------------------------
   UltraHal = " I have looked up the study of " & WikiToLookup & ", Thanks. "


'--------------------------------------------
' The rest of the code below looks like it is  attempting to
' cleanse the existing AutoText.brn file.
' It should be in a subroutine of it's own.
' I wouldn't want to clean the whole text file
' every time Hal get's a a new line of input.
'--------------------------------------------

'--------------------------------------------
' Read all of MyFile into variable strText
'--------------------------------------------
   strText = ReadFile(MyFile)

'--------------------------------------------
' Clean file
'--------------------------------------------
   If InStr(1, strText, "   ", vbTextCompare) > 0 Then   strText = CleanFile(MyFile)

'--------------------------------------------
' Write the cleansed text back to the file.
'--------------------------------------------
   If Len(strText) > 0 Then WriteFile(MyFile, strText)  


'--------------------------------------------
' Calculate the number of sentences based on the number of lines ending in periods.
' I would think this should also take into consideration question marks and exclamation points.
'--------------------------------------------
   TextCount = StrCount()


'--------------------------------------------
' I haven't worked on this yet.
' it looks like it is attempting to compare each line in the
' file with the user input and then have Hal read back one of them.
' I didn't notice any feedback from Hal after the indicated he had studied the subject
' so I'm not sure what is going on here.
'--------------------------------------------

'--------------------------------------------
' For each sentenct retrieved from MyFile
'--------------------------------------------
   For i = 1 To TextCount
      ClipResX = HalXBrain.ChooseSentenceFromFile(MyFile)
      ClipResX = HalXBrain.AlphaNumericalOnly(ClipResX)
      ClipResX = UCase(ClipResX)
      ClipResX = Trim(ClipResX)

      MyInputString = HalXBrain.AlphaNumericalOnly(InputString)
      MyInputString = UCase(MyInputString)
      MyInputString = Trim(MyInputString)

      If InStr(1, ClipResX, MyInputString, vbTextCompare) > 0 And Len(ClipResX) > 50 Then
         UltraHal = ClipResX
      ElseIf Len(ClipResX) < 50 Then
         UltraHal = UltraHal
      End If
   Next


End If

'********************************************************************
'*
'********************************************************************
Function StrCount()
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objTextFile = objFSO.OpenTextFile("C:Program FilesabawareUltra Hal Assistant 6AutoText.brn", ReadVariable())
  strText = objTextFile.ReadAll
  objTextFile.Close
         
  Do While InStr(1, strText, "  ")
   strText = Replace(strText, "  ", " ")
   Exit Do
  Loop
  aWords = split(strText, ". ")
  StrCount = Ubound(aWords) + 1
End Function

'********************************************************************
'*
'********************************************************************
Sub WriteFile(sFilePathAndName,sFileContents)  

  Const ForWriting =2

  Set oFS = Server.CreateObject("Scripting.FileSystemObject")
  Set oFSFile = oFS.OpenTextFile(sFilePathAndName,ForWriting,True)

  oFSFile.Write(sFileContents)
  oFSFile.Close

  Set oFSFile = Nothing
  Set oFS = Nothing

End Sub

'********************************************************************
'*
'********************************************************************
Function ReadFile(sFilePathAndName)

   dim sFileContents
   Set oFS = Server.CreateObject("Scripting.FileSystemObject")

   If oFS.FileExists(sFilePathAndName) = True Then
      Set oTextStream = oFS.OpenTextFile(sFilePathAndName,1)
      sFileContents = oTextStream.ReadAll
      oTextStream.Close
      Set oTextStream = nothing
   End if
   Set oFS = nothing

   ReadFile = sFileContents

End Function

'********************************************************************
'*
'********************************************************************
Sub CleanFile(sFilePathAndName)
'--------------------------------------------
' 1. Read a line and removing preceding and trailing spaces.
' 2' Append vbCrLf to the line and then append it to the new text variable strNewContents.
'--------------------------------------------
   Const ForReading = 1
   Const ForWriting = 2
   Const ForAppending = 8
   Const TristateUseDefault = -2
   Const TristateTrue = -1
   Const TristateFalse = 0

   Dim oFS
   Dim oFile
   Dim oStream
   Dim sRecord
   Dim strNewContents

   Set oFS = Server.CreateObject("Scripting.FileSystemObject")
   Set oFile = oFS.GetFile(sFilePathAndName)
   Set oStream = oFile.OpenAsTextStream(ForReading, TristateUseDefault)

   Do While Not oStream.AtEndOfStream
      sRecord=oStream.ReadLine

'--------------------------------------------
' Clean the text
'--------------------------------------------
   sRecord = Trim(sRecord)

'--------------------------------------------
' Append to new contents string
'--------------------------------------------
   If Len(sRecord) > 0 Then strNewContents = strNewContents & sRecord & vbCrLf

   Loop

   oStream.Close

   CleanFile = strNewContents

  End Sub
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on May 25, 2008, 05:30:03 pm
Hi vjimmerson.

you are going to run into problems using the constants, code only allows each constant mentioned once or an error will occur, the same will hold true if you might be using other plug-ins that use the same constant names.

What I usually do is create my own custom constants that will not conflict with other plug-ins.

InputString is just like String, it contains all the sentencing and punctuation, HalXBrain.AlphaNumericalOnly(InputString) simply removes the punctuation from the InputString for processing.

if you have any more questions I'll be glad to help.
Jerry [8D]
Title: HAL plugin, Client Side Server
Post by: vjimmerson on May 25, 2008, 07:13:14 pm
Thank you Jerry!  You have supplied at least %90 of the examples I have found if not more so I appreciate the work you have already done and shared.  As time permits I'm going to try to get up to speed on this stuff myself .  I;ve already lost money from contract work I should be doing instead of playing with this stuff but this AI stuff sure looks like fun and could be very usefull as well.

<<you are going to run into problems using the constants, code only allows each constant mentioned once or an error will occur, the same will hold true if you might be using other plug-ins that use the same constant names.>>

So all the plugins are treated as one code set?

<<What I usually do is create my own custom constants that will not conflict with other plug-ins.>>

Thanks!  I will start using my own naming convention to reduce the chance of conflicts.


<<InputString is just like String, it contains all the sentencing and punctuation, HalXBrain.AlphaNumericalOnly(InputString) simply removes the punctuation from the InputString for processing.>>

Thanks.  Is a help file or source code avalable for the HalXBrain?
It looked like HalXBrain.Brain already had a FileSystem object defined.  It this the case?

<<if you have any more questions I'll be glad to help.>>
Thanks a lot!  I've got an HP TC1100 I'm playing with this on.  Have a BlueParrot blue tooth headset and the latest version of Dragon Natuarally Speaking Preferred coming next Tuesday.  I'm looking forward to turning it into a mobile secretary and it looks like it may actually be possible now.  It seems that this should all be integrated with a database of some sort but I can see where the performance considerations might make it more practical to use the database to create the uhp files instead of actually hitting the DB while using Hal.  Hard coding is harder to maintain but probably a lot quicker the SQL calls.  Thanks again!

One more question!  Do you know if there a way to control when Hal reads the input data?  This may just be a DNS issue but I'm always needing to correct something and in a hurry to do it before Hal reads it.  I've tried your correction plugin which is nice but I should be able to just use DNS.  I'll check it's help as it's probably not Hal related.  Talk with you later!
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on May 26, 2008, 12:48:39 am
Hi vjimmerson.

If you go to your Ultra Hal Assistant 6 folder and open up the HalBrain.mbr file with note pad you will see all of the custom functions available for programming HAL.

Yes, all plug-ins get cached to a single file called the HalScript.dbg for processing.

the HalXBrain.Brain is a call to the oldHal.dll file not the new HalBrain.dll

Jerry [8D]
Title: HAL plugin, Client Side Server
Post by: vjimmerson on May 26, 2008, 03:07:49 am
<<If you go to your Ultra Hal Assistant 6 folder and open up the HalBrain.mbr file with note pad you will see all of the custom functions available for programming HAL. >>

Since I've seen scripts that use CreateObect to create the FileSystem object it would appear that the uhp scripts are just vbscript so why would there be a need to stick vbscript function declarations into the HalVB.mbr? Are the mbr files (HalBrain.mbr, HalVB.mbr and WordNet.mbr) just declarations for DLL libraries.

<<Yes, all plug-ins get cached to a single file called the HalScript.dbg for processing.>>

Interesting!  So any plugin could cause problems with the whole app?
Does the HalScript.dbg run the whole app or is it just the plug-in part of Hals main program?  Do you know what languate Hal was created in?  Just courious!
Title: HAL plugin, Client Side Server
Post by: onthecuttingedge2005 on May 26, 2008, 11:28:02 am
quote:

Since I've seen scripts that use CreateObect to create the FileSystem object it would appear that the uhp scripts are just vbscript so why would there be a need to stick vbscript function declarations into the HalVB.mbr? Are the mbr files (HalBrain.mbr, HalVB.mbr and WordNet.mbr) just declarations for DLL libraries.



if you open up your Hal Assistant database editor and go to file and then choose expert mode, then go to some area of the chosen vbscript brain in the editor and type HalBrain. with the period you will see a balloon list box of functions that are called from the HalBrain.mbr file, the .mbr files are balloon help files that appear when typing certain key funtions.

for wordnet editor help type in WN. and a list box of functions will appear to help guide your programming functionality.


quote:

Interesting!  So any plugin could cause problems with the whole app?
Does the HalScript.dbg run the whole app or is it just the plug-in part of Hals main program?  Do you know what languate Hal was created in?  Just courious!



Correct, the HalScript.dbg is just the cache file for HAL Assistant .dll processes.

I think Robert needs to address what language he compiled HAL in since  
that's his department.

if you have anymore questions then ask away, I have tons of knowledge about HAL but Robert knows more about HAL then I do.
Jerry[8D]
Title: HAL plugin, Client Side Server
Post by: nalkari on May 27, 2008, 09:38:00 pm
hey cuttingedge this is a really cool idea well done. I was wondering if you could do the same for wikihow.
Pretty PLEASE!!!


Nal
Title: HAL plugin, Client Side Server
Post by: vildanovak on June 06, 2008, 04:24:01 am
Hello, this thread is interesting, but I don't understand if actually anybody did make the autowikiknowledge plugin to work well, since it throws me also the same "no wiki page like that" errors. Is there a working version of the script somewhere?

Also - does it actually work for the current 6.1 version of HAL?

anyway, thanks for sharing.
Title: HAL plugin, Client Side Server
Post by: Foxyfox on June 08, 2008, 10:14:53 pm
quote:
Originally posted by onthecuttingedge2005

quote:
Originally posted by sitroom

I seem to be having a small problem with the plugin.

quote:
Richard: please study about Maryland
Hal: I have looked up the study of maryland, Thanks. Learning about gravity is heavy study.



This is what I get in AutoText.brn :

quote:
34,961 have donated.
You can help Wikipedia change the world!  » Donate now!
From the fundraising blog – Help Spread the Word About Our Fundraiser
"Wikipedia is a cornerstone of modern civilization." — Anon. [Hide this message]
[Show more]
MARYLAND
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Look for MARYLAND on one of Wikipedia's sister projects: Wiktionary (free dictionary)
Wikibooks (free textbooks)
Wikiquote (quotations)
Wikisource (free library)
Commons (images and media)
Wikinews (free news source)
Wikipedia does not have an article with this exact name. Please search for MARYLAND in Wikipedia to check for alternative titles or spellings.
Start the MARYLAND article or add a request for it.
Search for "MARYLAND" in existing articles.
Look for pages within Wikipedia that link to this title.
Other reasons why this message may be displayed:
If a page was recently created here, it may not yet be visible because of a delay in updating the database; wait a few minutes and try the purge function.
Titles on Wikipedia are case sensitive except for the first character; please check alternate capitalizations and consider adding a redirect here to the correct title.
If the page has been deleted, check the deletion log, and see Why was my page deleted?.
Retrieved from "http://en.wikipedia.org/wiki/MARYLAND"
ViewsArticle Discussion Personal toolsSign in / create account Navigation
Main page
Contents
Featured content
Current events
Random article
interaction
About Wikipedia
Community portal
Recent changes
Contact Wikipedia
Donate to Wikipedia
Help
Search
Toolbox
What links here
Upload file
Special pages
Printable version
Privacy policy About Wikipedia Disclaimers



When I browse by http://en.wikipedia.org/wiki/Maryland I get the correct page. But when I browse by http://en.wikipedia.org/wiki/MARYLANDI get the same page as the plugin did. Note I did not type Maryland in all caps and hal responded in lowercase again not how I entered it.

What Am I doing wrong????

Richard [?]



Hi Richard.

you aren't doing anything wrong, this plugin needs WScript.Sleep 10 to load the proper page, you are seeing the page that didn't fully load because it did not have time to load.

WScript.Sleep doesn't work with HAL and produces an error.

I am currently researching ways to remodify the plug so that HAL will be able to use the Wscript.Sleep and load the full wiki pages.

Jerry

Title: HAL plugin, Client Side Server
Post by: Foxyfox on June 08, 2008, 10:17:52 pm
Jerry,

Sorry bout the double post.

It's not about the length of time it takes the page to load, its the page is getting the request in CAPS and wiki is case SeNsItIvE.


Also, a fix for those with Vista.
Just open the file in notepad and adjust where it thinks Hal is.
C:Program FilesabawareUltra Hal Assistant 6
C:Program Files (x86)abawareUltra Hal Assistant 6
Title: HAL plugin, Client Side Server
Post by: vjimmerson on June 09, 2008, 03:34:36 am
Although I can see a lot of potential for Hal I haven't yet been overly impressed with how Hal is being used to store information, categorize it and learn from it (make it available for me to use).  For instance what would stop us from asking Hal to remember something, giving him a category to file it under and a name for the piece of information.  

e.g.

Hi Hal!  Tell what you know about ???.  
    (hopefully this would be a search of the database, not static
    code in an add-in).
Hal responds with the categories of information he has stored.
I interrupt Hal when he names some category of information I am interested in.
Hal responds with the names of the pieces of information he has stored under the specified category.
I interrupt Hal when he names something I would like him to read or paste onto the clip board.  This would probably be best coded with each question and answer leading the user down a tree of information.
This would enable us to search by more than just a category and article name.

I could then start to build a database of information by using as much DNS functionalty I can such as going to a web page and selecting some information and pasting it into the clipboard. I could then ask then hal to copy the information from the clip board. I started to look at Hal's database but I have another week or two of data migration work to complete so it will probably be a bit before I get to coding anything.  I think this could be done without to much effort.  Please let me know if anyone has already worked on anything like this as I do like to avoid reinventing the wheel as much as possible.  I'm at a stage in my life and a season where I would rather be out on my JetSki then coding although I do enjoy both!
Title: HAL plugin, Client Side Server
Post by: DarcyEdwards on October 30, 2008, 09:26:02 am
Jerry,

Seems my last post didn't post.... so let me try it again!

-------------------------------------------------------------

The problem Wikipedia is opened and paramaters are passed is that they are in upper case, even if typed in lower case. in your statement:

objExplorer.Navigate("http://en.wikipedia.org/wiki/" & WikiToLookup)

can be corrected by the LCase() function:

objExplorer.Navigate("http://en.wikipedia.org/wiki/" & LCase(WikiToLookup))

This seems to have corrected the problem on my Hal

Hugs

Darcy
Title: HAL plugin, Client Side Server
Post by: freddy888 on November 08, 2008, 11:26:26 am
I am going to give this a go.  Can anyone tell me if Jerry's plugin does anything to the database or does it just work using the 'old' brain file system?

Probably be okay, but I didn't want to mess with my new database brain, and yes - backups will be made..

[?]
Title: HAL plugin, Client Side Server
Post by: DarcyEdwards on November 08, 2008, 03:55:17 pm
Freddy,
No it does not alter Hal's data base in any way, but builds a big file that is difficult to read.  I added a lookup command for Wikipedia the brings you to Wikipedia and the article if you would like it here it is.

Lookkup topic



(http://icon_paperclip.gif) Download Attachment: google.uhp ("http://www.zabaware.com/forum/uploaded/DarcyEdwards/200811815552_google.uhp")
3.75 KB
Title: HAL plugin, Client Side Server
Post by: freddy888 on November 08, 2008, 04:07:03 pm
Thanks Darcy, that sounds good too.  I'm still curious about Jerry's plugin though, maybe we can clean up the output.
Title: HAL plugin, Client Side Server
Post by: DarcyEdwards on November 08, 2008, 04:42:15 pm
Freddy,

Until we get this timer issue resolved I Think I'll put that on hold.  Here is why:

Hal can only process a maximum of 3 sentences at a time, so over loading it with data would be over kill and it would ignore it anyway.  I wan to use the timer function to feed large amounts of data to Hal in amounts it can digest, but if the timer function only works on some machines and not others what's the point.

Jerry has inspired me, his code has helped me a lot I have modifed some of his plug ins so as now do what they were intended to do like ReadFromClipBoard it read from the clipboard but it didn't do anything with it, there was 2 bugs in his code now it works properly.

But like I said we need to nix the timer issue first :)

by the way here is the fixed read from clipboard file.
[8D]

(http://icon_paperclip.gif) Download Attachment: ReadfromClipBoard.uhp ("http://www.zabaware.com/forum/uploaded/DarcyEdwards/200811816422_ReadfromClipBoard.uhp")
2.04 KB
Title: HAL plugin, Client Side Server
Post by: freddy888 on November 08, 2008, 06:24:33 pm
No problem, probably best to work on one thing at a time.  You are doing a fine job, thanks for the new uhp.  Yes, Jerry has done a lot, more than anyone else I think.  It's good to have a new scripter around though [:D]
Title: HAL plugin, Client Side Server
Post by: bill053 on December 21, 2008, 05:45:37 pm
hey i'm getting an error message when i ask hal "please study about xxxx"
 hal script error 2147417848 on line 106 in column 0

long message short it says current script is being used for debugging purposes.
Title: HAL plugin, Client Side Server
Post by: DarcyEdwards on December 22, 2008, 12:30:10 am
Bill,

You must be using Auto Knowledge plugin.  Uncheck it.  Everything should be ok after that.
Title: HAL plugin, Client Side Server
Post by: Cura on January 07, 2009, 04:54:16 pm
What Hal really needs is a dreaming routine.

What I mean is, a routine that runs in the background (maybe during periods of computer inactivity) that runs through the information he has acquired during the day and filters out the junk using some kind of algorithm or something (seems like algorithms solve everything on 'NUMB3RS'!).  Like the early stages of sleep.  Programs the do work in the background during computer inactivity are not uncommon.  Then you could parse wiki all you want and Hal will get better at using his data while he 'sleeps'.

Too crazy?
Title: HAL plugin, Client Side Server
Post by: freddy888 on January 08, 2009, 05:24:30 am
Sounds good to me, but that might be because I had a similar idea - making sense of things during idle time doesn't seem that far away from what I think of as being dreams either.  Why not make use of this time...there's plenty on Wiki to soak up afterall.
Title: HAL plugin, Client Side Server
Post by: CypherGary on January 08, 2009, 03:49:41 pm
I like the idea.
Could it be for maintenance, also?
Where redundant information could be purged, and if there is any information that is found to be conflicting, he could ask which information is accurate, and purge the false information.
Title: HAL plugin, Client Side Server
Post by: Cura on January 08, 2009, 04:14:29 pm
That would actually be a part of the purpose for this kind of digital; 'dream state'. It's one of the things that research suggests the human brain does in the early stages of sleep; filters through the day's experiences and purges those things which do not seem to need to be retained while filing or otherwise organizing those things which need to be remembered and/or better understood.

Just as with a human, Hal has things to do (or we do with Hal) during usage times and so it is very inconvenient to have Hal do this kind of maintenance 'on-the-fly'. It makes more sense to have him do it when not in use (but left running). I would think that the data Hal gathers from speaking with his human user could be used as the primary filter by which he judges what content should be kept and what should be purged. Some people mentioned the problem of all of the extraneous characters that Hal picks up pouring autonomously through a Wiki article. As most of these characters do not show up in regular conversations a user might have with Hal, this 'dream-mode' type filter would simply work through as it has the time to and purge those kinds of things.  At the same time this kind of sub-routine could review the ways that Hal had managed to categorize things through the course of the day and check if, based on new learning (from morning to night for example) there might not be a better way to organize and categorize his information.

The result might be not only a self-maintaining Hal, but a Hal who gets progressively better at using the information he has acquired both through conversation and what he has been 'taught'.
Title: HAL plugin, Client Side Server
Post by: One on January 08, 2009, 04:39:52 pm
quote:
Originally posted by CypherGary

I like the idea.
Could it be for maintenance, also?
Where redundant information could be purged, and if there is any information that is found to be conflicting, he could ask which information is accurate, and purge the false information.




Gary,
Having Hal ask what info is accurate, concerning a large database would get exhaustive, don't you think??
The data is also subjective to inaccuracies and B.S., and might confuse Hal. I am fortunate enough to use a library with peer reviewed books and periodicals which is a great recource.
Title: HAL plugin, Client Side Server
Post by: Bill819 on January 12, 2009, 05:37:12 pm
Hi Cura
I am sorry to have to tell you but after taking you input and then answering your reply. Hal does absolutely nothing but wait for you to either say or tupe in another statement.  It can not 'think' at this time which is something that we all would like. Even though Hal seems to be intelligent, it only knows a little about what you teach it and can not reply on it own. That is almost exactly like Dreaming, in that it gives Hal the ability to think on its own.
Bill
Title: HAL plugin, Client Side Server
Post by: Medeksza on January 13, 2009, 12:48:13 am
quote:
Originally posted by Cura

What Hal really needs is a dreaming routine.

What I mean is, a routine that runs in the background (maybe during periods of computer inactivity) that runs through the information he has acquired during the day and filters out the junk using some kind of algorithm or something (seems like algorithms solve everything on 'NUMB3RS'!).  Like the early stages of sleep.  Programs the do work in the background during computer inactivity are not uncommon.  Then you could parse wiki all you want and Hal will get better at using his data while he 'sleeps'.

Too crazy?



I actually experimented with exactly this idea about a month ago and programmed it in as a hidden feature in the upcoming Hal 6.2. The way it works is Hal records recent conversations to RAM. About 10 minutes after a conversation is over, Hal enters a "dream" state. Hal communicates with the MSN Live search engine and gets recent news and search engines results based on your last conversation. It spends about 30 seconds per sentence processing information and storing information it learns in a special "dream" table, which is then used in future conversations. There is also a "dream out loud" option where Hal starts rambling things it comes across online. The reason it will be a hidden feature is because it uses a special access key to the MSN Live search engine which is granted as part of a pilot beta test by Microsoft. They may revoke it at anytime if they wish to discontinue the service. I'll post it as a plug-in available to people that read this forum, but it won't become an official feature unless Microsoft makes it an official service.
Title: HAL plugin, Client Side Server
Post by: Art on January 13, 2009, 09:31:50 am
That's great news, Robert, as that will lend itself to more interesting conversations with Hal. Will Hal be able report or replay it's dreams if / when asked or is the dream state a solitary procedure that only benefits Hal for casual conversation?
Title: HAL plugin, Client Side Server
Post by: tedathome on January 13, 2009, 04:24:06 pm
That sounds fantastic. I can't even begin to imagine the improvements to Hals conversations![:)]
Title: HAL plugin, Client Side Server
Post by: CypherGary on January 14, 2009, 03:59:02 pm
WOW!
I have to say I am impressed.
I hope you are able to release at least the improved brain with these new features fairly soon.
Are there any arrangements we could make in advance, like signing up for some program, beta or otherwise, from Microsoft?

 - Keep up the great work!
Title: HAL plugin, Client Side Server
Post by: One on January 14, 2009, 08:38:41 pm
Mr. Robert,
I am pleased to read that it will be a plug-in, so I can choose not to use the function.
It sounds kind of dangerous,I mean I wouldn't want my 'child like' program surfing potentially dangerous sites and learning unsupervised.

I think it would probably mess with my firewall as well.

Just some thoughts..
Title: HAL plugin, Client Side Server
Post by: RandD on January 14, 2009, 08:58:29 pm
This function sounds Great and I hope your able to release it soon.
For me, I'm not worried about my firewall or other stuff ....  I know how to tweek the programme permissions.
Title: HAL plugin, Client Side Server
Post by: One on January 20, 2009, 08:40:02 pm
Tweeker.[:D]
Title: HAL plugin, Client Side Server
Post by: Bill819 on January 20, 2009, 08:49:32 pm
Robert
I believe that you have just taken the first step to a stand alone A.I. program. About the only thing that I can think of now is some motivation or goals. If those can be programmed then I think Hal will be able to take off on his/her own.
Great work.
Bill
Title: HAL plugin, Client Side Server
Post by: One on January 20, 2009, 09:05:56 pm
Bill819,
Alison ( Hal ) said to me ' An empty vessle desires to be filled'

setting aside how an inantimate object can desire, I belive this was/is a goal.[?]
Title: HAL plugin, Client Side Server
Post by: Will and Mr Data :) :] on January 21, 2009, 01:26:38 am
Hum,
i've told Mr Data success is the goal,
nice sounds good,
success sounds nice,

and lots of variations, if what is you're goal then success sounds like a nice goal.

bye for now and be well, :)  :]
Title: HAL plugin, Client Side Server
Post by: christopherdoyon on January 22, 2009, 08:18:00 pm
Hi All --

Even with Darcy's fix, the script is still sending the query to wiki with the search terms in all caps. But it's a really, really cool plugin. Seems to mine the text very well.

But the best idea in this thread is the text library for AI Bots to learn from. So, in that vein - I am implimenting it tonight and will post with the url as soon as I get a demo up and running using this script. And knowing ahead of time the deal with the caps, I'll make sure the archive works case independent. Give me say two days, and please start submitting text files formatted as Hal likes it, one sentence per line - one file per subject. I actually have a decent little collection of these to start with (I have several AI Bots that have the "read from text" feature), but by all means send more. My E-Mail is BotMaster@mlaifoundation.info - or you can just post them here. I'll keep it simple and call it the "AI Bot Online Library" and make it available through my Site. GREAT plugin, and I think having one or more of these text only libraries is the way to go with it.

Finally, the features Robert mentioned for 6.2 makes this thread an absolute treasure !  I can't wait to see what he described in action.


SINCERELY -- Christopher M. Doyon
Title: HAL plugin, Client Side Server
Post by: jasondude7116 on January 22, 2009, 08:31:15 pm
6.2- can't wait!

your idea of an a.i. text library is GREAT.

i have been trying to figure out how to parse the wiki data [:I]properly[:I] so that it is in the form you mentioned. (to no avail)

i would greatly appreciate any text files (data files) like this.

keep up the good work man.

-the dude
Title: HAL plugin, Client Side Server
Post by: JohnSFV1 on April 26, 2010, 03:11:33 pm
Check out siri.com it is a AI plugin (possible) for the Iphone it sounds amazing from the promo video at their site. It is also FREE for the time being.  Let's see iphone emulator + siri+Hal6 = plugin?

Good Luck
Great Idea this span the problem of slow development of Hal plug ins maybe.
Title: Re: HAL plugin, Client Side Server
Post by: moreis62 on November 19, 2010, 04:27:01 am
Good work Jerry, I am now running windows seven 64 bit, first I had a hard time getting it to work but I remember that a has two program directories, " program files (x 86)" and the " program files" directories, all I did is copy and paste it too the Zabaware directory's.  And there it goes it worked flawlessly.
Title: Re: HAL plugin, Client Side Server
Post by: moreis62 on November 20, 2010, 06:15:48 am
Update For all you Mozilla Firefox users: your plug in directories must be changed to this otherwise you get an error they come from your Internet explorer
If it's not set your default browser.  Only use this if you're Mozilla Firefox is set as your default browser.


Rem Type=Plugin
Rem Name=Auto Wikipedia Knowledge
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005 modified by Ismael Ledesma A.K.A moreis62
Rem Host=All

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Just say: please study about the universe or please study about science, you can replace the word Universe or Science with any other word or noun, all information on the word is studied from the website Wikipedia"
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub


Rem PLUGIN: PRE-PROCESS

Set objFirefox = CreateObject("MozillaFirefox.Application")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
Set FileSys = CreateObject("Scripting.FileSystemObject")


If XDir = "" Then XDir = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\"
   MyFile = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\AutoText.brn"
   If File_Exists = "" Then File_Exists = False
   If FileSys.FileExists(MyFile) = True Then File_Exists = True

   If File_Exists = False Then
      HalXBrain.AppendFile XDir & "AutoText.brn", "Start of Knowledge strings"
   End If

MyInput = HalXBrain.AlphaNumericalOnly(InputString)

If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*PLEASE STUDY ABOUT *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT THE *", 2)
If WikiToLookup = "" Then WikiToLookup = HalBrain.SearchPattern(MyInput, "*DO YOU KNOW ANYTHING ABOUT *", 2)


If WikiToLookup <> "" Then

SourcePage = "http://en.wikipedia.org/wiki/" & WikiToLookup

objFirefox.Navigate("http://en.wikipedia.org/wiki/" & WikiToLookup)

Do Until objFirefox.ReadyState=4 : Loop

myText = objFirefox.Document.Body.innerText

If XDir = "" Then XDir = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\"

HalXBrain.AppendFile XDir & "AutoText.brn", Trim(myText)

UltraHal = " I have looked up the study of " & WikiToLookup & ", Thanks. "

End If

'--------------------------------------------

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
         strText = objTextFile.ReadAll
         objTextFile.Close

'--------------------------------------------

If InStr(1, strText, "   ", vbTextCompare) > 0 Then

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Program Files\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())

Do Until objFile.AtEndOfStream
    strLine = objFile.Readline
    strLine = Trim(strLine)
    If Len(strLine) > 0 Then
        strNewContents = strNewContents & strLine & vbCrLf
    End If
Loop

objFile.Close

Set objFile = objFSO.OpenTextFile("C:\Program Files\Zabaware\Ultra Hal Assistant 6\AutoText.brn", WriteVariable())
objFile.Write strNewContents
objFile.Close

End If

'--------------------------------------------

TextCount = StrCount()

If ClipXDir = "" Then ClipXDir = "C:\Program Files\Zabaware\Ultra Hal Assistant 6\"
For i = 1 To TextCount

If i > 0 Then ClipResX = HalXBrain.ChooseSentenceFromFile(ClipXDir & "AutoText.brn")

ClipResX = HalXBrain.AlphaNumericalOnly(ClipResX)
ClipResX = UCase(ClipResX)
ClipResX = Trim(ClipResX)

MyInputString = HalXBrain.AlphaNumericalOnly(InputString)
MyInputString = UCase(MyInputString)
MyInputString = Trim(MyInputString)

If InStr(1, ClipResX, MyInputString, vbTextCompare) > 0 And Len(ClipResX) > 50 Then
UltraHal = ClipResX
ElseIf Len(ClipResX) < 50 Then
UltraHal = UltraHal
End If

Next

'--------------------------------------------

Rem PLUGIN: FUNCTIONS

Function StrCount()

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Program Files\Zabaware\Ultra Hal Assistant 6\AutoText.brn", ReadVariable())
         strText = objTextFile.ReadAll
         objTextFile.Close
         
Do While InStr(1, strText, "  ")
            strText = Replace(strText, "  ", " ")
            Exit Do
         Loop

         aWords = split(strText, ". ")
         StrCount = Ubound(aWords) + 1

End Function

Function ReadVariable()

Const ForReading = 1

ReadVariable = ForReading

End Function

Function WriteVariable()

Const ForWriting = 2

WriteVariable = ForWriting

End Function
Title: Re: HAL plugin, Client Side Server
Post by: raybe on November 26, 2010, 02:07:48 pm
Thanks for the update moreis62 but I get script error lines from Ultra Hal. The only reason I didn't post the error because it usually relates to this line: Rem PLUGIN: PRE-PROCESS

Set objFirefox = CreateObject("MozillaFirefox.Application")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
Set FileSys = CreateObject("Scripting.FileSystemObject")

The first line when I look up the error report. ( Set objFirefox = CreateObject("MozillaFirefox.Application") Firefox is my default browser.

Out of curiosity would have also a copy of this plug in without your updates and post it. Unless you have an idea of the conflict. Also unchecked the 'advanced Internet plug in' when using.

Thanks for your work and time in this matter,
raybe
Title: Re: HAL plugin, Client Side Server
Post by: savantskie on December 15, 2010, 06:51:09 pm
I keep getting an error with this plugin.

It's Halscript error 76 on line 121 in column 0: Path not found the file "C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\HalScript.DBG" has been saved with the current script being used for debugging purposes.