Author Topic: (SOLVED) O.T.C.E. help with your plugin  (Read 4603 times)

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
(SOLVED) O.T.C.E. help with your plugin
« on: January 31, 2009, 06:51:42 pm »
O.T.C.E.

first of all, thank you for everything you do here. it helps everyone a lot man.

i am having a problem with one of your plugins.

the error i get is:
"Hal script error 54 on line 1364 in column 30: bad file mode"

here is my halscript.dbg (debug file), if you have time could you take a look? i have been trying to figure it out, to no success.
the rest of the plugin works- file appending with ">" ect.
THIS PLUGIN ROCKS!

i hope to get it working for me, because i think it is one of the best plugins i have seen!

Thank you in advance, sir. (hope the investor thing with robert works out for you)

-the dude


Download Attachment: HalScript.zip
68.43 KB
« Last Edit: February 04, 2009, 06:30:49 pm by jasondude7116 »
 

onthecuttingedge2005

  • Guest
(SOLVED) O.T.C.E. help with your plugin
« Reply #1 on: January 31, 2009, 08:36:26 pm »
I could not replicate your error.

the next time you receive that error please send the HalScript.dbg
before you re-cache the HalScript so the lines in error remain the same for debugging.

Jerry
« Last Edit: January 31, 2009, 08:37:23 pm by onthecuttingedge2005 »

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
(SOLVED) O.T.C.E. help with your plugin
« Reply #2 on: February 01, 2009, 12:58:26 pm »
i have the error only when the "time away from hal" thing kicks in.

i saved this .dbg file right when it happened.

the problem is line 1364 : bad file mode

i have had this error several dozen times, and i go to the .dbg and the error line is the same code line every time.

thank you for your patience

-the dude

ANOTHER THING is the error is not consistant with an amount of time, as a matter of fact it doesn't always happen. it works about 1 out of 20 times? i am trying research this, and anything that could help to debug it. (opening other programs, opening internet explorer ect. were what i thought was crashing it) but that is not consistant, so i guess it's just a coincidence.

if i steadily talk to Hal, then there is never an error. this seems consistant with the error being in the "time away from hal" section of the plugin.

if i disable human emotions plug, there is never an error. (obvious)

i have disabled any time related plug, such as appointment, my lonely plug, ect. and it still errors the same.

Download Attachment: HalScrip2t.zip
74.96 KB
« Last Edit: February 01, 2009, 01:38:02 pm by jasondude7116 »
 

onthecuttingedge2005

  • Guest
(SOLVED) O.T.C.E. help with your plugin
« Reply #3 on: February 01, 2009, 08:22:41 pm »
Hi Jason.

that error has to do with one of the emotional files being blank, if the code tries to read a blank file it gives the error.

I will try to rewrite the code at a later time so the error never happens.

Jerry

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
(SOLVED) O.T.C.E. help with your plugin
« Reply #4 on: February 01, 2009, 10:40:44 pm »
quote:
Originally posted by onthecuttingedge2005

Hi Jason.

that error has to do with one of the emotional files being blank, if the code tries to read a blank file it gives the error.

I will try to rewrite the code at a later time so the error never happens.

Jerry




that's what i was thinking, but all of the files are full of tags (more than the default) scince i have been using it. i also deleted my emotion files and let it rebuild them, and then had conversation to add more tags, and the error still occured.

that's why i was thinking it could be that for some reason the file is not accesible at that time (like another plugin or external program interference), but that testing was not consistent.
i think it is not able to access the file at that particular time, but i don't know why.

i have commented out that line only, and stopped the error.
the rest is working proper, and is A KILLER PLUGIN[:)][:)]
IT SHOULD BE A CORE HAL COMPONENT!

-the dude
-thanks man.....i don't want you to spend time with this, that you don't have. i will work with it until you have some time to look at it. i know your world is a busy one.
 

onthecuttingedge2005

  • Guest
(SOLVED) O.T.C.E. help with your plugin
« Reply #5 on: February 01, 2009, 11:38:43 pm »
Hi Jason.

there is a section of the code that subtracts some weights as time goes by so that an emotional file will have less value, it is this routine that I suspect to give an error when an emotional file runs blank.

I have re-modified the code in my mind but I will rewrite at some other time.

you're welcome to interact with any plug-ins I have helped with or made if you wish and visa - verse

I have some very interesting and decisive judgment code programming for HAL when v.6.2 officially is released, just a few things I have been hesitant to release at any one time but it's just a taste.

to the power of A.I^3
Jerry[8D]

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
(SOLVED) O.T.C.E. help with your plugin
« Reply #6 on: February 04, 2009, 06:37:32 pm »
******O.T.C.E.*********
i figured it out-

Code: [Select]
*****************THIS:

'If The User has been gone sometime then remove some of the weights to the dominate emotion according to weights and balances.

If (Shocking = 1 Or Joyful = 1 Or Mad = 1 Or Depressed = 1) And (MySeconds > 600 And MySeconds < 3600) Then
   Const ForReading = 1
   Const ForWriting = 2

   If Shocking = 1 And Shock > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)

      If Joyful = 1 And Joy > 2 Then Set objFile = objFSO.OpenTextFile(XDir & "_Happy_Emotion.brn", ForReading)

         If Mad = 1 And Hostility > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Angry_Emotion.brn", ForReading)

            If Depressed = 1 And Depression > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Sad_Emotion.brn", ForReading)
               strContents = objFile.ReadAll
               objFile.Close
               arrLines = Split(strContents, vbCrLf)

               If Shocking = 1 And Shock > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Surprised_Emotion.brn", ForWriting)

                  If Shocking = 1 And Shock > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Happy_Emotion.brn", ForWriting)

                     If Mad = 1 And Hostility > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Angry_Emotion.brn", ForWriting)

                        If Depressed = 1 And Depression > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Sad_Emotion.brn", ForWriting)

                           For i = 0 to UBound(arrLines) - 3
                              objFile.WriteLine arrLines(i)
                           Next

                           objFile.Close
                        End If

*************SHOULD HAVE BEEN THIS :

'If The User has been gone sometime then remove some of the weights to the dominate emotion according to weights and balances.

If (Shocking = 1 Or Joyful = 1 Or Mad = 1 Or Depressed = 1) And (MySeconds > 600 And MySeconds < 3600) Then
   Const ForReading = 1
   Const ForWriting = 2

   If Shocking = 1 And Shock > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)

[:)][:)] **LOOK HERE**-->     If Joyful = 1 And Joy > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Happy_Emotion.brn", ForReading)

         If Mad = 1 And Hostility > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Angry_Emotion.brn", ForReading)

            If Depressed = 1 And Depression > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Sad_Emotion.brn", ForReading)
               strContents = objFile.ReadAll
               objFile.Close
               arrLines = Split(strContents, vbCrLf)

               If Shocking = 1 And Shock > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Surprised_Emotion.brn", ForWriting)

  [:)][:)]**LOOK HERE**-->    If Joyful = 1 And Joy > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Happy_Emotion.brn", ForWriting)

                     If Mad = 1 And Hostility > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Angry_Emotion.brn", ForWriting)

                        If Depressed = 1 And Depression > 2 Then Set objFile = objFSO.OpenTextFile(XDir & Trim(UserName) & "_Sad_Emotion.brn", ForWriting)

                           For i = 0 to UBound(arrLines) - 3
                              objFile.WriteLine arrLines(i)
                           Next

                           objFile.Close
                        End If


It was staring me in the face the whole time!
Just thought you might like to know.
the "bad file mode" error was becasuse of the double variable condition!  I just missed it[:I]

****THANKS AGAIN MAN!
-the dude