AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Variable number of arguments in an outputmacro
 
 

Hi All,

Just noticed that CS has moved to a new github repo!

In the process of moving and modernizing, I’ve noticed that all my variable-number-of-argument macros are now broken. i.e., this no longer works for me:

outputmacro: ^addButton variable ($_text $_responseText)

Attempting to build my bot raises a bunch of errors, most of them being:

CALL-60 Incorrect argument count to macro ^addButton- given 1 instead of required 2

 

 
  [ # 1 ]

compiles fine for me. Try erasing your TOPIC/BUILD1 folder and then recompiling

 

 
  [ # 2 ]

Thanks Bruce! I’m still getting the same issues.

Other strange errors as well:
- :build is telling me csboot is already defined (I only define it once)
- I also get errors for each responder or gambit (specifically: Bad topic flag u: for topic ~introductions). Each topic has a topic flag at the start…
- :build complains about having the incorrect number of arguments for functions defined with the ‘variable’ tag.

I have a feeling these are all hints for a different problem or error that is causing these to crop up. Does this sound like anything you’ve seen before?

 

 
  [ # 3 ]

does not ring any bells. Are you up to date on the latest CS release? Do you want to email me a zip of your project and have me try to build it and figure out what is wrong?

 

 
  [ # 4 ]

Thanks Bruce! I’ll PM you later today. In the meantime, I’ve kept digging, and here’s what I’ve found (all this is on Ubuntu 16.04 by the way)

- If I take a fresh clone of ChatScript and try “:build 0” I get these two errors:
  *** Error- line 1 of femalepeople.tbl:
CONCEPT-3 Concept/topic already defined ~designer

  *** Error- line 55 of femalepeople.tbl:
CONCEPT-3 Concept/topic already defined ~career

- When I fix these (by deleting femalepeople.tbl) and try :build 0, I run into a failed build 0 error:
Failed to find set ~restrictive_adverbs - POS tagger incomplete because build 0 not yet done.
Failed to find set ~restrictive_adverbs - POS tagger incomplete because build 0 not yet done.
Failed to find set ~quotableverbs - POS tagger incomplete because build 0 not yet done.
Failed to find set ~quotableverbs - POS tagger incomplete because build 0 not yet done.

Should I try recompiling from source on Linux?

 

 
  [ # 5 ]

OK! I think I got it. Here’s what ended up working for me:

- remove femalepeople.tbl from RAWDATA/WORLDDATA
- remove BUILD1 directory from TOPIC directory
- remove files0.txt from my project directory (contained all the common-level files, i put this here while trying to debug another issue)
- in my files<bot>.txt I had to list out each directory path I wanted to import, in order, so:

bot: 0
../system//
../global//

became:

bot: 0
../system/functions/
../system/
../global/bot-definitions/
../global/language-modules/
../global/off-topic-responders/
../global/patternmacros/
../global/

I believe the crux of the problem was ../system// was walking directories inwards (meaning, my systemcontrol.top was being read before ../system/functions/ was imported). Having a files0.txt in my project directory also didn’t do me any favors.

Thanks for your help Bruce!

 

 
  [ # 6 ]

So for build0, why would it matter the order of compilation of files?  Why should you have to remove femalepeople.tbl from the data.

 

 
  [ # 7 ]

I have not checked, but I could believe that if you access a macro before it is defined and the definition says variable, that things might mess up. So then you would have to be explicit in the order of insuring the function was declared first

 

 
  [ # 8 ]

Hi Bruce,

There’s definitely some interdependencies in the build 0 files, I suppose they need to be read in order (defined functions imported before importing code that uses those functions).

For femalepeople.tbl, I was running into this build error:
  *** Error- line 1 of femalepeople.tbl:
CONCEPT-3 Concept/topic already defined ~designer

  *** Error- line 55 of femalepeople.tbl:
CONCEPT-3 Concept/topic already defined ~career

Since I don’t use any of the definitions in femalepeople.tbl, I just removed the file.

 

 
  [ # 9 ]

For what it’s worth I had the same errors and adopted the same solution, but was not sure about the cause. Maybe a v9 bug? And likewise the Build 0 did not complete so a few things missing error although that one I think is older. Neither have affected functionality in a noticeable way.

 

 
  login or register to react