#(kepoivey) kepoivey player chats with message switchs

67 messages · Page 1 of 1 (latest)

verbal zephyr
thin vineBOT
#

(kepoivey) kepoivey player chats with message switchs

thin vineBOT
#

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.

verbal zephyr
#

I don't see my original message, is my discord bug or no other can see my original message ?

rugged pier
#

!E chat

orchid lynxBOT
# rugged pier !E chat
Group

Player

**WARNING**

Using this will forcibly sync the chat thread.

Event Lines

player chats

Switches

message:<matcher> to only process the event if the chat message matches an advanced matcher.

Triggers

when a player chats.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.message> returns the player's message as an Element.
<context.format> returns the chat message's raw format.
<context.full_text> returns the full text of the chat message (ie, the written message with the format applied to it).
<context.recipients> returns a list of all players that will receive the chat.

Determine

ElementTag to change the message.
"FORMAT:<ScriptTag>" to set the format script the message should use.
"RAW_FORMAT:<ElementTag>" to set the format directly (without a format script). (Use with caution, avoid if possible).
"RECIPIENTS:<ListTag(PlayerTag)>" to set the list of players that will receive the message.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

rugged pier
runic flint
#

but this should also somehow be doable with the message switch

#

how can a space be used in a switch?

#

that seems to be the issue

rugged pier
#

hmm

#

!lang advance matching

orchid lynxBOT
#
Possible Confusion

Did you mean to search for advanced object matching?

runic flint
#

Dis<&sp>Sage doesn't work since you can't have any tags there

orchid lynxBOT
# rugged pier !lang advance matching

Script event lines often include specific 'matchable' keywords.
For example, while you can write "on player breaks block:" as a script event line,
you can also instead write "on player breaks stone:" to listen to a much more specific event.
This is general in-line matching.
This is made available to avoid needing to do things like "- if <context.material.name> == stone"
just to validate whether an event is even relevant to you.

Of course, there are times when you want to more than one specific thing to be handled by the event, so what do you do?
The Denizen script event system provides a few 'advanced' options to get more detailed matching.

One option is to use wildcards.
For example, there are several 'log' materials, such as 'oak_log', 'birch_log', and more for the rest of the tree typ...

Group

Object System

runic flint
lusty finch
#

"message:dis sage" not as well?

verbal zephyr
#

Oh ok, so don't work because they are a Space ? If at place of "Dis Sage" i put "Dis_Sage" is good ? But player need write exactly "Dis_Sage", is that?

rugged pier
runic flint
#

that would work

runic flint
#

nah an issue should be fixed instead of working around it

verbal zephyr
#

In the script ? - if <context.message> == Dis Sage: ? And the script after

runic flint
#

but vscode extension is saying that it's wrong

runic flint
verbal zephyr
#

Ok thanks, i try that in 5/10 minutes

runic flint
#

works but vscode complains

verbal zephyr
#

Okey thanks ^^

runic flint
#

you could also reduce this

- if <player.has_flag[cooldownSage]>:
    - narrate targets:<player.name> "<&2>[Sage]<&a>Cette commande n'es utilisable qu'une fois par jour"
    - stop
- if !<player.has_flag[cooldownSage]>:
    - flag <player> QuestionSage
    - narrate "<&2>[Sage]<&a>Qu'elle es ta question <player.name>?"
    - stop

to this:

- if <player.has_flag[cooldownSage]>:
    - narrate targets:<player.name> "<&2>[Sage]<&a>Cette commande n'es utilisable qu'une fois par jour"
- else:
    - flag <player> QuestionSage
    - narrate "<&2>[Sage]<&a>Qu'elle es ta question <player.name>?"
lusty finch
#

em what the sigma

runic flint
#

oh lol

#

remove that too

#

like this then:

- if <player.has_flag[cooldownSage]>:
    - narrate "<&2>[Sage]<&a>Cette commande n'es utilisable qu'une fois par jour"
- else:
    - flag <player> QuestionSage
    - narrate "<&2>[Sage]<&a>Qu'elle es ta question <player.name>?"
runic flint
runic flint
#

my bad

#

so we still need a fix for that one

#

so vscode didn't complain for no reason xd

cold lily
runic flint
#

exactly

cold lily
#

i recommend you use

after player chats:
        - if <context.message> == <element[dis sage]>:
          - narrate worked
runic flint
#

yes but it should still somehow be doable through the switch

cold lily
#

why is that necessary?

flat epoch
flat epoch
#

== "my text" should be fine

cold lily
#

happens

runic flint
flat epoch
#

But doubt you can match for multiple words containing spaces in the event line itself

lusty finch
#

iirc regex is supported so maybe with that somehow?

flat epoch
#

It's not a huge performance difference, just check under the event line

lusty finch
runic flint
#

i just feel like this might have happened to somebody else too because it does seem like it should just work

verbal zephyr
#

Thanks all it's worked like that ^^ and code is good 😄

            - if <context.message> == <element[Dis Sage]>:
                - if <player.has_flag[cooldownsage]>:
                    - narrate "<&2>[Sage]<&a>Cette commande n'es utilisable qu'une fois par jour"
                - else:
                    - flag <player> QuestionSage
                    - narrate "<&2>[Sage]<&a>Qu'elle es ta question <player.name>?"```
runic flint
#

do == "Dis Sage" instead

#

simpler

verbal zephyr
#

Okey thanks ^^

flat epoch
#

Feel free to ask if you have any more questions, otherwise-

brave flumeBOT
#
Thread Closing Reminder

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.)

#

@verbal zephyr