Author Topic: Brain Plug-in gets 3 passes?  (Read 7706 times)

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Brain Plug-in gets 3 passes?
« Reply #15 on: April 22, 2008, 09:36:51 pm »
There ya go... I thought of that too, but it doesn't work because on each of the 3 passes, it's Ultra Hal running the code again like brand new, so none of the vars hold, as far as the "DO" statement is concerned, it thinks it's being run for the first time each time.  I believe saving a value to a table and using that in a "DO" statement would work, but I'd much rather know WHY it's happening so I can code to work with it.

I'm thinking now that it's a problem with HAL being unhappy with the variables that I'm sending it in this line...

  UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)

I only really need the "HalCommands" var for what I'm doing, but UltraHal expects all the vars or it won't work.  So what I think I need here is to set the values of all the other vars, hopefully to something that UltraHal will except but not feel a need to respond to, because again, that's what I'm going for, is one section of code that just gets executed without HAL doing anything.  And If this is even possible, I think it's something that the programmer of UltraHal would only know...

"What values will UltraHal except and know that it is to do nothing"

OR... another way to achieve the same results.

But... many, many thanks for the read, reply and help... I very much appreciate you taking the time!

Jake

« Last Edit: April 23, 2008, 03:43:48 am by Jake »
Austin, Texas, USA, Earth

onthecuttingedge2005

  • Guest
Brain Plug-in gets 3 passes?
« Reply #16 on: April 22, 2008, 10:43:35 pm »
Hi Jake.

there is the command "<NOMORE>" that is used in HAL's GetResponses.

GetResponse = " Testing " & "<NOMORE>"

which keeps HAL from adding an array of GetResponses on to a GetResponse

Jerry[8D]

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Brain Plug-in gets 3 passes?
« Reply #17 on: April 22, 2008, 10:47:49 pm »

Let me add it to the mix and see what happens.

Austin, Texas, USA, Earth

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Brain Plug-in gets 3 passes?
« Reply #18 on: April 22, 2008, 11:55:51 pm »
NOPE!  I can't seem to get that to work.  I can't come up with a line of code that it will except with just the "HalCommands and the <NOMORE>.

I tried something like this and a few other combos...

GetResponse = HalCommands & "<NOMORE>"

I'm thinking about sending Robert, (that is who is writing this... right?), an email and asking him.  For my purposes anyway and I think it would be great for the program and all the users to have a way to type something in to HAL that would run the piece of script only and only have HAL do ONLY what is in that piece of script, like nothing really happened as far as HAL is concern.  Here is the piece that I'm making right now that could really use a feature like that...

Basically I'm just making a couple dozen commands to do things like change the figure, change the hair, change the skin, change the position, etc, etc.  And I don't really want HAL to pay any attention to it, I just want to be able to send HAL some commands to carry out the changes from that piece of script without HAL knowing it.  Other slated projects would include similar adjustments on emotions, etc.

Jake
Austin, Texas, USA, Earth

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Brain Plug-in gets 3 passes?
« Reply #19 on: April 23, 2008, 03:21:39 am »
OK... I got it working by storing a SKIP value in a table, allowing the script to run for SKIP1, but doing an "Exit Function" for SKIP2 and SKIP3.

It works, but it sure is messy.

I'm holding out for a better possible answer from Robert.  I sent him an email tonight asking him to take a look at this thread if he had time and try to put me on the right path if there is one.

In case anyone is interested in the messy code, here it is...

Keep in mind that I edited the brain to put PLUGINAREA2 just below
the 1st Function line, the UltraHal Function that starts...
"Function UltraHal(ByVal InputString,"
So that my PLUGIN2 starts before anything happens.
Here's the section of my plugin that does the SKIP...



'------------------
Rem PLUGIN: PLUGINAREA2
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.
'------------------

'create skipit if needed-----------------------------------------------------
If HalBrain.TopicSearch("skipit", "ja1_vars") = "" Then
  HalBrain.ReadOnlyMode = false
  HalBrain.AddToTable "ja1_vars", "TopicSearch", "skipit", "skip1"
End If
-----------------------------------------------------------------------------


'skip code-------------------------------------------------------------------
HalBrain.ReadOnlyMode = false
ja1_skipit = HalBrain.TopicSearch("skipit", "ja1_vars")
'MsgBox "ja1_skipit = -" & ja1_skipit & "-"
'------------------
If ja1_skipit = "skip1" Then
  ja1_skipit = "skip2"
  HalBrain.ReadOnlyMode = false
  HalBrain.RunQuery "UPDATE ja1_vars SET topic = """ & ja1_skipit & """ WHERE searchString = 'skipit'", ja1_tempVal
  ja1_skipit = ""
End If
'------------------
If ja1_skipit = "skip2" Then
  ja1_skipit = "skip3"
  HalBrain.ReadOnlyMode = false
  HalBrain.RunQuery "UPDATE ja1_vars SET topic = """ & ja1_skipit & """ WHERE searchString = 'skipit'", ja1_tempVal
  ja1_skipit = ""
  Exit Function
End If
'------------------
If ja1_skipit = "skip3" Then
  ja1_skipit = "skip1"
  HalBrain.ReadOnlyMode = false
  HalBrain.RunQuery "UPDATE ja1_vars SET topic = """ & ja1_skipit & """ WHERE searchString = 'skipit'", ja1_tempVal
  ja1_skipit = ""
  Exit Function
End If
'----------------------------------------------------------------------------
Austin, Texas, USA, Earth

TechSteele

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Brain Plug-in gets 3 passes?
« Reply #20 on: April 23, 2008, 03:29:12 am »
Something looks odd, i am not sure exactly what.

First: HalCommands = HalCommands & "<HAPFILE>" & ja1_pathHead & ja1_pathHaps & ja1_file & "</HAPFILE>"  ?

Second: ja1_file = "hap_move_position3.hap"
HalCommands = "<HAPFILE>" & ja1_pathHead & ja1_pathHaps & ja1_file & "</HAPFILE>"

If you are useing the Second, (and if i read it right), your passing 3 variables through , but only one Variable is Defined.
I could be way off, but thats what i would check next.

And: <HAPTEXT>haptek_command</HAPTEXT>
     <HAPFILE>filename</HAPFILE>
     <HAPBACK>picture.jpg</HAPBACK>
are also available. (if you didnt see them)


*EDIT oops, you posted before i wrote this
« Last Edit: April 23, 2008, 03:30:47 am by TechSteele »
 

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Brain Plug-in gets 3 passes?
« Reply #21 on: April 23, 2008, 03:37:48 am »
TechSteele...

That's just the skip part of the plugin that keeps it from repeating 3 times and it's messy, but it works, now all the other code that I wrote below it is working perfectly, so even though I'm still looking for a better way, at least it works and I can get a whole 4 hours sleep tonight... O-Yeah!

Austin, Texas, USA, Earth