Page 1 of 1

[Mod] Away Mod [1.0] [away]

PostPosted: Fri Mar 09, 2012 05:28
by kahrl
This is a simple mod that adds an /away command. It's inspired by jordan4ibanez's extra commands mod, but works slightly differently than its /afk command.

Download
1.0: tar.gz zip
Git: github

License: WTFPL

Basic usage

/away <reason> marks you as being away. The reason is optional. When you're back, simply type /away again. Writing a chat message (except commands) clears your away status too. You can check your away status with the command /away?, and that of other people with /away? <name>.

Other players don't immediately see when you set yourself as away, unless they constantly watch you with /away? yourname. However, when somebody mentions your name in chat, they receive an away notice. If that happens, they're also notified as soon as you come back. The intent of this delayed notice system is to reduce away message spam.

Notes
  • No dependencies. Should be compatible with almost all other mods, if an incompatibility is found I'll list it here.
  • If the name of an away player is mentioned multiple times in succession, only one notice is printed per minute.
  • Players without the shout privilege can not set a reason in /away.
  • Away statuses are not persistent, as that would make no sense. They're cleared when the server quits or the player disconnects (but see "Bugs" below).

Command documentation
  • /away [reason]: If you are not marked as away or a reason parameter is given, marks you as away (or changes the away reason). If you are marked as away and no reason parameter is given, sets you as not away and possibly notifies other players (if they tried to talk to you while you were away).
  • /away? [name]: Checks the away status of the player with the specified name, or yourself if no name parameter is given. Possible statuses are: present, away (<reason>), disconnected.

Bugs
  • Moving around or interacting with things should probably reset the away status. Ideally this should be configurable.
  • Away statuses are not immediately reset when a player disconnects. If the player was marked away and reconnects within 1-2 minutes after disconnecting, he may still be marked away. (Problem: there's no register_on_disconnect callback.)

PostPosted: Fri Mar 09, 2012 05:48
by jordan4ibanez
+1

PostPosted: Fri Mar 09, 2012 08:07
by Jordach
if anyone makes or runs a server should have this.

PostPosted: Fri Mar 09, 2012 12:23
by jordan4ibanez
i see the "theres no register on disconnect" bug..why not have it so if a player reconnects it unmarks him as away

PostPosted: Fri Mar 09, 2012 13:23
by sfan5
Amazing Mod!

PostPosted: Fri Mar 09, 2012 19:25
by kahrl
jordan4ibanez wrote:i see the "theres no register on disconnect" bug..why not have it so if a player reconnects it unmarks him as away


Well... there's no "on connect" either. ;)
Or is there?

PostPosted: Fri Mar 09, 2012 19:30
by sfan5
kahrl wrote:
jordan4ibanez wrote:i see the "theres no register on disconnect" bug..why not have it so if a player reconnects it unmarks him as away


Well... there's no "on connect" either. ;)
Or is there?

There is no "minetest.register_on_connect"... ...sadly

Re: [Mod] Away Mod [1.0] [away]

PostPosted: Tue Mar 07, 2017 19:10
by mr_dean
Is this still even an active mod? and, if so, will it still work with the current version of Minetest?

Re: [Mod] Away Mod [1.0] [away]

PostPosted: Tue Mar 07, 2017 21:32
by kaeza
From a quick look at the sources it looks like it may still work, but do note that it's very outdated and doesn't use capabilities we take for granted now.

You may be better looking for alternatives (unless teh kahrl wants to update :) ). A quick Google search brought up this one.