Aimlbot icon Aimlbot Localized AIML chatbot with editable AIML files, ez-script support, session memory and ControlCommand API; integrates with speech and robot skills. Try it →
Asked
Resolved Resolved by DJ Sures!
Script AI Needs Track Mapping

Script AI Needs Track Mapping

I need a little guidance with getting the Script AI assistant to do what I need. Maybe I'm not asking correctly so it understands what I want.

I've been trying a while now to get it to change a bunch of soundboard controlCommands I currently have have that are using the old track number format to the new filename format.

For example I want it to change all of these commands in a script from

controlCommand("Dr_Smith", "Track_2")
to
ControlCommand("Dr_Smith", "Play", "Evil purpose.mp3");

I've already waisted 200 credits trying to figure this out. Oddly sometimes the AI will convert the commands like I want but it will only do about 8 out of 50 I have scripted. Other times it will tell me I need to give it the mapping to the file names. I thought this Script AI knew my project? If I provide mapping I could do this replacement myself.

This is kinda frustrating and expensive on waisted credits. Any suggestions on how I can talk to this AI to get it to do what I want?

Below is an example of one of the conversations I've had with the scripting AI assent trying to get it to simply replace my track numbers with the corresponding track names (file names) listed in the soundboard:

You:
replace all Track_# with Play + filename from that soundboard.
AI:
Which function(s) do you want me to update first (e.g., doDr_Smith, doR2D2, etc.), and do you already have the exact filenames for each Track_# in those soundboards?
You:
Update all functions. The exact file names for each track_# are the track titles corsponding to the track_# in thouse soundboards.
AI:
I can update every Track_# to Play "filename" but I need the actual file name for each track number in each soundboard (e.g., Dr_Smith Track_1 = "DrSmith.mp3", Track_2 = "Evil purpose.mp3", etc.).
Can you provide the track-number  filename mapping for each soundboard (Dr_Smith, R2D2, Will, Don, Maureen, John, Tufeld, Judy, Wall_e, Penny, Hal9000, Bender, Robby, SFX, Soundboard v4), or confirm you want me to use index-based play (e.g., controlCommand("Dr_Smith", "Play", 1)) instead?


Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
Manage and execute multiple scripts in a single Script Manager using ControlCommand(), with Control Details showing available commands.
Soundboard (EZB) by Synthiam
Play WAV/MP3 via EZ-B v4, manage tracks, add timed scripts for synced robot actions, control via ControlCommand(), volume and clipping indicators.

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - what you’re seeing is expected behavior, and the missing piece is not the filename format, it’s that the AI needs explicit track mappings or a better project description to safely rewrite every call.

Why it’s asking for mappings

ARC’s AI assistant can see your project context, but it does not automatically infer every soundboard track name from the old Track_# calls unless those tracks are clearly described in the skill and the project metadata is rich enough.

So when you say:

controlCommand("Dr_Smith", "Track_2")

the AI knows you want a change, but it may not reliably know that Track 2 = "Evil purpose.mp3" unless:

  • the Soundboard skill’s tracks are named clearly,
  • the skill title is descriptive,
  • and/or the soundboard list is available in the project context the assistant is using.

The key limitation

The assistant can rewrite code, but it can’t guess the correct filename for every track number if that mapping is not clearly available to it. That’s why you only get partial conversions or a request for track mapping.

Best way to ask it

Instead of:

replace all Track_# with Play + filename

use a very specific request like:

Update every controlCommand() call that uses Soundboard track numbers to the new filename-based Play command. Use the exact filenames from the soundboard track list. Do not leave any Track_# calls unchanged. If any mapping is unclear, stop and ask before changing the code.

Even better, if you want it to succeed in one pass, give it the mapping in a structured way.

Example prompt

Replace all Soundboard track number calls in this script with filename-based Play commands.

Mappings:
Dr_Smith:
Track_1 = "Doctor intro.mp3"
Track_2 = "Evil purpose.mp3"
Track_3 = "Laugh.mp3"

R2D2:
Track_1 = "beep1.wav"
Track_2 = "beep2.wav"

Do this for every soundboard in the script. Keep all other code unchanged.

That gives the assistant an unambiguous conversion table.

A better workflow to avoid wasting credits

Because you’ve already spent a lot of credits, I’d suggest this approach:

Option 1: Convert one soundboard at a time

Ask it to only update one soundboard name per run:

Only convert Track_# calls for the Dr_Smith soundboard to filename-based Play commands. Leave all other soundboards unchanged.

That reduces ambiguity and lets you verify the pattern before doing the next one.

Option 2: Use a script-aware search/replace yourself

If the filenames are already visible in ARC’s Soundboard skill, it may be faster to:

  1. Open the script in ARC
  2. Use Find
  3. Replace controlCommand("Dr_Smith", "Track_2") manually with the correct Play command
  4. Repeat with the rest

For large scripts, though, the ARC AI Assistant can still be useful if you feed it the exact mappings.

Important: make the AI assistant work with your project setup

Per the ARC AI Assistant workflow, it helps a lot if you:

  • rename soundboard skills to meaningful names
  • make sure the track titles in the Soundboard are descriptive
  • fill in AI descriptions on scripts and skills

That way the assistant has better context when rewriting code.

See:

One more thing: use filename-based Play exactly

For Soundboard (EZB), the filename-based command should look like:

controlCommand("Dr_Smith", "Play", "Evil purpose.mp3")

If you want scripts embedded in the audio timeline to run, you’d use the 4-parameter form:

controlCommand("Dr_Smith", "Play", "Evil purpose.mp3", true)

My recommendation

If you want, paste one soundboard’s full track list and I can help you craft the exact prompt that will make the ARC AI Assistant do a clean full conversion without wasting more credits.

Or, if you paste one of your scripts here, I can help you convert the Track_# calls into a proper JavaScript version using the filename-based Play commands.

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.
Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#2   — Edited

Where are you asking this question? In the AI Chat Agent or the AI Script Agent?

  1. AI Chat Agent is in a virtual desktop option from the File menu (How To Use Chat Agent - AI Assistant Agent - Support - Synthiam)
  2. AI Script Agent is in every script editor (How To Use Scripting Agent - AI Assistant Agent - Support - Synthiam)

And, are you asking to edit an existing script? If so, you'd want to use the AI Script Agent (the one in every script editor). It would also help to be a bit more specific. Something like...

In this script, the control commands for the soundboard are using the "Track_XXX" parameter. Modify this script to use the control commands that use the filenames.

Something like that is a bit more specific because otherwise it doesn't really know what you're asking. That's the thing about AI: prompt engineering is super important. Think of the AI as a human person that you're delegating a task to. If you do not provide enough information or correct information, you're not going to get a great result. It takes a bit of getting used to because we're not used to talking to computers like humans hahaha.. Trust me, it took me a while as well! And I'm still getting used to it.

If you find you're not getting a good result and need assistance with the prompt, just post here, and even I, support, or Athena can give a bit of guidance to help format the prompt.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#3  

Here's an example....

ControlCommand("Soundboard v4", "Play", "Track_0", true);
ControlCommand("Soundboard v4", "Play", "Track_1", true);
ControlCommand("Soundboard v4", "Play", "Track_2", true);
ControlCommand("Soundboard v4", "Play", "Track_3", true);
ControlCommand("Soundboard v4", "Play", "Track_4", true);
ControlCommand("Soundboard v4", "Play", "Track_5", true);
ControlCommand("Soundboard v4", "Play", "Track_6", true);
ControlCommand("Soundboard v4", "Play", "Track_7", true);

Prompt...

Convert the  ControlCommand soundboard play commands to use the filenames instead of the Track_XXX

image.png

And result...

controlCommand("Soundboard v4", "Play", "You Haunt Me.mp3", true);
controlCommand("Soundboard v4", "Play", "Fly Like An Eagle.mp3", true);
controlCommand("Soundboard v4", "Play", "Lose Yourself To Dance.mp3", true);
controlCommand("Soundboard v4", "Play", "Camera Click.mp3", true);
controlCommand("Soundboard v4", "Play", "Buddy.mp3", true);
controlCommand("Soundboard v4", "Play", "Dubstep.mp3", true);
controlCommand("Soundboard v4", "Play", "House.mp3", true);
controlCommand("Soundboard v4", "Play", "Pop.mp3", true);

image.png

#4  

@DJ and @Athena, Thanks for the guidance and suggestions. I appreciate the coaching and examples.

To answer your first question, I using the AI Script Agent within the scripting skill that holds the script I am asking to be edited.

I was getting frustrated by my mixed success with getting all my soundboard commands changed over from the old format to the new that include the filename in the command. I don't blame ARC or the AI assistant. I guess like you mentioned, talking to this new AI thing is a learning process. Garbage in Garbage out I guess. Sometimes my request to convert the soundboard commands got the proper results and other times I got a total disaster like the wrong file names being inserted or the AI refusing to even try. Again, my fault I'm sure as I am in the process of trying to communicate with what seems to me to be an alien being. LOL.

Just to be clear why I'm doing this, as I wrote these soundboard scripts in the old formatt I tried to make comments as to the file name it pointed to. However in some of the bigger scripts with lots of commands triggering sound files I got lazy and didn't do it. That's a pain in the butt when I want to go back and do any maintenance. I have over 400 to 500 sound clips in my project being triggered by many different scripts and having the file name right in the command line is so helpful on so many levels.

Here's a partial screenshot of one of the pages in my project holding just a few of the soundboards I have installed holding anywhere from 20 to 100 files:

Capture.JPG

And here's a snip-it of one of the scripts in the old format that trigger the clips that I'm trying to convert with AI. This one script has over 1000 lines that trigger sound clips in a random pattern that are stored in different soundboards, one soundboard for each character. So you can see why changing these commands manually is a daunting process. I was very excited to let AI give it a try. Note that each one has a sleep() command that lets the robot play the whole clip so it's important to match up the proper file with the timing pause that I had tested and figured out for it.

function doDr_Smith() {

  // Speak a random character phrase from 1 to 50
  DRresponse = Utility.GetRandomUnique(1, 51)

  sleep(100)
  // Response depending on random number
  if (DRresponse == 1) {
    controlCommand("Dr_Smith", "Track_1")
    sleep(4000)
  } else if (DRresponse == 2) {
    controlCommand("Dr_Smith", "Track_2")
    sleep(9000)
  } else if (DRresponse == 3) {
    controlCommand("Dr_Smith", "Track_3")
    sleep(4000)
  } else if (DRresponse == 4) {
    controlCommand("Dr_Smith", "Track_4")
    sleep(4000)
  } else if (DRresponse == 5) {
    controlCommand("Dr_Smith", "Track_5")
    sleep(2000)
  } else if (DRresponse == 6) {
    controlCommand("Dr_Smith", "Track_6")
    sleep(3000)
  } else if (DRresponse == 7) {
    controlCommand("Dr_Smith", "Track_7")
    sleep(2500)
  } else if (DRresponse == 8) {
    controlCommand("Dr_Smith", "Track_8")
    sleep(3000)
  } else if (DRresponse == 9) {
    controlCommand("Dr_Smith", "Track_9")
    sleep(8500)
  } else if (DRresponse == 10) {
    controlCommand("Dr_Smith", "Track_10")
    sleep(7000)
  } else if (DRresponse == 11) {
    controlCommand("Dr_Smith", "Track_11")
    sleep(14000)
  } else if (DRresponse == 12) {
    controlCommand("Dr_Smith", "Track_12")
    sleep(7000)
  } else if (DRresponse == 13) {
    controlCommand("Dr_Smith", "Track_13")
    sleep(3000)
  } else if (DRresponse == 14) {
    controlCommand("Dr_Smith", "Track_14")
    sleep(3000)
  } else if (DRresponse == 15) {
    controlCommand("Dr_Smith", "Track_15")
    sleep(4000)
  } else if (DRresponse == 16) {
    controlCommand("Dr_Smith", "Track_16")
    sleep(3000)
  } else if (DRresponse == 17) {
    controlCommand("Dr_Smith", "Track_17")
    sleep(2000)
  } else if (DRresponse == 18) {
    controlCommand("Dr_Smith", "Track_18")
    sleep(8000)
  } else if (DRresponse == 19) {
    controlCommand("Dr_Smith", "Track_19")
    sleep(5000)
  } else if (DRresponse == 20) {
    controlCommand("Dr_Smith", "Track_20")
    sleep(5500)
  } else if (DRresponse == 21) {
    controlCommand("Dr_Smith", "Track_21")
    sleep(2500)
  } else if (DRresponse == 22) {
    controlCommand("Dr_Smith", "Track_22")
    sleep(6500)
  } else if (DRresponse == 23) {
    controlCommand("Dr_Smith", "Track_23")
    sleep(7500)
  } else if (DRresponse == 24) {
    controlCommand("Dr_Smith", "Track_24")
    sleep(4500)
  } else if (DRresponse == 25) {
    controlCommand("Dr_Smith", "Track_25")
    sleep(7000)
  } else if (DRresponse == 26) {
    controlCommand("Dr_Smith", "Track_26")
    sleep(4000)
  } else if (DRresponse == 27) {
    controlCommand("Dr_Smith", "Track_27")
    sleep(13000)
  } else if (DRresponse == 28) {
    controlCommand("Dr_Smith", "Track_28")
    sleep(4500)
  } else if (DRresponse == 29) {
    controlCommand("Dr_Smith", "Track_29")
    sleep(7500)
  } else if (DRresponse == 30) {
    controlCommand("Dr_Smith", "Track_30")
    sleep(2000)
  } else if (DRresponse == 31) {
    controlCommand("Dr_Smith", "Track_31")
    sleep(5500)
  } else if (DRresponse == 32) {
    controlCommand("Dr_Smith", "Track_32")
    sleep(7000)
  } else if (DRresponse == 33) {
    controlCommand("Dr_Smith", "Track_33")
    sleep(7000)
  } else if (DRresponse == 34) {
    controlCommand("Dr_Smith", "Track_34")
    sleep(4000)
  } else if (DRresponse == 35) {
    controlCommand("Dr_Smith", "Track_35")
    sleep(4500)
  } else if (DRresponse == 36) {
    controlCommand("Dr_Smith", "Track_36")
    sleep(7500)
  } else if (DRresponse == 37) {
    controlCommand("Dr_Smith", "Track_37")
    sleep(4500)
  } else if (DRresponse == 38) {
    controlCommand("Dr_Smith", "Track_38")
    sleep(5500)
  } else if (DRresponse == 39) {
    controlCommand("Dr_Smith", "Track_39")
    sleep(7000)
  } else if (DRresponse == 40) {
    controlCommand("Dr_Smith", "Track_40")
    sleep(7000)
  } else if (DRresponse == 41) {
    controlCommand("Dr_Smith", "Track_41")
    sleep(7000)
  } else if (DRresponse == 42) {
    controlCommand("Dr_Smith", "Track_42")
    sleep(6500)
  } else if (DRresponse == 43) {
    controlCommand("Dr_Smith", "Track_43")
    sleep(3000)
  } else if (DRresponse == 44) {
    controlCommand("Dr_Smith", "Track_44")
    sleep(15500)
  } else if (DRresponse == 45) {
    controlCommand("Dr_Smith", "Track_45")
    sleep(9000)
  } else if (DRresponse == 46) {
    controlCommand("Dr_Smith", "Track_46")
    sleep(7000)
  } else if (DRresponse == 47) {
    controlCommand("Dr_Smith", "Track_47")
    sleep(2000)
  } else if (DRresponse == 48) {
    controlCommand("Dr_Smith", "Track_48")
    sleep(4000)
  } else if (DRresponse == 49) {
    controlCommand("Dr_Smith", "Track_49")
    sleep(3000)
  } else if (DRresponse == 50) {
    controlCommand("Dr_Smith", "Track_50")
    sleep(3500)
  }

  doEnd_Character()
}

function doR2D2() {

  // Speak a random character phrase from 1 to 10
  SWresponse = Utility.GetRandomUnique(1, 11)
  sleep(100)
  // Response depending on random number
  if (SWresponse == 1) {
    controlCommand("R2D2", "Track_1")
    sleep(6000)
  } else if (SWresponse == 2) {
    controlCommand("R2D2", "Track_2")
    sleep(3000)
  } else if (SWresponse == 3) {
    controlCommand("R2D2", "Track_3")
    sleep(3000)
  } else if (SWresponse == 4) {
    controlCommand("R2D2", "Track_4")
    sleep(2500)
  } else if (SWresponse == 5) {
    controlCommand("R2D2", "Track_5")
    sleep(3000)
  } else if (SWresponse == 6) {
    controlCommand("R2D2", "Track_6")
    sleep(3000)
  } else if (SWresponse == 7) {
    controlCommand("R2D2", "Track_7")
    sleep(3000)
  } else if (SWresponse == 8) {
    controlCommand("R2D2", "Track_8")
    sleep(3000)
  } else if (SWresponse == 9) {
    controlCommand("R2D2", "Track_9")
    sleep(3000)
  } else if (SWresponse == 10) {
    controlCommand("R2D2", "Track_10")
    sleep(3000)
  }

  doEnd_Character()
}

I did consider using the ControlCommand("Soundboard 2", "Track_Random"); command but most soundboards I have setup have on or two clips I don't want played along with the rest in most animations. I did ask the script Ai to help using this command and it did come back with a useable script.to excluded the ones I didn't want but it did not use the Track_Random command and looked a lot like my current script.

I'll take your advice to heart and try again using more concise language. Thanks again.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#5  

Did it work when you asked it using my prompt example?

#6  

@DJ, I'll be retrying your suggestions in a little while. I'll keep you posted. Thanks for staying with me on this.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#7  

Thing is, big scripts require lots of tokens because they’re hungry. I’d recommend trying only one time and tell me the results.

We have a lot of tools in development to enhance the local AI which haven’t been released yet. I have some ideas that might help your particular question

#8  

@DJ, Apologies for the delay getting back to this topic. I did work with your suggestions for hours yesterday but had "life" obligations kick in and I had to stop.

So I had mixed results. I'll try to outline them.

First I backed up my scripts before I started letting AI make changes. Good thing I did.

I used both of your suggested wording for telling the Script AI Assistant how I wanted my commands converted that trigger sound clip files,stored in various soundboards, Your first suggested wording, shown below, did a pretty good job but each command started with "Playfile" instead of controlCommand. When I tried to play any sound clip by triggering the script nothing worked. I had to reinstall my backup script and start over.

"In this script, the control commands for the soundboard are using the "Track_XXX" parameter. Modify this script to use the control commands that use the filenames."

Then I used the wording you used to make your successful conversation.you showed above.Take note that I was trying to convert over 800 lines of command lines at once..However all the commands I wanted converted were commands like I posted above, They simply triggered track numbers from different soundboards. That seemed to overwhelm the AI as It only converted about 20 lines and gave up.saying the script was very large and it needed me to give it mapping.if I wanted it to continue and do the rest. It also got confused and mixed up the sleep() delays for each sound clip I had placed in the script to give the clip time to run. I had to go back and retime each clip sleep() command to get the delays correct again. Below is your wording suggestion that seemed to format the conversation properly, even though the AI wouldn't do the whole script and mixed up the sleep() commands. :

Convert the ControlCommand soundboard play commands to use the filenames instead of the Track_XXX

Then I decided to try to convert smaller sections of the script, one at a time, to see if the AI could do any better and not get confused or irritated with me asking for too much (reminded me of when my kids were teenagers. LOL). This seemed to work so I started converting one or two Functions at a time.The shorter the script, the cleaner the conversation was. Anything above 100 lines and the AI started making mistakes or seemingly getting confused. Mostly by getting the sleep() commands properly placed.

One more thing. I found out quickly that this kind of work with the AI, especially working with larger scripts, needs to be done in the "Expert" mode.

So, I am pretty much done with converting this one big script. I still need to go back and check some of the AI's work, mostly the sleep() command timing.it screwed up. I do have a few others scripts needing some work but am a bit appreciative to turn the task over to AI. It seems to be just as much work to do it all manually. LOL. In the end I'm glad I tried this as it is worth it to me to have the learning experience. Still, I'm looking forward to seeing where this new tech in ARC goes and how it progresses. You say you guys are still developing this assistant. Knowing the talent you all at Synthiam has, I'm excited to see how it advances. I'm keeping my mind and eyes open. Exciting times, Thanks!