#(hatzefatz) isList?
29 messages · Page 1 of 1 (latest)
(hatzefatz) isList?
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.
!t objecttag.object_type
Returns the short-form name of the tag type that is processing this tag, like 'List'.
This tag is made available to help you debug script issues, for example if you think an object isn't processing its own type correctly.
ElementTag
oop
!t alphabetical
Returns the list sorted to be in alphabetical order.
ListTag
# Narrates a list of 'a|c|d|g|q'
- narrate "<list[c|d|q|a|g].alphabetical>
!t is_truthy
Returns true if the object is 'truthy'. An object is 'truthy' if it exists and is valid, and does not represent a concept like emptiness.
An empty list or an air item will return 'false'. Plaintext "null" or "false", an empty element, or a numeric zero will return 'false' as well.
Some object types may have their own logical implementations, for examples an EntityTag value is 'truthy' only if the entity it represents is spawned.
Errored/broken/invalid tags are also considered 'false' by this log...
ElementTag(Boolean)
This tag is made available to help you debug script issues
not made for actual scripting
since this tag only exists for lists, if you use it in any other object aside from a list, it'll error
and is_truthy will catch that
so .alphabetical.is_truthy = "is_list"
oh fair enough. I usually ignore those notes lol
You could just do <[flag].as[list].exists> as well
But like, why do you need this?
You create/modify/remove your own flags, you should know what they are, is there anything specific you're trying to achieve?
uhh
when a features says that you shouldn't use it, what it generally means is that you shouldn't need to use it
If you feel like you need it, you have a design issue
to that end, just recreating it doesn't make a difference
If you are going to do it anyway, just use the easier tag
but ^
I made a flag tool, to show flag status and so on. Now i want to display the list size, if it is a list.
Any idea, how that would work the best?
I Mean, .object_type should work.
^ That counts as debugging, which is what the tag is meant for - it shouldn't be used in any real script as it's generally a sign of bad practice, but in this case you're outputting debug information
Although in this case it's probably a bit redundant, can just
- define size <[object].size.if_null[null]>
- if <[size]> != null:
- narrate "Size: <[size]>"