Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Feature request: eval-like block

    Feedback
    feature-request
    4
    41
    1954
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeffreyrb03-gmail
      JaecadeJnight Mod Helper last edited by jeffreyrb03-gmail

      In JavaScript, you can use the eval function to evaluate code from a string, like this:
      eval('var x = 1; var y = x + 2; alert(x+y);');
      and this does the exact same as:

      var x = 1; 
      var y = x + 2;
      alert(x+y);
      

      Now, I’m not asking for a block that allows you to execute JavaScript code, because in more ways than one can that be exploited very badly, but I mean a block that allows you to just run other blocks from text. This is what it could look like:
      13639514-e26a-41de-a44b-60480670120e-image.png
      This could be useful for debugging, bypassing drop-down menus that don’t accept text/variables, or (in my current case) when your code should work perfectly fine but is still being stubborn and this is an alternative.

      #LLJW
      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

      c. info-creaticode Tyller_ 3 Replies Last reply Reply Quote 2
      • c.
        Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

        @jeffreyrb03-gmail
        Or yk, a dropdown to choose between all sorts of type-coding and not block coding.

        Official Forums Moderator

        1 Reply Last reply Reply Quote 1
        • info-creaticode
          CreatiCode @jeffreyrb03-gmail last edited by

          @jeffreyrb03-gmail

          It feels like this will not be used by many people. How about we wait until we get at least 10 upvotes for this feature before adding it?

          jeffreyrb03-gmail 2 Replies Last reply Reply Quote 1
          • jeffreyrb03-gmail
            JaecadeJnight Mod Helper @info-creaticode last edited by

            @info-creaticode Ok! Thank you!

            #LLJW
            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

            1 Reply Last reply Reply Quote 0
            • Tyller_
              Tyller_ Best Forum Helpers @jeffreyrb03-gmail last edited by

              @jeffreyrb03-gmail can I see your code that should be working perfectly fine?

              <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
              </div>

              jeffreyrb03-gmail 3 Replies Last reply Reply Quote 1
              • jeffreyrb03-gmail
                JaecadeJnight Mod Helper @Tyller_ last edited by

                @tyller_ It’s in YOUniverse3D, in the sprite “Your avatar handler”. After extensive testing, trying to get a straw hat and glasses for some reason onto the character just wont work.
                975e4434-9b21-41ca-a16c-66541bfaaf71-image.png
                I skip the first item because I have already added it (the add avatar as player), and then I will obtain information from a table about each avatar item, and then use that information to put that item onto the player, like making the hat stay on his head but it will add, just not stay.

                Also, btw, I changed the \n thingie in my parser (in the Your player sprite) to just # because it’s easier
                f7a3c22a-2e98-49d7-9ddd-d0d2c63cb78d-image.png
                so instead I turned blackwalterwhite#straw-hat#star-glasses into a list with # being the splitter.

                right now, they just fell below the world and I have no idea why.
                07e742a7-d48e-47a8-8c89-1f5e0eed58ac-image.png

                #LLJW
                <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                1 Reply Last reply Reply Quote 0
                • jeffreyrb03-gmail
                  JaecadeJnight Mod Helper @Tyller_ last edited by

                  @tyller_ but I know for a fact hats work! When I click this code directly:
                  1652ffa8-fc48-48e0-b589-26c5f7ee901d-image.png
                  I get this:
                  58d03b93-a794-454c-92f0-402ef824213a-image.png
                  I’m not worried about its positioning

                  #LLJW
                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                  1 Reply Last reply Reply Quote 0
                  • jeffreyrb03-gmail
                    JaecadeJnight Mod Helper @Tyller_ last edited by

                    @tyller_ Is it possibly that two items are not allowed to be attached to the Head of an avatar character simultaneously, so they just clash and don’t work?

                    #LLJW
                    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                    jeffreyrb03-gmail 1 Reply Last reply Reply Quote 0
                    • jeffreyrb03-gmail
                      JaecadeJnight Mod Helper @jeffreyrb03-gmail last edited by

                      @jeffreyrb03-gmail I also need to get all of this avatar stuff figured out before I can even start to implement multiplayer

                      #LLJW
                      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                      1 Reply Last reply Reply Quote 0
                      • Tyller_
                        Tyller_ Best Forum Helpers last edited by Tyller_

                        @jeffreyrb03-gmail found it, I checked by copying the block and pasting it into notepad (right click then copy, it copies as text) and when I looked at the field for the body part (the block is
                        <block xmlns="http://www.w3.org/1999/xhtml" type="d3action_d3_attachtobone" colour="#4CAD95ff" id="G=I2:6{4uCuFh~]/t$g}" x="-149.22222222222223" y="658"><value name="BODYPART"><shadow type="d3action_menu_BODYPARTLIST" colour="#4CAD95ff" id="6wbYqs?LX.e:G;C}ph{$"><field name="BODYPARTLIST">neck</field></shadow></value><value name="PARENTNAME"><shadow type="text" colour="#FFFFFFff" id="rFcqk_%u)R%d*H^j#=O*"><field name="TEXT">player</field></shadow></value><value name="SPRITE"><shadow type="d3action_menu_ALLSPRITES" colour="#4CAD95ff" id="h.#6ycyU-?,K_5[P(v1|"><field name="ALLSPRITES">Your player</field></shadow></value><value name="HEIGHT"><shadow type="text" colour="#FFFFFFff" id="eK(osw5sKBwE7skBGH%}"><field name="TEXT">70</field></shadow><block type="data_variable" colour="#FF8C1Aff" id="9-n@%;O|N~@fIc0T%SYU"><field name="VARIABLE" id="YefJTEi/TZB[O43Serh)" variabletype="">CURRENT: TargetHeight</field></block></value></block>
                        is labeled as neck with lowercase when I tried switching it to neck, I set the variable to “head” and it worked, you have to use lowercase for the bodypart
                        1e5c6f60-d39a-425f-99af-f76c8682438a-image.png

                        <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                        </div>

                        jeffreyrb03-gmail 5 Replies Last reply Reply Quote 1
                        • jeffreyrb03-gmail
                          JaecadeJnight Mod Helper @Tyller_ last edited by

                          @tyller_ WHAT?!!! So instead of putting Head I had to put head!!!

                          #LLJW
                          <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                          1 Reply Last reply Reply Quote 0
                          • jeffreyrb03-gmail
                            JaecadeJnight Mod Helper @Tyller_ last edited by

                            @tyller_ That is really clever! Thanks bro! I would’ve never thought to inspect the XML that makes up the blocks

                            #LLJW
                            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                            1 Reply Last reply Reply Quote 0
                            • jeffreyrb03-gmail
                              JaecadeJnight Mod Helper @Tyller_ last edited by

                              @tyller_ So when u move around with WASD and jump and stuff, the hat stays on his head?

                              #LLJW
                              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                              1 Reply Last reply Reply Quote 0
                              • jeffreyrb03-gmail
                                JaecadeJnight Mod Helper @Tyller_ last edited by

                                @tyller_ I’ve replaced all the Heads with head
                                0cc1c809-81a6-40ba-ae44-5f670498f2ed-image.png
                                time to see if it works!

                                #LLJW
                                <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                1 Reply Last reply Reply Quote 0
                                • jeffreyrb03-gmail
                                  JaecadeJnight Mod Helper @Tyller_ last edited by

                                  @tyller_ All I need to do is rotate and resize the glasses, and it’s perfect!
                                  1fe22ef7-3eb9-472f-8d22-66425e9bd244-image.png
                                  Thank you so much

                                  #LLJW
                                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                  1 Reply Last reply Reply Quote 0
                                  • jeffreyrb03-gmail
                                    JaecadeJnight Mod Helper @info-creaticode last edited by jeffreyrb03-gmail

                                    @info-creaticode Nevermind, you’re right we don’t need the block anymore, I fixed the issue that caused me to want to suggest this

                                    #LLJW
                                    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                    1 Reply Last reply Reply Quote 0
                                    • Tyller_
                                      Tyller_ Best Forum Helpers last edited by

                                      @jeffreyrb03-gmail well the block would still be useful, only issue is making the text actually work

                                      <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                                      </div>

                                      jeffreyrb03-gmail c. 4 Replies Last reply Reply Quote 1
                                      • jeffreyrb03-gmail
                                        JaecadeJnight Mod Helper @Tyller_ last edited by jeffreyrb03-gmail

                                        @tyller_ oh yeah true mb

                                        #LLJW
                                        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                        1 Reply Last reply Reply Quote 0
                                        • jeffreyrb03-gmail
                                          JaecadeJnight Mod Helper @Tyller_ last edited by

                                          @tyller_ but if the eval block were introduced, wouldn’t that make your CreatiScript project unnessescary? Because the purpose of your project I think is to run CreatiCode blocks from text, which is exactly what I’m suggesting, since someone could just make a question (in sensing) and then run blocks from text (answer), or make it better with widgets

                                          #LLJW
                                          <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                          1 Reply Last reply Reply Quote 0
                                          • c.
                                            Cαƚƚყ Mod Helper @Tyller_ last edited by

                                            @tyller_
                                            Hey Tyler. Off topic, but does your chat room have a reporting system, or do we need to moderate at all times?

                                            Official Forums Moderator

                                            Tyller_ 1 Reply Last reply Reply Quote 0
                                            • jeffreyrb03-gmail
                                              JaecadeJnight Mod Helper @Tyller_ last edited by

                                              @tyller_ , to add onto my previous comment, that’s sorta like if Scratch introduced a text engine in 4.0, that’d make it so all the hard work people (including me) put into making detailed text engines, like with the 100+ costumes where you just store every single letter in lowercase and capital and numbers and symbols.

                                              You are right, but CreatiCode should probably just not add this block because if too many blocks that make CreatiCode too convienient are added, although making complicated things will be easier, it will take a bit of the fun and creativity and effort away from making simpler things and solving problems. Now I’m not saying they should just not add new things to make it easier and faster to use, but this sorta thing might render all your hard work useless, and will take the fun out of solving hard problems like this one where I had no idea why my code wouldn’t work (lol that was hillarious “head” is case-sensitive).

                                              #LLJW
                                              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                              1 Reply Last reply Reply Quote 0
                                              • Tyller_
                                                Tyller_ Best Forum Helpers @c. last edited by

                                                @catty I have a thing where there’s moderation commands, I’m going to add a report system where you can report a user and it has all ppl with moderation perms get a notification pop up on their screen whenever they open the project, currently I just have commands where moderators (I gotta set mods based off whatever username block has their name as) can flag all messages with a keyword in it, then view all flagged messages, and delete either all flagged or a certain one, I am actively working on moderation related stuff with it, but all messages are logged in a database for loading them and for moderation

                                                <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                                                </div>

                                                jeffreyrb03-gmail 2 Replies Last reply Reply Quote 0
                                                • jeffreyrb03-gmail
                                                  JaecadeJnight Mod Helper @Tyller_ last edited by

                                                  @tyller_ Can you make the source code shared to friends? After you’re done I wanna make some modifications for you to add

                                                  #LLJW
                                                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                  1 Reply Last reply Reply Quote 0
                                                  • jeffreyrb03-gmail
                                                    JaecadeJnight Mod Helper @Tyller_ last edited by

                                                    @tyller_ Also I have an idea for a better notification system, prolly using email blocks (don’t work right now tho) or sending it to an API that will give me a phone notification

                                                    #LLJW
                                                    <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                    c. 1 Reply Last reply Reply Quote 0
                                                    • c.
                                                      Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                                      @jeffreyrb03-gmail
                                                      oh god pls no. biiig spam issue.

                                                      Official Forums Moderator

                                                      jeffreyrb03-gmail 1 Reply Last reply Reply Quote 0
                                                      • jeffreyrb03-gmail
                                                        JaecadeJnight Mod Helper @c. last edited by

                                                        @catty it’s not going to do it in the way you think it is, it’s just going to do with messages that it isn’t sure is appropriate, and Its also that it takes forever to load

                                                        #LLJW
                                                        <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                        c. 1 Reply Last reply Reply Quote 0
                                                        • c.
                                                          Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                                          @jeffreyrb03-gmail
                                                          yes but guess what, it would have to go to my personal email bc I can’t receive emails on my school account, plus they would be VERY concerned lmao

                                                          Official Forums Moderator

                                                          Tyller_ jeffreyrb03-gmail 3 Replies Last reply Reply Quote 0
                                                          • Tyller_
                                                            Tyller_ Best Forum Helpers @c. last edited by

                                                            @catty yeah that would have me add an email input to my table of special ppl, which would still be secure bc I did only put it on share with friends like Jeff suggested (I didn’t even think share with friends only would work with publish to all)

                                                            <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                                                            </div>

                                                            c. 1 Reply Last reply Reply Quote 1
                                                            • c.
                                                              Cαƚƚყ Mod Helper @Tyller_ last edited by

                                                              @tyller_
                                                              it should work.

                                                              Official Forums Moderator

                                                              1 Reply Last reply Reply Quote 0
                                                              • jeffreyrb03-gmail
                                                                JaecadeJnight Mod Helper @c. last edited by jeffreyrb03-gmail

                                                                @catty @Tyller_ Well I also have better ideas, but remember if you need help with something in this, I can help

                                                                #LLJW
                                                                <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                1 Reply Last reply Reply Quote 0
                                                                • jeffreyrb03-gmail
                                                                  JaecadeJnight Mod Helper @c. last edited by

                                                                  @catty your parents u mean? I can understand, but its not like gonna tell u what’s in the message, its just gonna say to check the admin panel

                                                                  #LLJW
                                                                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                  c. 1 Reply Last reply Reply Quote 0
                                                                  • c.
                                                                    Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                                                    @jeffreyrb03-gmail
                                                                    no. my school.

                                                                    Official Forums Moderator

                                                                    jeffreyrb03-gmail 1 Reply Last reply Reply Quote 0
                                                                    • jeffreyrb03-gmail
                                                                      JaecadeJnight Mod Helper @c. last edited by jeffreyrb03-gmail

                                                                      @catty oh ok but regardless, email blocks doesn’t work at the moment and the design is still gonna be smart to prevent any problems from happening

                                                                      #LLJW
                                                                      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                      c. 1 Reply Last reply Reply Quote 1
                                                                      • c.
                                                                        Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                                                        @jeffreyrb03-gmail
                                                                        if needed, i can provide my personal email to do so.

                                                                        Official Forums Moderator

                                                                        c. jeffreyrb03-gmail 2 Replies Last reply Reply Quote 0
                                                                        • c.
                                                                          Cαƚƚყ Mod Helper @c. last edited by

                                                                          @catty
                                                                          but then i’ll immedietly purge it

                                                                          Official Forums Moderator

                                                                          1 Reply Last reply Reply Quote 0
                                                                          • jeffreyrb03-gmail
                                                                            JaecadeJnight Mod Helper @c. last edited by

                                                                            @catty nah it’s fine, I was just giving ideas

                                                                            #LLJW
                                                                            <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                            jeffreyrb03-gmail 1 Reply Last reply Reply Quote 0
                                                                            • jeffreyrb03-gmail
                                                                              JaecadeJnight Mod Helper @jeffreyrb03-gmail last edited by

                                                                              @jeffreyrb03-gmail lmao my inventory design sucks
                                                                              6acdd009-9145-43ee-8cb5-2f61d7b5bc57-image.png

                                                                              #LLJW
                                                                              <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                              c. 1 Reply Last reply Reply Quote 0
                                                                              • c.
                                                                                Cαƚƚყ Mod Helper @jeffreyrb03-gmail last edited by

                                                                                @jeffreyrb03-gmail
                                                                                i cant compete to something as beautiful as that!

                                                                                Official Forums Moderator

                                                                                jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
                                                                                • jeffreyrb03-gmail
                                                                                  JaecadeJnight Mod Helper @c. last edited by

                                                                                  @catty speaking of that design, it’s getting better and is going to have slots and stuff like a real Minecraft inventory

                                                                                  #LLJW
                                                                                  <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                                  info-creaticode 1 Reply Last reply Reply Quote 0
                                                                                  • info-creaticode
                                                                                    CreatiCode @jeffreyrb03-gmail last edited by

                                                                                    @jeffreyrb03-gmail

                                                                                    Sounds like your project is going along well. Don’t forget to save multiple copies and also download the project as local files, just in case it is deleted or ruined by accident.

                                                                                    jeffreyrb03-gmail 1 Reply Last reply Reply Quote 1
                                                                                    • jeffreyrb03-gmail
                                                                                      JaecadeJnight Mod Helper @info-creaticode last edited by

                                                                                      @info-creaticode Thank you, I should do that.

                                                                                      #LLJW
                                                                                      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

                                                                                      1 Reply Last reply Reply Quote 0
                                                                                      • First post
                                                                                        Last post