# Script builder library (Part 2)

**URL:** <https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535>\
**Category:** Share your Projects\
**Created:** [May 1, 2021, 7:12am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535 "2021-05-01T07:12:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.snap.berkeley.edu/original/2X/d/dc8cfa4b1c99bd810b188b58c718084d8f47e271.svg) [@system](https://forum.snap.berkeley.edu/u/system)\
**Post date:** [May 1, 2021, 7:12am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/1 "2021-05-01T07:12:42Z")

</div>

Continuing the discussion from [Script builder library (Part 1) - #120 by winner20](https://forum.snap.berkeley.edu/t/script-builder-library-part-1/3361/120).

Previous discussions:

- [Script builder library (Part 1)](https://forum.snap.berkeley.edu/t/script-builder-library-part-1/3361)

---

<div class="post-metadata">

**Author:** ![helicoptur](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/helicoptur/32/8332_2.png) [@helicoptur](https://forum.snap.berkeley.edu/u/helicoptur)\
**Post date:** [May 1, 2021, 3:43pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/2 "2021-05-01T15:43:34Z")

</div>

> [@winner20 but im too lazy to find the topic and post number](#):
>
> theres a bug in [@ego-lay_atman-bay when block reporter] and inside has [undefined reporter] and it throws an error

that's not related to this topic or the library, but please link the project so we know what you're talking about.

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [May 1, 2021, 11:40pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/3 "2021-05-01T23:40:02Z")

</div>

> [@winner20](#):
>
> there's a bug in ![block](https://cdn.forum.snap.berkeley.edu/original/2X/1/1ec00f1794fb77dbb28ea6316d4b1feb6bd4fe2a.png) and inside has ![Undefined!](https://cdn.forum.snap.berkeley.edu/original/2X/d/d267c9e78df4c0608975314aeae9f1eddefb3f2a.png) block and it reports an error

you have to have the script builder library for that to work. Also, unrelated to the topic.

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [May 12, 2021, 6:34pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/7 "2021-05-12T18:34:34Z")

</div>

> [@winner20](#):
>
> ![uhhh](https://cdn.forum.snap.berkeley.edu/original/2X/a/ab15bf6cc68c2a5cabf783c2df181dc5ea49a5d8.png)

that's actually super easy to replicate. Just grab two scripts like this

 ![untitled script pic (14)](https://cdn.forum.snap.berkeley.edu/original/2X/3/3a59510c8ff1eaa229c8074ed6b78c58cd5a7de2.png)  
than just stick one script inside the other, under the first block  
 ![untitled script pic (34)](https://cdn.forum.snap.berkeley.edu/original/2X/f/ff02ef2cf27d38d6c4290f93eff5333c41c3a3f5.png)

and that glitch can be useful if you are using a broadcast, and you want clones to be deleted, and only the sprite runs the script, for example

 ![untitled script pic (35)](https://cdn.forum.snap.berkeley.edu/original/2X/c/c62ca20d5b5d7b60270f8040d71d1c0d829f074f.png)

---

<div class="post-metadata">

**Author:** ![snapenilk](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/snapenilk/32/1947_2.png) [@snapenilk](https://forum.snap.berkeley.edu/u/snapenilk)\
**Post date:** [May 12, 2021, 9:47pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/8 "2021-05-12T21:47:22Z")

</div>

I don't need that glitch because I can put `delete this clone` in an `if <true>`.

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [May 12, 2021, 10:38pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/9 "2021-05-12T22:38:52Z")

</div>

yeah, you can do that too.

---

<div class="post-metadata">

**Author:** ![include\_iostream](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/i/e9a140/32.png) [@include\_iostream](https://forum.snap.berkeley.edu/u/include_iostream)\
**Post date:** [May 12, 2021, 11:56pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/10 "2021-05-12T23:56:25Z")

</div>

> [@winner20](#):
>
> A f\*\*\*\*\*\*\* glitch happened

Please don't be rude, and note that there is a [rule that disallows swears](https://forum.snap.berkeley.edu/t/new-rule-no-swears-on-the-site/4211).

---

<div class="post-metadata">

**Author:** ![winner20](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/w/13edae/32.png) [@winner20](https://forum.snap.berkeley.edu/u/winner20)\
**Post date:** [May 20, 2021, 8:56am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/17 "2021-05-20T08:56:12Z")

</div>

How to add an Upvar with multiple inputs like:  
 ![context script pic](https://cdn.forum.snap.berkeley.edu/original/2X/2/2d1e0d85acc55b79f2a1247eebf4f8010d2b299e.png)

---

<div class="post-metadata">

**Author:** ![helicoptur](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/helicoptur/32/8332_2.png) [@helicoptur](https://forum.snap.berkeley.edu/u/helicoptur)\
**Post date:** [May 20, 2021, 2:09pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/18 "2021-05-20T14:09:19Z")

</div>

that's not relevant to the topic

---

<div class="post-metadata">

**Author:** ![bh](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/bh/32/31580_2.png) [@bh](https://forum.snap.berkeley.edu/u/bh)\
**Post date:** [May 20, 2021, 5:08pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/19 "2021-05-20T17:08:12Z")

</div>

> [@winner20](#):
>
> How to add an Upvar with multiple inputs

We don't have that capability. People have asked for it before, but so far we don't have a good idea for how to refer to those upvars inside the procedure, since variables aren't first class.

---

<div class="post-metadata">

**Author:** ![sathvikrias](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/sathvikrias/32/46248_2.png) [@sathvikrias](https://forum.snap.berkeley.edu/u/sathvikrias)\
**Post date:** [May 20, 2021, 5:47pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/20 "2021-05-20T17:47:31Z")

</div>

> [@bh](#):
>
> variables aren't first class.

then why does it say

:snap:  
everything first class

in a handful of photos about snap

---

<div class="post-metadata">

**Author:** ![bh](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/bh/32/31580_2.png) [@bh](https://forum.snap.berkeley.edu/u/bh)\
**Post date:** [May 20, 2021, 5:55pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/21 "2021-05-20T17:55:03Z")

</div>

It's an aspirational slogan. For years costumes and sounds weren't first class, and now they are. Things still not first class include environments (the structure in which variable names are associated with their values), files, projects, and (if you don't load the Colors and Crayons library) colors. I suspect that implementing macros will entail a way to make variables first class, but that's not a promise.

---

<div class="post-metadata">

**Author:** ![erikkoevsnap](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/erikkoevsnap/32/23849_2.png) [@erikkoevsnap](https://forum.snap.berkeley.edu/u/erikkoevsnap)\
**Post date:** [May 21, 2021, 6:15am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/22 "2021-05-21T06:15:54Z")

</div>

what just happened here

 ![WHAT2](https://cdn.forum.snap.berkeley.edu/original/2X/7/761a133ca440ec74ee5d707af4abe6987aab6f29.png)

---

<div class="post-metadata">

**Author:** ![winner20](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/w/13edae/32.png) [@winner20](https://forum.snap.berkeley.edu/u/winner20)\
**Post date:** [May 21, 2021, 10:34am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/23 "2021-05-21T10:34:00Z")

</div>

idk

...

---

<div class="post-metadata">

**Author:** ![winner20](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/w/13edae/32.png) [@winner20](https://forum.snap.berkeley.edu/u/winner20)\
**Post date:** [May 21, 2021, 10:36am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/24 "2021-05-21T10:36:31Z")

</div>

no, they are first-class according to BYOB (old-Snap!) variables are first-class proc. and like SCRIPT VARIABLES

---

<div class="post-metadata">

**Author:** ![mineoskar999](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@mineoskar999](https://forum.snap.berkeley.edu/u/mineoskar999)\
**Post date:** [May 22, 2021, 8:29am UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/25 "2021-05-22T08:29:25Z")

</div>

I'd like to have several more blocks:  
(join blocks {} ◂▸)  
(slots in block {})  
\<is {} custom block?\>  
set definition of {} to {}  
get definition of {}

---

<div class="post-metadata">

**Author:** ![helicoptur](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/helicoptur/32/8332_2.png) [@helicoptur](https://forum.snap.berkeley.edu/u/helicoptur)\
**Post date:** [May 22, 2021, 6:17pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/26 "2021-05-22T18:17:53Z")

</div>

I can make all of these except the

> [@mineoskar999](#):
>
> (slots in block {})

block, working on it now.  
Edit: done.  
[ProjectName=script%20builder](https://snap.berkeley.edu/snap/snap.html#present:Username=helicoptur&ProjectName=script%20builder)

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [May 22, 2021, 10:10pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/27 "2021-05-22T22:10:44Z")

</div>

it looks like a well known undo/redo bug.

---

<div class="post-metadata">

**Author:** ![dms\_64](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dms\_64](https://forum.snap.berkeley.edu/u/dms_64)\
**Post date:** [May 27, 2021, 1:14pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/28 "2021-05-27T13:14:49Z")

</div>

![script builder script pic](https://cdn.forum.snap.berkeley.edu/original/2X/2/21ba273ea4ba1e3c489c6d215642e1aed1c87931.png)

---

<div class="post-metadata">

**Author:** ![helicoptur](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/helicoptur/32/8332_2.png) [@helicoptur](https://forum.snap.berkeley.edu/u/helicoptur)\
**Post date:** [May 27, 2021, 4:02pm UTC](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535/29 "2021-05-27T16:02:40Z")

</div>

Oh. I guess I forgot about the existence of the `# of slots in` block. Adding that now.

[Next page](https://forum.snap.berkeley.edu/t/script-builder-library-part-2/6535.md?page=2)
