Results 1 to 4 of 4
  1. #1
    BanHammer Holder
    Grooguz will become famous soon enough Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks
    152
    Thanked 537 Times in 167 Posts
    Rep Power
    5

    Grepolis Auto Farm Script

    Just found script for autofarming in Grepolis. Does not tested.
    Code:
    /*!
     * Auto Farm for Grepolis
     * Relaxeaza, 2011
     */
    
    var timeOuts = timeOuts || {};
    
    (function() {
    	// abandonedId: [ haulType, fromVillageId ]
    	var targets = {
    		256: [ 1, 275 ]
    	},
    	// haulType's
    	timers = {
    		1: [ 3E5, 300 ], // 5 min
    		2: [ 12E5, 1200 ], // 10 min
    		3: [ 72E5, 7200 ], // 120 min
    		4: [ 18E6, 18000 ] // 300 min
    	},
    	re = {
    		moral: /Moral\s(\d+)\%/,
    		object: /({.*})/,
    		timer: /(\d+:\d+:\d+)/,
    		res: /"resources":{"wood":(\d+),"stone":(\d+),"iron":(\d+)}/,
    		pop: /"population":(\d+)/,
    		favor: /"favor":(\d+)/
    	};
    	
    	function url( type, town ) {
    		return '/game/farm_town_info?action=' +
    			( type ? 'pillage_info' : 'claim_load' ) + '&town_id=' +
    				town + '&h=' + Game.csrfToken;
    	}
    	
    	function prepare( target, settings ) {
    		var moral, next;
    		
    		$.ajax({
    			url: url( 1, settings[ 1 ] ),
    			type: 'post',
    			data: {
    				json: '{"id":"' + target + '"}'
    			},
    			error: function() {
    				prepare( target, settings );
    			},
    			success: function( data ) {
    				data = re.object.exec( data )[ 1 ];
    				data = JSON.parse( data );
    				
    				moral = Number( re.moral.exec( data.html )[ 1 ] );
    				next = re.timer.exec( data.html );
    				
    				complete( target, settings, moral, next );
    			}
    		});
    		
    		return false;
    	}
    	
    	function complete( target, settings, moral, next ) {
    		var args = arguments;
    		
    		$.ajax({
    			url: url( 0, settings[ 1 ] ),
    			type: 'post',
    			data: {
    				json: JSON.stringify({
    					target_id: target,
    					claim_type: moral && moral > 91 ? 'double' : 'normal',
    					town_id: Game.townId,
    					time: timers[ settings[ 0 ] ][ 1 ],
    					nlreq_id: 0
    				})
    			},
    			error: function() {
    				complete.apply( null, args );
    			},
    			success: function( data ) {
    				var res = re.res.exec( data );
    				
    				if ( res ) {
    					var curr = ITowns.getResources( Game.townId );
    					
    					if ( curr.wood < res[ 1 ] ) {
    						ITowns.setResources({
    							wood: res[ 1 ],
    							stone: res[ 2 ],
    							iron: res[ 3 ]
    						}, Game.townId);
    					}
    					
    					if ( !timeOuts[ target ] ) {
    						setTimeout(function() {
    							timeOuts[ target ] = false;
    							
    							prepare( target, settings );
    						}, timers[ settings[ 0 ] ][ 0 ]);
    						
    						timeOuts[ target ] = true;
    					}
    				} else if ( next && !timeOuts[ target ] ) {
    					next = next[ 1 ].split( ':' );
    					next = next[ 0 ] * 36E5 + next[ 1 ] * 6E4 + next[ 2 ] * 1E3;
    					
    					setTimeout(function() {
    						timeOuts[ target ] = false;
    						
    						prepare( target, type );
    					}, next);
    					
    					timeOuts[ target ] = true;
    				}
    			}
    		});
    	}
    	
    	for ( var id in targets ) {
    		if ( typeof timeOuts[ id ] === 'undefined' ) {
    			timeOuts[ id ] = false;
    		}
    		
    		prepare( id, targets[ id ] );
    	}
    })();

  2. #2
    Inactive julian is on a distinguished road
    Join Date
    2012 Feb
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    How do you run this ??

  3. #3
    Veteran Dwar is on a distinguished road Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,214
    Thanks
    210
    Thanked 2,220 Times in 286 Posts
    Rep Power
    10
    Quote Originally Posted by julian View Post
    How do you run this ??
    I think, you should use FireFox and Greasemonkey to run it
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

  4. #4
    Guest PAPY MARCEL is an unknown quantity at this point
    Join Date
    2013 May
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Can you explain how to use this script with Firefox and Greasemonkey. thank you

Similar Threads

  1. [Bot] Grepolis Auto farming, building, attacking bot
    By Grooguz in forum Browser Games
    Replies: 18
    Last Post: 2012-12-06, 03:14 PM
  2. [Bot] BOI Key Auto Skill + Auto Pot + Auto Tab Monster macro
    By Grooguz in forum Battle of the Immortals
    Replies: 2
    Last Post: 2012-01-21, 09:09 PM
  3. Farm bot over 100 meters?
    By h3lpless in forum Perfect World
    Replies: 3
    Last Post: 2011-08-26, 02:25 PM
  4. [Help] Making Farm Bot
    By paulosousa12 in forum Perfect World Bots, Cheats
    Replies: 7
    Last Post: 2011-07-13, 10:07 PM
  5. [Bot] Resource Farm Bot
    By MrSmith in forum Perfect World Bots, Cheats
    Replies: 6
    Last Post: 2011-07-06, 01:29 AM
Visitors found this page by searching for:

grepolis auto farm bot

grepolis scripts

grepolis autofarm script

grepolis farm script

grepolis farming script

grepolis macro

grepolis farming bot

grepolis autofarm

grepolis farmbot

scripts grepolis

grepolis scripts 2.0

grepolis 2.0 scripts

auto farm bot grepolis

скрипты для греполисgrepolis script farminggrepolis bot scriptscript for grepolisscript grepolis farmingscripts grepolis 2.0grepolis auto farming scriptgrepolis 2.0 farming botgrepolis auto farminggrepolis scripts for farmingscript bot grepolisgame.csrftoken

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts