TurboWarp / scratch-vm

Scratch VM with a JIT compiler and more features
https://turbowarp.org/
Mozilla Public License 2.0
75 stars 72 forks source link

how can i listen for a broadcast with js? #131

Open DemonLordDiablo opened 1 year ago

DemonLordDiablo commented 1 year ago

i am trying to make a custom block like: whenbroadcastreceived(message){ //do whatever with "message" }

i can use: vm.runtime.startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: data, }) to send a broadcast, but how can i listen for a broadcast?