# Create a generic 'Pause Until' block

**URL:** <https://forum.makecode.com/t/create-a-generic-pause-until-block/30448>\
**Category:** micro:bit\
**Created:** [September 5, 2024, 9:57pm UTC](https://forum.makecode.com/t/create-a-generic-pause-until-block/30448 "2024-09-05T21:57:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpoelzl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mpoelzl/32/17062_2.png) [@mpoelzl](https://forum.makecode.com/u/mpoelzl)\
**Post date:** [September 5, 2024, 9:57pm UTC](https://forum.makecode.com/t/create-a-generic-pause-until-block/30448/1 "2024-09-05T21:57:02Z")

</div>

Hello!

I am trying to create a ‘Pause Until’ block that can take a function with a boolean return value and pauses until it turn true. Makecode for the EV3 has such a block but not for micro:bit. I can create the function but the corresponding block does not look as it should. Specifically it does not have the ‘pointy’ parameter placeholder where a boolean input can be placed. The code looks like this:

```auto
    //% block="Pause until %condition || timeout %timeOut"
    export function pauseMeUntil(condition: () => boolean, timeOut?: number): void {
        if (!condition || condition()) return; // optimistic path
        if (!timeOut) timeOut = 0;
        control.__queuePollEvent(timeOut, condition, undefined);
    }

```

It should look like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/c/8c7d2ad9c439edd6c824da286e94c9072b691661.png)

but it actually looks like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/e/2e2864e7d81a06a68220546254ffc10e5c5d79df.png)

Any ideas how I could get this to work?  
Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 5, 2024, 10:02pm UTC](https://forum.makecode.com/t/create-a-generic-pause-until-block/30448/2 "2024-09-05T22:02:33Z")

</div>

@mpoelzl this actually isn’t possible to do from an extension. The pause until block is [special](https://forum.makecode.com/t/richards-arcade-tips-3-the-pause-until-block/28794) and can only be enabled by turning it on in the [pxtarget.json of pxt-microbit](https://github.com/microsoft/pxt-microbit/blob/master/pxtarget.json). With that being said, I’m actually surprised that we didn’t already enable this in the micro:bit editor; I don’t think we ever discussed it on the team so this might have just been an oversight on our part…

You should open an issue for it here:

> **[GitHub - microsoft/pxt-microbit: A Blocks / JavaScript code editor for the...](https://github.com/microsoft/pxt-microbit/)**
>
> A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode

I personally don’t see an issue with adding it to the default toolbox, but I’m sure there will be some discussion over what category to put it in.

---

<div class="post-metadata">

**Author:** ![mpoelzl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mpoelzl/32/17062_2.png) [@mpoelzl](https://forum.makecode.com/u/mpoelzl)\
**Post date:** [September 6, 2024, 7:35pm UTC](https://forum.makecode.com/t/create-a-generic-pause-until-block/30448/3 "2024-09-06T19:35:32Z")

</div>

Thank you for the quick reply and the extra info. It would be great to have this block for the younger learners as it greatly simplifies a series of robot drive tasks (no need for loops).

I have created an issue on GitHub.
