Git Product home page Git Product logo

Comments (5)

EntityReborn avatar EntityReborn commented on June 18, 2024

Looks like array_implode does the same as well. (Returns the array, not a string)

from commandhelper.

Rebes avatar Rebes commented on June 18, 2024

assign(@Items, array(parse_args($)))
should be
assign(@Items, parse_args($))
parse_args() returns an array, no need to array() it.

from commandhelper.

Rebes avatar Rebes commented on June 18, 2024

Try this... http://paste.thezomg.com/1786/13314019/

Type /test a b c

You will get:
Items: {{a, b, c}}
Items 0: {a, b, c}
First: {a, b, c}
Items: {a, b, c}
Items 0: a
First: a

Explanation... because parse_args() returns an array, by using array() around parse_args() you effectively turn @Items into an array of arrays. You can see this because of the double parenthesis around {{a, b, c}}. {a, b, c} is the first (and only) item in the @Items array. Think of it like this: {{a, b, c}, {d, e, f}, {g, h, i}}. This is actually a great way to store coordinate arrays... For example I have a script where you can /enablesigns (Basically make it so a sign can do something if there is a command on it)... To do that, I push the location of the sign onto an array, but the location itself is an array (In the format {x, y, z, World})... So I get an array that looks like {{x1, y1, z1, World}, {x2, y2, z2, World}, ... }

from commandhelper.

LadyCailin avatar LadyCailin commented on June 18, 2024

So, I'm a bit confused now, this is not a bug, correct? After looking at @Rebes script, it appears to be working as intended.

from commandhelper.

EntityReborn avatar EntityReborn commented on June 18, 2024

I... uh. Yea. Closing =D

from commandhelper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.