#(sytek3299) new tag for server.player_is_valid, if <context.server>
23 messages · Page 1 of 1 (latest)
(sytek3299) new tag for server.player_is_valid
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.
(sytek3299) new tag for server.player_is_valid, if <context.server>
!t server.match_player
Returns the online player that best matches the input name.
EG, in a group of 'bo', 'bob', and 'bobby'... input 'bob' returns player object for 'bob',
input 'bobb' returns player object for 'bobby', and input 'b' returns player object for 'bo'.
PlayerTag
thanks
then i need to check if that not null
unlike old tag player_is_valid return true false
if no other option then ill take it
I assume you could do <server.match_player[].is_online.if_null[false]> or <server.match_player[].is_truthy.if_null[false]>
!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)
^ it's already a fallback, no need for an extra if_null
Also pretty sure player_is_valid was just a "whether the server has a player by that name", not an online check
But depending on what you're doing you probably don't need that sort of check anymore, e.g. if it's in a command script you'd just
- define player <server.match_player[<context.args.first>].if_null[null]>
- if <[player]> == null:
- narrate bad
- stop
- do things
I.e. just get the player once with a fallback instead of having 2 separate checks
Right xP
cool so we have is_truthy too
its gonna take me sometime to get familar with all the new tags
thank you
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.)
@tawny junco