Custom blocks (Part 1)

you can add any of my blocks, also please add a set of blocks that you can use to get data from the forums.

Why do you need that?

1: why do you always ask that
2: so I can make a project that tells you the (nth) post, topic and other things like that.

If I had to take a wild guess, I would say that maybe it's because I want to know why you need that.

Can you add menu blocks? Even if you think the dialog boxes are enough, can you do it?

How do i make the "value of textbox" block work?
image
Also there should be multiline textbox and monospace font, and also, set [var] textbox to [text]
(multiline textbox + monospace font = coding lol)

Fixed.

Sorry, I don't know how to do that.

i dont think it got fixed
image

Fixed.

ok so i figured out how to make it monospace

box.contents().text.fontName = 'monospace'

@helicoptur @cst1229
image
image

I like it !

Can you add some features ? like background color, color of the input field, (x,y) position.

Good work

I'll be gone on vacation for 1 week, don't worry if you don't get an answer by ...

Can you add a block that calculates the mean, median, mode or range of a list?

bump!

Why are you bumping this?

maybe he's waiting to be answered?

Here's a menu block. (It includes support for submenus)

Could you please provide a project link?

I don't have a project that has it (at the moment).
But if you want the code for quick copy-pasting, then here you are:

let result = false;

function menuFromItems( lstItems){
let menu = new MenuMorph( item=>result=item);
lstItems.asArray().forEach( it=>{ 
let itName = itVal = it;
if( it instanceof List){
      [ itName, itVal] = [it.at(1), it.cdr()];
      itVal = menuFromItems( itVal);
      menu.addPair( itName, itVal, '\u25ba');
    }
    else if( it == "~")
menu.addLine();
else if( it == "")
menu.addItem( "close", true);
else menu.addItem( itName, itVal);
 });
 return menu;
} 
let m = menuFromItems( items); 
m.title = ti;
m._destroy = m.destroy;
m.destroy= ()=>{ result ||= true; m._destroy()};
m.popUpAtHand( this.world());

return ()=>result;

Here's the code for the blockJS-13.0 script pic (3) block: