Log in

View Full Version : Afk


thepoetwarrior
11-19-2012, 09:08 AM
Looking for some ideas on making Anti AFK possible through quest.

Currently have one that if detected does a pop up window to confirm your still active.

Anyone have some new or fresh ideas?

Tabasco
11-19-2012, 11:39 AM
Are you wanting to validate that a player is actually at their keyboard while on follow or boxing, or are you trying to detect idlers?

Secrets
11-19-2012, 11:42 AM
I believe there's a global player.pl in the latest source. Would have to look it up, but that would be a start for something like that.

Basically, when they enter the zone, record their position and set a timer. If they are in the same spot as the last time you checked (set a variable for x and y) do a function similar to the buffbot you had ages ago where it would verify if you were a person or not. (via typing in a random string of characters). If they do not finish the challenge in 1 minute, delete the global and kick the character.

Something like that would be great. Maybe even spawn NPCs on them or something depending on their HP value, or in the case of EZ, check their client flags. Then despawn the NPC after it spawns after 30 seconds. Can even be a random reward for being afk if they kill it. Or rotate between things that happen using chooserandom.

Lots of things you can do. I agree that having one scenario is easily bypassed. RuneScape had the same idea that I am discussing; on almost any action it had a 0.1% chance to trigger a random event. See: http://runescape.wikia.com/wiki/Random_events

thepoetwarrior
11-19-2012, 07:51 PM
I already use global_player.pl file recording their XYZ and re-checking after timer is up with +/- X distance from previous recorded position, then popup window that if they click yes it cancels and restarts the timer else if you dont click popup within X minutes it logs you off.

Interesting idea bout making players type random string to prove not a bot or still at keyboard.

Is it possible to spawn an NPC from the player.pl? I'm not sure if its possible for a player to just say the random text without an NPC targetted.

Turning this unpopular afk script into a 0.1% trigger event would be a neat idea, to have an event. By looking at player flags the event could even be scaled to their tier.

Thanks for the ideas, and still looking for more :)

Secrets
11-19-2012, 08:12 PM
I already use global_player.pl file recording their XYZ and re-checking after timer is up with +/- X distance from previous recorded position, then popup window that if they click yes it cancels and restarts the timer else if you dont click popup within X minutes it logs you off.

Interesting idea bout making players type random string to prove not a bot or still at keyboard.

Is it possible to spawn an NPC from the player.pl? I'm not sure if its possible for a player to just say the random text without an NPC targetted.

Turning this unpopular afk script into a 0.1% trigger event would be a neat idea, to have an event. By looking at player flags the event could even be scaled to their tier.

Thanks for the ideas, and still looking for more :)

It's possible to check that from a script (I know Akkadius did it at one point), and as far as I know you can check player's text via player.pl. I haven't messed with perl in forever sadly, though there may be some player.pl examples scattered around. I'll see what I can dig up about that feature.

edit: this should work as player.pl:


sub EVENT_SAY {
$client->Message(13, "You have said something!");
if($text =~ /match/i)
{
$client->Message(13, "You have said something that matches!");
}
}

c0ncrete
11-19-2012, 11:44 PM
if i remember correctly, dalaya sends you a pop-up with text in a random color and you have to respond with the name of that color to verify you're not running macros whilst fishing and such. also requires that you move from your location after a handful of casts because you've fished that spot out. not sure if they do that all via script or if it's hard-coded, but they have a number of things like that.

thepoetwarrior
11-20-2012, 02:28 AM
I didn't realize sub EVENT_SAY worked in player.pl figured it worked on NPC quest and needed an NPC targetted to work.

Will try that out soon to see if it works. I'm sure we can get create way to figure out if players are afk and I like the rare random event idea too.

trevius
11-20-2012, 06:05 AM
Well, the client automatically sends an AFK packet after no client interaction for 15 minutes. We currently don't have packet handling built for it, so it is just ignored for now. It would be pretty trivial to add handling for that packet that would simply set a character flag/variable and add a new sub EVENT_AFK that would trigger in player.pl so you could do whatever you want when a player goes into an AFK state.

I have thought about doing this many times, but I would have to check out the packets again to see if they send any different data for when a player goes from AFK back to active again. IIRC, the client just sends the same 0 sized AFK packet when the player interacts with the client again after AFK was sent. If no data is in the packet, that just means we have to maintain their AFK status server-side (which is probably needed anyway).

To add to this, we could also probably implement an auto /afk message rule for servers that wanted to use it. Then, when a client sends that AFK packet, we could actually set them with the AFK flag and give a default AFK message if they get any tells while flagged as AFK. This part might be slightly more complicated to add in, but shouldn't be too bad and would of course be an optional rule setting. The only issue I see with this idea is that we would also need to remove the AFK flag and auto-response message if the player interacts with the client again. This would probably also have to remove the AFK flag for people that used the /afk command, which would not be idea. If different packets are send for the command vs the auto-afk packet, we should be able to just track both as variables and then handle each type of AFK appropriately.

Maybe I will look into this if I get some free time, but don't hold me to it!