Jesse60905 Posted June 4, 2007 Posted June 4, 2007 I have a free host with cpanel, mysql databases, cronjobs, and a almost fully modded version of Mc lite. My only problem is that my crons do not seem to want to work. What is my problem? Cron_Day.php <?php /* MCCodes Lite cron_day.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ include "mysql.php"; global $c, $mykey; $path=$_SERVER['HTTP_HOST'].str_replace('cron_day.php','',$_SERVER['SCRIPT_NAME']); if($_GET['code'] != md5($path.$mykey)) { exit; } mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); ?> Cron_fivemins.php <?php /* MCCodes Lite cron_fivemins.php Rev 1.0.1 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ include "mysql.php"; global $c, $mykey; $path=$_SERVER['HTTP_HOST'].str_replace('cron_fivemins.php','',$_SERVER['SCRIPT_NAME']); if($_GET['code'] != md5($path.$mykey)) { exit; } $query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy$query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy"; $query3="UPDATE users SET will=will+10 WHERE will$query4="UPDATE users SET will=maxwill WHERE will>maxwill"; mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno()); $query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave$query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave"; $query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp$query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno()); ?> Quote
Silver Posted June 5, 2007 Posted June 5, 2007 Re: Cron Jobs on Lite you need to get the md5 hash code for them. You can get this by doing the following...add this code: <?php $path=$_SERVER['HTTP_HOST'].str_replace('installer.php','',$_SERVER['SCRIPT_NAME']); $cj1="http://".$path."cron_fivemins.php?code=".md5($path.$mykey); $cj2="http://".$path."cron_day.php?code=".md5($path.$mykey); print "$cj1 $cj2"; ?> to a new page called: croncode.php into the folder where your crons are located. On your game go to http://yourgame.com/croncode.php you should see some example links and on the end say something like: ?code=ngiueht8932y5efhsith399fs copy that part and paste it onto the end of each cron path in your cpanel cron manager. If you dont understand or need further help add me to msn: [email protected] Quote
Jesse60905 Posted June 5, 2007 Author Posted June 5, 2007 Re: Cron Jobs on Lite you need to get the md5 hash code for them. You can get this by doing the following...add this code: <?php $path=$_SERVER['HTTP_HOST'].str_replace('installer.php','',$_SERVER['SCRIPT_NAME']); $cj1="http://".$path."cron_fivemins.php?code=".md5($path.$mykey); $cj2="http://".$path."cron_day.php?code=".md5($path.$mykey); print "$cj1 $cj2"; ?> to a new page called: croncode.php into the folder where your crons are located. On your game go to http://yourgame.com/croncode.php you should see some example links and on the end say something like: ?code=ngiueht8932y5efhsith399fs copy that part and paste it onto the end of each cron path in your cpanel cron manager. If you dont understand or need further help add me to msn: [email protected] I have the code already in there but I can add more info: The cron output e-mail told me this: Status: 404 X-Powered-By: PHP/4.4.6 Content-type: text/html No input file specified. I hope now someone can give me more insight to what the problem is... Quote
Silver Posted June 5, 2007 Posted June 5, 2007 Re: Cron Jobs on Lite so on ur cron manager you have the timings and the file path correct? Quote
Jesse60905 Posted June 6, 2007 Author Posted June 6, 2007 Re: Cron Jobs on Lite Yes, I have tried with the code, without the code, with curl, without curl, with php, without php and all other combinations. Took me about 2 hours. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.