kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

1.20.4: timed.rs Select random message line #2613

Closed Denial234 closed 3 months ago

Denial234 commented 3 months ago

Are you using MySQL?

No

Are you using BungeeCord/Velocity?

No

Question

I recently started working on server tips for the server and wanted the plugin to send json messages every 600 seconds. I read in the wiki that if you add multiple lines the plugin would randomly pick one of the lines which i can't really get to work.

Although the lines work properly and the plugin sends them as i want them to, they just go from top to bottom which is the problem i am trying to solve.

group json-sample delay 10 seconds prefix [JSON] message:

The plugin sends them in order every 600 seconds but how do i make it so that the messages are randomized and make the plugin pick one randomly out of the 3 lines every 600 seconds instead of going from top to bottom?

kangarko commented 3 months ago

Does it work with smaller delays such as "delay 10 seconds"? Or is it only broken with "delay 10 minutes" ?

kangarko commented 3 months ago

Closing due to inactivity, comment below when you come back

Denial234 commented 3 months ago

The delay is not the problem, i tried 10 seconds 10 minutes and it works fine. Its just that it goes down the list from top to bottom but i would like the plugin to select random lines instead. Randomly between the 3 messages. instead of going 1 2 3 1 2 3 1 2 3 i would like it to be randomized.

The first message sends then the second then the third every 10 seconds as i want it to. But i want it to be randomized.

v4rl1 commented 3 months ago

I've got the same issue with join messages which are read from top to bottom and not randomly as stated in the wiki

kangarko commented 3 months ago

Hmm you are right, not sure when did that change. I added a new operator "random" that will turn the random mode back on. Sorry and thanks for your patience!

Example:

group json-sample
prefix [JSON]
random
message:
- {"text":"Message 1"}
- {"text":"Message 2"}
- {"text":"Message 3"}

That should do the trick from the next version!

kangarko commented 3 months ago

If you appreciated the fix consider dropping a quick review please :)

v4rl1 commented 3 months ago

Thank you very much !