NOTE: The script works on every version.
INSTALLATION:
UPDATE, OPENSOURCE:
INSTALLATION:
- Execute the next query in PMA: PHP Code:
ALTER TABLE villages ADD last_grow BIGINT(10) UNSIGNED NOT NULL;
- Copy the auto_build.php file from the attachment (right below this text) and paste it into htdocs/.
- Open http://localhost/auto_build.php and let that broser tab open.
- By default, it will refresh every 120 seconds, and grow some villages, level by level. You can optionally modify that setting to 200 seconds or whatever.
UPDATE, OPENSOURCE:
PHP Code:
<?php
include('include/config.php');
include('include.inc.php');
mysql_connect($config['db_host'], $config['db_user'], $config['db_pw']);
mysql_select_db($config['db_name']);
$seconds = 120;
$max_points = 3000;
$ttw=rand(5*60*60,6*60*60); // time to wait untill a village can grow again
$q=mysql_query("SELECT id,main,barracks,stable,garage,smith,place,market,wood,stone,iron,farm,storage,hide,wall,points,last_grow FROM villages WHERE userid = -1 AND points <= ".$max_points);
while ($r=mysql_fetch_array($q)){
$l_grow = $r[last_grow];
$grow=$l_grow+$ttw;
if($grow<= time()){
$rand=rand(0,14);
$g = $b[$rand];
if ($bl[$rand] > $r[$g]) mysql_query("UPDATE villages SET ".$g." = ".$r[$g]."+1, last_grow = ".time()." WHERE id = $r[id]");
load_bh($r[id]); // added for the village farm to update itself.
}
}
reload_all_village_points();
echo '<html>
<head>
<title>SINNER - TWLAN.ORG</title>
<meta http-equiv="refresh" content="'.$seconds.'">
</head>
<body>
GROWING DONE ! SINNER (TWLAN.ORG) !
</body>
</html>';
?>