Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[v1.4] Automatic barbarian village grow
#1
NOTE: The script works on every version.

INSTALLATION:
  1. Execute the next query in PMA:
    PHP Code:
    ALTER TABLE villages ADD last_grow BIGINT(10UNSIGNED NOT NULL
  2. Copy the auto_build.php file from the attachment (right below this text) and paste it into htdocs/.
  3. Open http://localhost/auto_build.php and let that broser tab open.
  4. 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.
DOWNLOAD: SPEEDYSHARE.COM

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>'
;
?>
Reply


Messages In This Thread
Automatic barbarian village grow - by sinner - 08.08.2011, 16:52



Users browsing this thread: 3 Guest(s)