Results 1 to 5 of 5
  1. #1
    Grooguz
    Grooguz is offline
    BanHammer Holder
    Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    537
    Thanked in
    167 Posts
    Rep Power
    14

    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
    julian
    julian is offline
    Guest
    Join Date
    2012 Feb
    Posts
    2
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    How do you run this ??

  3. #3
    Dwar
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Posts
    2,222
    Thanks Thanks Given 
    211
    Thanks Thanks Received 
    2,230
    Thanked in
    292 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
    PAPY MARCEL
    PAPY MARCEL is offline
    Guest
    Join Date
    2013 May
    Posts
    1
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0
    Can you explain how to use this script with Firefox and Greasemonkey. thank you

  5. #5
    DopeDoD
    DopeDoD is offline
    New member
    Join Date
    2013 Nov
    Posts
    9
    Thanks Thanks Given 
    2
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Rep Power
    0

    Greasemonkey

    Hey there,

    I noticed in many topics that people don't know how to run certain script codes (), using greasemonkey it's easy and it takes no more then 2m for you to get it all set up, just download Mozilla Firefox if you don't have it, install GreaseMonkey from mozilla site : Most recent : https:// addons.mozilla.org/pt-pt/firefox/addon/greasemonkey/ (take the spaces off, it won't let me post link with post countdown 0 :p).
    Then right click over it, select the create a new script option, paste the code save it and run it on the specific page/game.
    It's also easy to change it, you can do it directly from the code u've charged or just use notepad++ and check it, change it, test it, to get it better. In the forum there are already many guides how to program, script, c++, html5, bla bla so just spend some days here and everyone can learn how to improve/create the codes

    Cheers

Similar Threads

  1. [Bot] Grepolis Auto farming, building, attacking bot
    By Grooguz in forum Browser Games
    Replies: 19
    Last Post: 2017-10-09, 03:32 AM
  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, 10: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

Tags for this Thread

Posting Permissions

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