#(JustinS) .has_flag[*_flag]?

49 messages · Page 1 of 1 (latest)

primal wedge
#

How can I check if a location is flagged with any flags that end with _flag?

spare crescentBOT
#

(JustinS) .has_flag[*_flag]?

spare crescentBOT
#

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.

cerulean laurel
#

should use subflags for this

primal wedge
#

I know. I made the system a while ago and don't feel like risking breaking everything over a small additional feature

#

Is there another way?

#

I could loop through the list of flags and check if the block has that flag

#

but I run this everytime a block breaks

#

is there a switch for this?

#

dont see it in the docs.. I see flagged but thats for players afaik

cerulean laurel
#

has_flag does not support wildcards

#

should switch to subflags

stuck mist
#

on the break blocks are you checking if the player is flagged vs the location.

primal wedge
#

Im not checking anything in the event atm

stuck mist
#

on the break blocks you could check location_flagged

primal wedge
cerulean laurel
#

You can also have a list of existing flag names and loop through them

primal wedge
#

Thought of that but I'd have to do that on every block breaks

primal wedge
#

is that not a bit bad for performance

#

or is it finee

#

its a short list

cerulean laurel
#

it's fine

#

still should think about switching to subflags

#

could have a second system that will update your thing when the block breaks

primal wedge
#

Cant I do location_flagged:flag1|flag2|flag3...?

#

in the on event

#

just thought of that

cerulean laurel
#

!tias

royal cometBOT
# cerulean laurel !tias
Info: tias

Try it and see!

If somebody pulled this up for you, you're probably asking a question of the public channel that's easier and faster to figure out by just attempting your idea in-game and looking at the result of that attempt.

primal wedge
#

location_flagged doesnt work with multiple flags ig

#

didnt work\

#

it does work with a single flag

#

thats stupid

stuck mist
#

if each flag on a block has different logic could add multiple and run the specific logic in each one.

primal wedge
#

nope

#

I need to remove the flags

#

if they have the flags

#

So basically, when a player breaks a block, and it has a flag ending with _block, remove that flag

stuck mist
#

I see

#

you could try this

#

on player breaks block location_flagged:test location_flagged:worst_flag:

finite monolith
#

Is that even valid?

stuck mist
#

works on my end

#

nevermind seems it only takes the last into account

finite monolith
#

!itworks

royal cometBOT
# finite monolith !itworks
Info: itworks

Many newer scripters tend to not realize the important difference between "it works" and "it is correct". Just because a script works does not mean everything's fine.

Helpers are encouraged to refuse to continue helping a user with the "if it works it's good enough" mindset until they fix all the things that are wrong (but seem to work) in their script.

Read a longer writeup explaining this idea on the forum here: https://forum.denizenscript.com/threads/public-information-writeup-the-it-works-fallacy.265/