#(Danjoe3) Inactive player feature

31 messages · Page 1 of 1 (latest)

boreal gull
#

Hey guys,

I'm working on creating an inactive player feature for the server. The idea is to have a UI pop up if a player has been standing still and inactive for 3 minutes, asking if they are still there. However, I'm having trouble figuring out how to detect if a player has been inactive for those 3 minutes. Does anyone have any suggestions or ideas on how I can implement this feature?

Thanks for your help!

proper snowBOT
#

(Danjoe3) Inactive player feature

proper snowBOT
#

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.

wheat spade
#

!e player moves

dense beaconBOT
# wheat spade !e player moves
Cannot Specify Searched Event

Multiple possible events: vehicle moves, player item takes damage, player clicks in inventory.

wheat spade
#

Hmm.

#

!e entity moves

dense beaconBOT
wheat spade
#

!e player steps

dense beaconBOT
# wheat spade !e player steps
Group

Player

**WARNING**

This event may fire very rapidly.

Event Lines

player steps on block player steps on <material>

Triggers

when a player steps onto a specific block material.

Has Player

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

Context

<context.location> returns a LocationTag of the block the player is stepping on.
<context.previous_location> returns a LocationTag of where the player was before stepping onto the block.
<context.new_location> returns a LocationTag of where the player is now.

Has Known Location

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

Cancellable

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

wheat spade
#

Will have to listen to the player moving around, clicking on blocks, chatting, etc.

boreal gull
#

So check if previous location == new location , if yes wait for 3 mins and then do the necessary UI pop?

wheat spade
#

Sounds right, maybe a last_active flag or something so you can check how long it's been since they've been considered 'active'. Damaging other entities themself, interacting with inventories or blocks, etc.

weak mica
#

I have a timer and use a flag with

#

!t last_player_action

dense beaconBOT
#
Possible Confusion

Did you mean to search for entitytag.last_interaction?

weak mica
#

!t last_action

dense beaconBOT
wheat spade
#

Oh is that a thing?

#

That's so much easier.

boreal gull
#

So sorry for the delay in response. But the logic is, check if previous_location == new_location; if yes, wait for 3 minutes and then do the necessary functions?

boreal gull
# dense beacon

I'd have to test how this would look like, would it show 3 mins?

wheat spade
#

It'll return a timetag.

#

So you'll probably want to to

#

!t timetag.from_now

dense beaconBOT
# wheat spade !t timetag.from_now

Returns the DurationTag between this time object and the real current system time.
The value will always be positive.
This is equivalent to the absolute value of ".duration_since[<util.time_now>]", and exists primarily as a convenience tag.
For example, a TimeTag for Tuesday will return a DurationTag of '1d' when the tag is used on a Monday.
A TimeTag for Sunday will also return a DurationTag of '1d' when used on a Monday.
If positive/negative differences are required, consider instead using !tag TimeTag.duration_since.

Returns

DurationTag

gloomy saddle
#

Feel free to ask if you need any more help, otherwise -

rustic lotusBOT
#
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.)

#

@boreal gull