ID:156682
 
I was thinking about creating an Aging system. Where you gain some experience the more you play. I couldn't get my head around how I was going to achieve this so I'm posting here. I would need to somehow determine whether a player is being active or not. Maybe the Move() proc?
You could look into some AFK demos. They basically do what you're asking for.

http://www.byond.com/ members/?command=search&type=resources&text=AFK
Slic3y wrote:
I was thinking about creating an Aging system. Where you gain some experience the more you play. I couldn't get my head around how I was going to achieve this so I'm posting here. I would need to somehow determine whether a player is being active or not. Maybe the Move() proc?

while(usr.client)
spawn(100) // wait 10 seconds
usr.exp+=100 // give experience
/* This will give them 100 experience every ten seconds, this is only an example, you will need to change the usr.exp, to the var you use for exp, and the '100' inside the spawn proc, to the tiemr between getting experience.
In response to Magicbeast20
Thanks very much. Found what I was after.
Slic3y wrote:
I would need to somehow determine whether a player is being active or not. Maybe the Move() proc?

client.inactivity

This is equal to the amount of time (in 10ths of seconds) since the player's last action (such as executing a verb, moving, clicking an object, or selecting a topic link). This value is reset to 0 after each new action so you can use it to determine the time that has passed since the last one.