Time condition
So doing a time condition, anywhere between 1-24 works.... but I find that as soon as you go past midnight it no longer works.
For instance if I do if time in world of player is between 18:00 and 23:59: it works, but if I do if time in world of player is between 18:00 and 6:00: it does not work
The example in the Bensku docs is as follows time in world is between 18:00 and 6:00:
Probably just order is the issue here, it would be grabbing 6:00-18:00. Place AM or PM after it and make it a 12 hour format to fix. There are multiple time formats.
Regardless of if changing it to a 12 hour format would fix it (not sure if it would), this method should work since the docs do literally use this exact example as was pointed out.
I assume you're on the latest Skript version @ShaneBeee ?
Correct @TheBentoBox
Dev36.
And I agree. If it’s in the docs like that it should work like that.
I know this is already marked as a bug, but I just wanted to let @TheLimeGlass know that the AM/PM add did nothing.
for example, I did set my time to 8pm, and tried this:
command /test:
trigger:
if time in world of player is between 6pm and 1am:
send "TRUE" to player
nothing shows up if I do this:
command /test:
trigger:
if time in world of player is between 6pm and 11pm:
send "TRUE" to player
then TRUE pops up on my screen.
Related issue from past fork: https://github.com/Mirreski/Skript/issues/45
I've ran into the same issue now:
command /clock:
trigger:
set {_p} to player
if time in {_p}'s world is between 22:00 and 2:00:
send "Actual time: %time in {_p}'s world%" to console
send "Skript's decision: between 22:00 and 2:00" to console
else:
send "Actual time: %time in {_p}'s world%" to console
send "Skript's decision: not between 22:00 and 2:00" to console
Output:
[11:55:59 INFO]: TestPlayer_1 issued server command: /clock
[11:55:59 INFO]: Actual time: 12:00
[11:55:59 INFO]: Skript's decision: between 22:00 and 2:00
[11:56:04 INFO]: TestPlayer_1 issued server command: /time set midnight
[11:56:04 INFO]: [TestPlayer_1: Set the time to 18000]
[11:56:07 INFO]: TestPlayer_1 issued server command: /clock
[11:56:07 INFO]: Actual time: 0:00
[11:56:07 INFO]: Skript's decision: not between 22:00 and 2:00
Is there any workaround available?
Thanks a lot!
Workaround could be anything that doesn't use the between condition, for example time in {_p}'s world is greater than 22:00 or time in {_p}'s world is less than 2:00 (not valid syntax with or, you'll have to do this in multiple lines)
I'm looking to automate reading from a file for specific time drops, so I'll probably do this with reflect, thanks for the idea though!
This is actually a little more serious than first reported: not only does the condition not pass as expected, it is actually backwards since CondCompare checks both forwards and backwards,
which is the correct behaviour for numbers but is wrong for any cyclical value or wave function like times or degrees, where
00:01 is either after or beford 23:59 depending on the situation, but never both.
I expect this will need a special case in the comparison condition.