ioBroker / ioBroker.javascript

Script engine for JavaScript and Blockly
MIT License
325 stars 120 forks source link

Add own / custom Blockly Blocks #1008

Open Eistee82 opened 2 years ago

Eistee82 commented 2 years ago

Hi, is there a way to add own Blockly Blocks with an js file? I don't want to write a whole Adapter just to include a custom Block.

ScumbagSteve commented 1 year ago

Isn't that exactly what a JS-function block does?

Eistee82 commented 1 year ago

I will Add them globaly to all Scripts not only to one Script. For Example when I have a MQTT Server and there are some Devices. There is no Adapter to Control them there are only Datapoints. So when I will for Example Control a Device I can add a Blockly Block wich controls the Datapoints for this. Next Example I have a Idea to Control Stuff like Lights with difrent hue and brightnes over the Day I can reuse this Block with the Logic in any other Script. And I can now reuse it in any Script I add. It should be just one Block with custom logic wich can be reused in any Script and shared with other people. Not a Complete standalone Script. Maybe when this will work there will be a Database with custom Blockly Blocks (or reusabe functions) where Everyone can search for Stuff. But first there must be an reusable function/Blockly Block