Call block from Javascript?

I figured out how to connect Snap! to the Web Speech API first by looking at the examples in the Example project called JSFunctions. And the infinite precision and rational number library.

You can see the blocks I built at https://ecraft2learn.github.io/ai/

@toontalk
Thanks for this. Very nicely done. I will study and try to decipher.

Could I ask if there is some explicit documentation on how to to send a broadcast and update global variables from a javascript function running inside a Snap block?

I tried following info via the links on this thread but didn't manage to find anything

are you looking for the api documentation?

:+1:
Already got broadcasts working :slight_smile:

  ...
  ide = world.children[0];
  ...

  ide.broadcast("test");
  ...

image

and updating variable as well :slight_smile:

ide.setVar("payload","test_value");