i'd like to create a GUI with buttons for different ranks. when someone who has a permission clicks the button, they receive some items, and then they get flagged to not be able to click that button until a new month begins. I think the best option would be to flag the players when they click the button, and then when the new month begins, clear the flag. But, what event would I use for checking when the new month begins?
#(hmoe) monthly bonus script
1 messages · Page 1 of 1 (latest)
(hmoe) monthly bonus script
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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
!e system time
Group
Core
Event Lines
system time <HH:MM> system time hourly|minutely|secondly
Switches
every:<count> to only run the event every *count* times (like "on system time secondly every:5" for every 5 seconds).
Triggers
when the system time changes to the specified value.
The system time is the real world time set in the server's operating system.
It is not necessarily in sync with the game server time, which may vary (for example, when the server is lagging).
For events based on in-game time passage, use !event delta time or !command wait.
Context
<context.hour> returns the exact hour of the system time.
<context.minute> returns the exact minute of the system time.
Examples
on system time hourly:
- announce "Whoa an hour passed!"
on system time 12:00:
- announce "Whoa it's noon!"
on system time 03:00:
- announce "Daily restart in 5 minutes!"
- wait 5m
- adjust server restart
you'd have to do system time 00:00 and build your logic
frankly ive got no clue for the logic part lmao but heres your event
ok this is pseudo code but im thinking:
on system time 00:00
- check if util.time_now trimmed to day = 01
- if it is, clear the flag
that wasnt so hard lol
ill test it out
<util.time_now.day> prints a beautiful 3
so if that = 1, then it must be a new month, clear the flag
gg
denizen aint so bad after all
thru denizen all things are possible
Um
You can just set the flags expiration to a month later?
Or to the start of the next month, depending on what you want exactly
CC @mystic bloom @surreal lark ^
I want the flag to expire on the 1st of every month. I thought flag expiry wasn’t able to do specific dates
!c flag
Group
core
Syntax
flag [<object>|...] [<name>([<#>])](:<action>)[:<value>] (expire:<time>)
Short Description
Sets or modifies a flag on any flaggable object.
Related Guide Page
Description
The flag command sets or modifies custom data values stored on any flaggable object (the server, a player/NPC/entity, a block location, ...).
See also !language flag system.
This command supports data actions, see !language data actions.
Flags by default are added permanently (or for the lifetime of the object they're attached to).
You can optionally specify a system time the flag will expire at, using either a DurationTag or a TimeTag.
If a DurationTag is used, it will be equivalent to: <util.time_now.add[<your_duration_here>]>
expire:<time> - it can take a TimeTag
What TimeTag could I use for this though?
It needs some sort of logic in the time tag
!t <TimeTag.start_of_month>
Returns this time tag, with the day/hour/minute/second/millisecond zeroed (that is, midnight the morning of the first day of the same month).
Returns
TimeTag
is that useful maybe?
flag the player for <util.time_now.start_of_month> and then each time the player opens that gui check if <util.time_now.start_of_month> is diffrent this time
thats how i would do it
Can just get the start of the next month and set the flag to expire then
Then just check for the flag
Returns the number of days in the month that this TimeTag is within.
Returns
ElementTag(Number)
!t TimeTag.day
Returns the day-of-month of this TimeTag, starting at 1.
Returns
ElementTag(Number)
To get the last day, then go 1 day forward? some start_of_next_month or whatever might be a valid feature request, but I believe that should work ^?
Expiry:<util.time_now.start_of_month.add[<util.time_now.days_in_month>]>
Something like that should work right? Wonder if that would be the last day of the month. Add another day to that?
!t next_day_of_month
Returns the timetag of the next occurrence of the specified day-of-month.
This can either be in the same month, or the next month.
For example, next_day_of_month[1] on a TimeTag on January 3rd will return the 1st of February.
The hour/minute/second/millisecond will be zeroed.
Be careful with inputs of 29/30/31, as only some months contain those days.
Returns
TimeTag
@modest kettle @surreal lark ^ next_day_of_month[1]
Beautiful!! Thanks
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.)
@surreal lark