Page 5 of 5

Re: crons

Posted: Tue Aug 09, 2011 8:07 am
by Jackolantern
Actually that is a pretty common technique that has been unofficially dubbed the "On Page View" method. You just have a related action that the players take check the last time the code portion was run in the database (or check whatever else you want it to run on) to see if the cron-like part of the script needs to run. Because, if no player sees the page that needs the cron-like script to run, then it likely doesn't matter if it has run at all, if that makes any sense lol. Of course, this method is not recommended for very sensitive scripts, such as those that add to all player's stats (such as auto-healing crons, refilling action points, etc.), because it is possible, although unlikely if you test the times with enough precision, that the script can be run more than once per "tick".