Solved Cuboid Expression

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

ShaneBee

Supporter +
Addon Developer
Sep 7, 2017
2,248
241
73
Vancouver, Canada
Category: Expression

Suggested name: Doesn't really need a name, but lets call it "Mr.Cuboid"

What I want:
I want an expression done in SkriptMirror for a cuboid. Im going to start working on a project, and the only cuboid think I know of is the SkQuery isWithinCuboid one... and frankly i'd like to avoid SkQuery if I can.
Im new to Skript mirror... i started looking at the syntax from the GITHUB for SkQuery but Im totally lost on how I can change that into a simple expression.

If someone could help me I would be greatly appreciative

Ideas for commands:
No need for commands, just an expression, similar to SkQuery's
"%location% is within %location% to %location%"

Ideas for permissions:
None required

When I'd like it by: Soon would be nice :emoji_slight_smile:
[doublepost=1534969135,1534814980][/doublepost]I guess I can mark this as solved, since Donut helped me figure this out on Discord.
 
Hey yeah I can post it.
Its a tad bit messy right now but it works. What donut came up with (which was actually simple) didnt work due to a bug in Skript that is currently being worked on. Until this bug is fixed, this worked for me.

code_language.skript:
#! Condition - Checks if a block is within a cuboid
condition [block] %location% is within %location% and %location%:
    check:
        set {_1} to expression-1
        set {_2} to expression-2
        set {_3} to expression-3
        if x coord of {_1} is between x coord of {_2} and x coord of {_3}:
            if y coord of {_1} is between y coord of {_2} and y coord of {_3}:
                if z coord of {_1} is between z coord of {_2} and z coord of {_3}:
                    continue
                if z coord of {_1} is between z coord of {_3} and z coord of {_2}:
                    continue
            if y coord of {_1} is between y coord of {_3} and y coord of {_2}:
                if z coord of {_1} is between z coord of {_2} and z coord of {_3}:
                    continue
                if z coord of {_1} is between z coord of {_3} and z coord of {_2}:
                    continue
        if x coord of {_1} is between x coord of {_3} and x coord of {_2}:
            if y coord of {_1} is between y coord of {_2} and y coord of {_3}:
                if z coord of {_1} is between z coord of {_2} and z coord of {_3}:
                    continue
                if z coord of {_1} is between z coord of {_3} and z coord of {_2}:
                    continue
            if y coord of {_1} is between y coord of {_3} and y coord of {_2}:
                if z coord of {_1} is between z coord of {_2} and z coord of {_3}:
                    continue
                if z coord of {_1} is between z coord of {_3} and z coord of {_2}:
                    continue