#(hmoe) monthly bonus script

1 messages · Page 1 of 1 (latest)

surreal lark
#

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?

worldly glacierBOT
#

(hmoe) monthly bonus script

worldly glacierBOT
#

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>

mystic bloom
#

!e system time

ashen boneBOT
# mystic bloom !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
mystic bloom
#

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

surreal lark
#

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

mystic bloom
#

hmm good idea

#

@placid linden <util.time_now>

#

oop still dead

surreal lark
#

<util.time_now.day> prints a beautiful 3

#

so if that = 1, then it must be a new month, clear the flag

mystic bloom
#

gg

surreal lark
#

denizen aint so bad after all

mystic bloom
#

thru denizen all things are possible

modest kettle
#

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 ^

surreal lark
modest kettle
#

!c flag

ashen boneBOT
# modest kettle !c flag
Group

core

Syntax

flag [<object>|...] [<name>([<#>])](:<action>)[:<value>] (expire:<time>)

Short Description

Sets or modifies a flag on any flaggable object.

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>]>

modest kettle
#

expire:<time> - it can take a TimeTag

surreal lark
#

What TimeTag could I use for this though?

#

It needs some sort of logic in the time tag

past falcon
#

!t <TimeTag.start_of_month>

ashen boneBOT
past falcon
#

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

modest kettle
#

Can just get the start of the next month and set the flag to expire then

#

Then just check for the flag

past falcon
#

oh yea

#

expire:<util.time_now.start_of_month.add[1m]>

#

this right?

modest kettle
#

That's 1 minute

#

Maybe something with

#

!t TimeTag.days_in_month

ashen boneBOT
modest kettle
#

!t TimeTag.day

ashen boneBOT
modest kettle
#

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 ^?

surreal lark
#

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?

rough otter
#

!t next_day_of_month

ashen boneBOT
# rough otter !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

rough otter
#

@modest kettle @surreal lark ^ next_day_of_month[1]

surreal lark
#

Beautiful!! Thanks

modest kettle
#

oo nice

#

If this is resolved then

still knollBOT
#
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