#(MrCrash) Tag for check if a wall is connected to another wall
108 messages · Page 1 of 1 (latest)
(MrCrash) Tag for check if a wall is connected to another wall
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
Okay i do something like this:
- if <context.location.attached.location.flag[ingepipe].sides>
now i need to return if he is attached to more than 1 sides
!t sides
Returns the list of heights for a wall block, or connections for a redstone wire, in order North|East|South|West|Vertical.
For wall blocks: For n/e/s/w, can be "tall", "low", or "none". For vertical, can be "tall" or "none".
For redstone wires: For n/e/s/w, can be "none", "side", or "up". No vertical.
properties
ListTag
MaterialTag.sides
This could help if I understood you well
Oop, discord didn't showed that you actually send an another message with .sides here, sorry
np sometimes discor do weird things
it returns a listtag, so you can return the size of the list
!tag listtag size
Multiple possible tags: <ListTag.any>, <ListTag.get[<#>|...]>, <ListTag.sum>, <ListTag.last[(<#>)]>, <ListTag.size>, <ListTag.set[...|...].at[<#>]>, <ListTag.find[<element>]>, <ListTag.first[(<#>)]>, <ListTag.sort[<procedure>]>, <ListTag.filter[<tag>]>, <ListTag.filter_tag[<dynamic-boolean>]>, <ListTag.parse_tag[<parseable-value>]>, <ListTag.to_map[(<separator>)]>, <ListTag.insert[...|...].at[<#>]>, <ListTag.get[<#>].to[<#>]>, <ListTag.find_all[<element>]>, <ListTag.count[<element>]>, <ListTag.average>, <ListTag.lowest[(<tag>)]>, <ListTag.highest[(<tag>)]>, ...
!tag listtag.size
Returns the size of the list.
ElementTag(Number)
# Narrates '3'
- narrate <list[one|two|three].size>
oh nice
it's exactly what i need here
so why isn't correct here? :
- flag <context.location> ingepipe
- flag server inge_pipe:->:<context.location>
- if <context.location.attached.location.flag[ingepipe].sides.size> >= 2:
- determine cancelled```
!t location.attached
Returns the block this block is attached to.
(For buttons, levers, signs, torches, etc).
world
LocationTag
LocationTag.attached is not a tag?
Sorry i don't understand what i miss ?
<context.location
.attached.location.flag[ingepipe].sides.size>
I have no clue what this is supposed to be?
Is your block a gate?
nope, i read wrong the meta
!t location.floodfill
Did you mean to search for locationtag.flood_fill?
Returns the set of all blocks, starting at the given location,
that can be directly reached in a way that only travels through blocks of the same type as the starting block.
For example, if starting at an air block inside an enclosed building, this will return all air blocks inside the building (but none outside, and no non-air blocks).
As another example, if starting on a block of iron_ore in the ground, this will find all other blocks of iron ore that are part of the same vein.
This will not t...
world
ListTag(LocationTag)
Returns the set of all blocks, starting at the given location,
that can be directly reached in a way that only travels through blocks that match the given LocationTag matcher.
This will not travel diagonally, only the 6 cardinal directions (N/E/S/W/Up/Down).
As this is potentially infinite for some block types (like air, stone, etc.) should there be any opening however small, a limit must be given.
The limit value can be: a CuboidTag, an EllipsoidTag, or an ElementTag(Decimal) to use as a radius...
world
ListTag(LocationTag)
This takes matcher input
So you can use location matchers, such as block_flagged:<flag>, to only match your custom pipes
ie; if you look at a pipe and run
/ex narrate <player.cursor_on.flood_fill[1].types[block_flagged:ingepipe]>, it will output each pipe that directly connects to it, including the pipe you look at
That can be usefull to make a placing limit on the pipe, but idk if that help me for what i want to make at now
You want to check if your pipe is connected to another pipe
With the help of the tag above, you can do that
I want to do the pipe can't be separate on multiple ways , like when player try to place the pipe wall (surrounded in black on the png) that cancel the place event
Oh mb i don't see the [1] in flood_fill[1]
ok i can't deal with it
so:
- determine cancelled```
That can work ye
okay so i precise somethings:
- flag <context.location> ingepipe
- flag server inge_pipe:->:<context.location>
- foreach <server.flag[inge_pipe]> as:checkpipe:
- if <[checkpipe].flood_fill[1].types[block_flagged:ingepipe]> >= 3:
- determine cancelled```
but don't working :/
Okay i forgot the .size
so:
- flag <context.location> ingepipe
- flag server inge_pipe:->:<context.location>
- if <context.location.flood_fill[1].types[block_flagged:ingepipe].size> >= 3:
- determine cancelled```
look's okay but do weird thing
that behavior is consistent
it's not weird at all
>= 3 is probably just too big for whatever you're trying
Think about it logically
tell the rubber ducky how the script works
oh shit i interrupted ice
runs pls continue 
Check the connecting pipes for the amount of connecting pipes aswell
You want to check the amount of connecting pipes of the green block as well
If you run this tag on the yellow one, what size is the list?
4 locations
so i need to check the last pipe placed before instead of the "context placed pipe"?
three locations on y 48, one location on y 49; so all three bottom squares + top square, yeah
Both
both?
the context location is part of the flood_fill
and what's about if i check foreach loction flagged? that would be working?
You don't want that the blue block connects with more than 2 pipes
otherwise it would break your wanted outcome
to precise i don't want to be allow to place the green block above the yellow one , supposed he is placed in last
Yes, check the amount of connecting pipes of the yellow block when someone places the top-green one
so it's a check foreach flagged blocks, if he is connected to more than 3, i cancel?
if he is connected to more than 3, i cancel? two pipes, not three, but since flood_fill includes the block you're running flood_fill on, 3 in your if yes
foreach flagged blocks, not all flagged blocks no, in the scenario above only the yellow block and the top greenish one, when it's going to be placed
mmh yeah okay but if i don't use foreach flagged block how can i know above which block the player place the pipe?
The event provides the tag, you can use to get the block placed by the player
And the tag, we talked about several times, returns a list of locations of connecting pipes
So you have the tools you need, you just have to put it together
i'm lost lmao
np i'm going to paste all of this in google trad and trying to understand x)
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@grand shadow
What do you currently have / what part are you struggling with?
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Oh sorry, i use a new script for doing the same thing but using blocks to set the direction of the pipe, check it here: https://discord.com/channels/315163488085475337/1084429061994074132
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@grand shadow