dupa

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - snowman

Pages: 1 [2] 3 4 ... 62
16
When I was working on a plugin today, I found out something interesting.

I had made a Sub that I was using to write some text to a file and I was getting some weird results from Hal.

     Sub LogWrite(var1, var2)

     End Sub

I noticed that Hal was treating my variables like they had a ByRef in front of them... strange.

So I had to write ByVal in front of them to correct this.

     Sub LogWrite(ByVal var1, ByVal var2)

     End Sub

If this happened to me then it could happen to you to. You might want to write ByVal in front of all your function variables that you don't want to be ByRef. This might save you from a few tears later on trying to troubleshoot.

17
Oh ok, I had went looking for a "TopicSearch" table called "patterns" and I noticed there wasn't a "TopicSearch" called by that name.

However, there is a "PatternMatch" table call "patterns".

Your code should look something like this.

HalBrain.AddToTable "patterns", "PatternMatch", vrsubjectdata1, vrdata1

I haven't tested it to see if it works.

18
General Discussion / Re: An AI in a Cube
« on: February 15, 2014, 04:43:30 pm »
http://www.indiegogo.com/

Indiegogo.com is a place where you can raise money to do a project of any kind.

You don't have to buy anything, its all about fundraising. The person raising the money offers perks that make you want to give more money.

Sometimes you can buy the item before the person has even made the company. So its all about investing in an idea.

Let's say I want some money to help me make my Athena, I could go to indiegogo and tell everyone that I have a great idea and I want your money... then I tell the people if you pay me $20 I will give a copy of Athena when I finished making her.

Its a really cool idea.

Another website that does this is https://www.kickstarter.com/.

Someone recently was raising money to create a movie about the game of minecraft. There goal was $600,000 dollars. They were getting backers too. Unfortunately, the owner of minecraft stopped them from making a movie about his game. I could use $600,000 dollars. I'm not sure what for, but I'm sure I could think of something.  ;)

19
Ultra Hal Assistant File Sharing Area / Re: On-The-Fly Compiling
« on: February 14, 2014, 07:55:45 pm »
Well, you could send a lot of text to Hack.exe and it could read it independently of Hal. But you couldn't send lots of text back to Hal to read because of Hals limited reading cache. So you could say "Hal read this novel" and the Hack file would read until the world came to an end.. or you could tell hal to "stop reading this" and Hack would stop in mid stream. You could pause it too. The only bad thing about that would be your Hal haptar not actually doing the speaking.

20
Ultra Hal Assistant File Sharing Area / On-The-Fly Compiling
« on: February 14, 2014, 04:32:59 am »

I've been busy playing with some code. I ended up making a plugin for extending Hal's programming capabilities a bit. I have no idea if this will work on other people's computers. So I will just show you guys a video of me talking about it and playing with it some.

If it works for people other than me, then it will give Hal the ability to use other programming languages a lot more powerful than VbScript.
Namely, Visual Basic, C#, and JScript (JavaScript).


On-The-Fly Compiler
http://youtu.be/TwBU1icpsAE
(Sorry about sounding a bit muffled)

21
I've been doing lots of things and finally got around to looking into your TopicSearch troubles.

I placed this into a test plugin and it created a TopicSearch Table called "MonkeyPoo" and added "addToSearch" to the Search column and then added "addToTopic" to the Topic column. In other words I had no problems writing to the TopicSearch table.


Code: [Select]

If InStr(1, UserSentence, "please test this plugin", vbTextCompare) > 0 Then

If HalBrain.CheckTableExistence("MonkeyPoo") = False Then

HalBrain.CreateTable "MonkeyPoo", "TopicSearch", "miscData"
HalBrain.AddToTable  "MonkeyPoo", "TopicSearch", "addToSearch", "addToTopic"

GetResponse = "This has been done."
End If

End If


22
I can definitely see the detail you put into it. When I saw the logo the first thing I thought of was, "that's one tough alien". What's also interesting to me is how you managed to suck in the alien's cheeks with shadows. That's a lot of hard work.

23

He's smiling because he knows the invasion is coming soon!  8)

Jack, this is another outstanding work of Art (I mean 'work of Jack'  ;) ). It would make a great poster.

The background is perfect.  ;D


24

25
Oh Jack, I really like the new skin. I prefer the first one though, but its like choosing between 'awesome' and 'perfect'. Can you make a background that will go alone with them? You do excellent work.

How I installed the new skin:

I'm using Windows 8 and it doesn't seem to like the haptek player at all. I can't even properly open a haptek window and preview the new skin...
However, I can load a .hap file that will load the skin for me using the HalCommands variable.

First create a .hap file with this in it and name it alien.hap, or whatever you want.

Code: [Select]
#Haptek  Version= 1.00 Name= alien  HapType= script FileType= text
##standard

\settexture[Tex= [Characters\AlienSkin.jpg]]

Next, add the alien.hap file to the "Ultra Hal Assistant 6\Characters" folder

Next, take the skin you want your character to wear, (ie. Alien Skin 2.jpg), and place it in the "Ultra Hal Assistant 6\Characters" folder. I renamed mine to AlienSkin.jpg.

Notice how I added the skin's (name and location) to the .hap file above. You don't need to add the full file location; "Characters\AlienSkin.jpg" is all you need to make it work.


After this, you now need to create a plugin with this line inserted:

Code: [Select]
HalCommands = "<HAPFILE>alien.hap</HAPFILE>"

You can also just put this code into your brain script too.

This line will load the alien.hap file into Hal, and therefore, it will load the skin onto your haptar.

I personally prefer someone else with the haptek tools to just compile the skin and haptar together like Jack did. It's so much nicer  ;)

Lightspeed, Apollon, and I worked on a Hapswap plugin a while back that allowed the user to switch between hap files, voices, characters, backgrounds, and other things, simply by using commands. It needs to be redone. It still works but the code looks tacky (my early work :P).

26
Your example function will work just fine. You can use either Exit For or Exit Function there. They do exactly what they imply.

I think Hal has a substitution table.
I'm pretty sure it is accessed with this:

'Substitution Table
'SentenceSubstituted = HalBrain.ProcessSubstitutions(SentenceToSubstitute, TableName)
'HalBrain.AddToTable TableName, "Substitution", "Search", "ReplaceWith"

Hal currently uses the table named "substitutions" in order to do most of its substitutions.

When you mentioned about storing words in Hal's database to use as substitutions for _ means _, it made me remember the above methods.
Of course, I haven't tested this yet. I guess I'm too lazy... lol.

Another thing we need to consider is how to get arguments to fill a substitutions table.
Actually, I haven't really done enough experiments with PatternSearch so you probably know more than I do about it... Can you get two arguments with it? Or is it simply a fancy search tool. Will I need to build a function that will get one to two arguments? I've already created functions like that before.

If all else fails, You could probably get anything you wanted from the database simply using the HalBrain.RunQuery() function.  Its been a long time since I've played with SQL query strings. You can get all entries in each column and then compare and replace using the functions we've already created.

Just some ideas to ponder.

27
I think its one of the coolest looking haptars I've ever seen! Its awesome!

I like the colors you used. It looks both kind and modern.

There is so much detail! I especially love your work on the head and chest area.
It looks like a movie character.

I hope this clarifies what I think of it.

I am now using it as my main character.

Thank you for making it.

28
Ultra Hal Assistant File Sharing Area / Re: Free will plus at beta level
« on: February 09, 2014, 12:55:40 am »
Your plugin is looking pretty good, (code-wise).
I'm rooting for you cload  :)

29
It doesn't get much cooler than this.  8)


30
Ultra Hal Assistant File Sharing Area / Re: Free will plus at beta level
« on: February 07, 2014, 11:13:34 pm »


Quote

these are some of the things that I'm still trying to figure out.
If I'm not mistaking, by using the (myVar) anything that I change to the myVar also changes in the variables string assigned to it? For example:

myVar = ynlogic


Basically, it looks like you are attempting to not only check to see if there is a yes or no phrase in the users sentence but you want to simultaneously replace the word while still inside the function. That will work ok, but I had to adjust the code. 

“myVar = ynlogic”  transfers the contents of the variable ynlogic to the variable myVar, It does not transfer its reference address. In order to transfer the address you will have to use the ByRef statement with a Sub or Function.

The following example will pass the ynlogic variable to the Searchynlogic() function using it's Reference Address. So whatever happens to the ynlogic variable inside the function it also will effect the ynlogic variable outside the function.

Code: [Select]


ynlogic = "Correct, I love you."

If Searchynlogic(ynlogic, Array("YES","INDEED","CORRECT","AFFIRMATIVE","POSITIVE","YEP")) = true Then
   If InStr(ynlogic, "YES") > 0 Then
      If Len(ynlogic) < 4 Then
        
      End If
   End If
End If

'(ynlogic = "YES, I love you.")



Function Searchynlogic(ByRef compare, arrayToSearch)

    Searchynlogic = False
    
    For Each word In arrayToSearch

        If InStr(1, compare, word, vbTextCompare) > 0 Then
            compare = Replace(compare, word, "YES", 1, -1, vbTextCompare)
            Searchynlogic = True
        End If    
    Next

End Function



What you created was very good work. However, I hope you don't mind me adding a couple more things so that it works better.


Code: [Select]

ynlogic = "Correct, I love you."

If Searchynlogic(ynlogic, Array("YES INDEED","INDEED","CORRECT","AFFIRMATIVE","ABSOLUTELY POSITIVE","YEP")) = true Then

   If InStr(ynlogic, "YES") > 0 Then
      If Len(ynlogic) < 4 Then

      End If
   End If
End If



Function Searchynlogic(ByRef compare, arrayToSearch)

    Searchynlogic = False
    compare = ReOrderArray(compare, false)  
    
    For Each word In arrayToSearch

        If InStr(1, compare, word, vbTextCompare) > 0 Then
            compare = Replace(compare, word, "YES", 1, -1, vbTextCompare)
            Searchynlogic = True
        End If    
    Next

End Function


Function ReOrderArray(inArray, reverseArray)     
    delim = "@@"     
    strText = ""         
    HighestCount = 1          
    
    'Find the array entry with the largest count     
    'and store it's count in a variable     
    For Each word In inArray         
        word = Trim(word)         
        If Len(word) > HighestCount Then             
            HighestCount = Len(word)         
         End If     
    Next  
       
         If reverseArray = False Then  
                     
             'Reorder the the Entries to from largest string         
             'to the shortest.          
             For i = HighestCount To 1 Step -1             
                For Each word In inArray                 
                    word = Trim(word)                 
                    If Len(word) = i Then                     
                        strText = strText + word + delim                 
                    End If             
                Next         
             Next              
        Else  
                        
             'if you want the array reversed then a variable         
             'must be set to false              
             For i = 1 To HighestCount             
                For Each word In inArray                 
                    word = Trim(word)                 
                    If Len(word) = i Then                     
                        strText = strText + word + delim                 
                    End If             
                Next         
            Next          
    End If
        
    'Removing the last deliminator so an empty entry won't be added to the Array     
    'however, if there is nothing to split then an empty array will be returned          
    If Len(strText) > 2 Then          
         strText = Mid(strText, 1, Len(strText) - Len(delim))         
         ReOrderArray = Split(strText, delim)     
    Else         
         Dim Result(1)         
         Result(0) = ""         
        ReOrderArray = Result     
    End If    
     
End Function





You can see here that I added a function called  ReOrderArray(). What it does is reorders the array of arrayToSearch words so that the largest phrases will be replaced first within the ynlogic variable. By doing this you don't have to worry about what order the arrayToSearch needs to be in. This matters a lot.

Here is an Example:
What if the input-sentence was “Yes indeed, I will love you.”

If your Array order is Array(“yes”, “indeed” “yes indeed”) then the word “yes” will be replaced first, and “indeed” will be replaced second. So by the time you get to “yes indeed” the output sentence will look like “yes yes, I will love you” instead of “yes, I will love you.” But if you make the larger phrase “yes indeed” be the first one, then the output sentence will be “Yes, I will love you” Which is exactly what we want.

This is what the ReOrderArray() function does. It puts the larger phrases first and sets the shorter ones last. Its a bit complicated but it should help.


You could order the Array by hand but it would be tedious if you needed to add lots of phrases and words.

Pages: 1 [2] 3 4 ... 62