The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[FUNCTION] Automatic AFK Check
Author Message
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #1
[FUNCTION] Automatic AFK Check
Hello everyone,

I'm going to share some scripts that although have been made for a very peculiar kind of server, some of you may find them interesting and useful and could adapt them to your own servers.

_______________________________________________________________

Regardless if your server doesn't allow AFK Macroing at all or just doesn't allow players to be AFK Gathering resources, this may be useful to you.

This script is an Automated AFK Check, that although optimized to prevent AFK Gathering, can be easily changed to prevent any other kind of AFK.

It is up to you to decide when and where will this function be triggered. (At the end of this script, after the [EOF], you have an example of how I was triggering it.)

Once triggered, players will find themselves with the following dialog at their screen:

[Image: afk.jpg]

Players then have 5 minutes to answer correctly to the question (There are several "questions" available, which will be randomly picked on trigger.).

If they answer correctly, they can carry on with their actions and the Automatic Afk Check won't pop up again for 60 minutes.

However, if players fail to answer the question within 5 minutes or answer it wrong, all their resources will be removed (Backpacked and inside nearby Pack Horses) and no delay will be applied (Meaning they can be AFK checked again right after.).

The presented timers can be changed easily, as obvious.

Changing the function "afkcheckpunishment" (A.k.a. what will happen if you fail to answer the AFK Check) and when should the presented script be triggered is enough to adapt this script to any of your server needs regarding AFK macroing.

I guess I'm not forgetting anything, if you have any doubt just ask. The script should be easy to understand and adapt to your needs.


Attached File(s)
.scp  p_afk_check.scp (Size: 12.15 KB / Downloads: 39)
(This post was last modified: 08-16-2015 02:40 AM by pointhz.)
08-16-2015 01:08 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 5 users Like pointhz's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)