Command to replace letters in query to "translate" into Al Bhed

Asked Jun 29, 2024·9 replies·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

The game Final Fantasy X has a fictional language called "Al Bhed" which is just a letter-swapped version of the english language. I think it would be fun if there was a command that could "translate" a user's input text into Al Bhed by replacing each letter of the query, and maybe another command to translate text from Al Bhed into English as well.

I thought that that this might have been something that somebody has done before, because Final Fantasy is pretty popular, but I can't find any such thing done using Nightbot. I did find some source code for a fancy program that translates both directions using JavaScript, but I'm not sure if it's possible to make this work with Nightbot. Has anybody ever done something like this?

9 replies

ooo, that sounds fun... it could go something like this...

js
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]});output)

for english to al bhed... and to go the other way...

js
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]});output)
Stellar Raccoon said:
$(eval let input=$(query).split(),e= AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz,a= YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw,output=;input.forEach(x=>{output+=a[e.indexOf(x)]});output)

This is absolutely perfect!!! Thank you so much this is gonna be super fun!!! 💛

um, actually... i found a bug in it with my own testing... here's a fixed version...

js
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]?a[e.indexOf(x)]:x});output)

for english to al bhed... and the other way...

js
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]?e[a.indexOf(x)]:x});output)

the original ones would only work for letters and spaces... if u added any symbols, like commas, questionmarks or exclamations it would replace them with "undefined"... this new version puts the symbols in place as they were

awesome this is so great!! My Final Fantasy X playthrough is gonna be lit lol thank you!

Small addendum in case any future travelers come across this thread:

A couple of (relatively unimportant) letters were swapped in the Al Bhed alphabet. Here is the corrected code:

English to Al Bhed:

$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]});output)

Al Bhed to English:

$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]});output)

Nulg uh 🤘

i copied the letter order directly from the github u linked... but that version u posted there doesn't have the fix for the symbols/numbers

True!!! Whoops. I adjusted your original one on accident, I'll sort that out today! Yeah i think that github had it wrong. It was just "W" and "X" (in English) that were swapped

Here we go:

English to Al Bhed:

$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]?a[e.indexOf(x)]:x});output)

Al Bhed to English:

$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]?e[a.indexOf(x)]:x});output)

Didn't find your answer? The community is on Discord.

Ask on Discord