Grepolis AutoIt scripts generator

10/10/2010 01:11 io.#1
Hi,

I have created an [Only registered and activated users can see links. Click Here To Register...] script generator for Grepolis.
It has limited actions, I mainly wrote it to attack, conquer and support conquered city (just after conquest) when I was sleeping ;)

It works pretty nice on french server(s) (I'm using it only in one world), and it should work on other servers too... at least if the display structure of the game is exactly the same for all languages.
And it cannot be detected as it simulates your keystrokes and mouse moves.

It was first written for french users who do not understand english, like my bro'. I did the english translation pretty fast hence some terms may not be right chosen.

On the first tab, you have to set, as close as possible, the coordinates of one pixel which will be used as reference for every mouse moves. So if you move your browser window or change its size, it won't work anymore until you set again the reference pixel.

If you have more than one city, then fill the Cities.txt file and don't delete the first line. Fill it with the same order your cities are listed in the pop-up menu. Anyway, you don't need to do this if you only want to take a look at GreScript.

Delays are here, because depending on your computer and/or you connexion (connection for US people), it can take seconds before the page is rendered.

No need to install, just unzip and run. To create a script, enter some values, click here and here and press "Create.au3" (if you don't add .au3 at the end of the filename, it will be added for you). Then open, test.au3 for instance with a text editor to see (and maybe understand) how it works.

Now, a script is to be executed/launched, not only to be viewed on a text editor :)
At this point, if you want to go further, you will need to install AutoIt3 (see link at the beginning of the topic) (or use the stand alone version). Then you will be able to run the script as is, or to compile it in a .exe file.
The editor SciTE, included with AutoIt package, will allow you to edit au3 scripts with color syntax. It's better if you want to understand, modify, create scripts.

Now the files :
French version : [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...]
English version : [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...]
Sources : [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...] [Only registered and activated users can see links. Click Here To Register...]
PS : I'm not sure I did the VT links well !

I have put the files back since someone is finally interested/curious about this.
I have added sources too, even if it's a small piece of code, please don't sell it (even if you modifiy it).
And if you modify it, I will really appreciate to see what you've done, just by curiosity. Thanks.

Thanks for reading.
10/10/2010 19:14 deathmiau#2
You have forgot VT. But File is Clean
VT .rar [Only registered and activated users can see links. Click Here To Register...] 3/41

VT unziped [Only registered and activated users can see links. Click Here To Register...] 4/41
10/10/2010 19:58 Shadow992#3
Quote:
Originally Posted by deathmiau View Post
You have forgot VT
VT .rar [Only registered and activated users can see links. Click Here To Register...] 3/41

VT unziped [Only registered and activated users can see links. Click Here To Register...] 4/41
Source angeschaut und kann im Grunde nur das sagen: Ist clean.
I took a look at the source and i can just say this: Its clean.
10/10/2010 21:55 io.#4
Oops, sorry, I should have read the rules.
10/16/2010 10:46 Battal Gazi#5
can you send me the link to download the script?
10/24/2010 00:18 io.#6
Yes.
10/24/2010 01:39 Battal Gazi#7
thank you, io
10/24/2010 02:22 Battal Gazi#8
thank you, io.
Looks really good. But after first testing with one city of me and the attack possibility:
I created an attack script and want to send 578 slingers to a ghost city.
The standard delays are fine, but the script does not fill in the attack box the 578 slingers. I receive always the message that at least 65 soldiers should be in the attack. I encreased the standard set time, but again same message.

Edit:

I found the error. I added 2 delays in in the attack option and now it works.

; 578 line 2 column 9
MouseClick ( "left", 563, 556, 1, 0 )
Sleep ( 2000 )
Send ( "100" )
Sleep ( 2000 )
; Attack

But how can I manage it, that he attacks independet of the time? i.e. it should do its job after couple of seconds after the script was started.
10/24/2010 10:35 io.#9
Hi and thanks for you interest.

On the main tab, there is 3 boxes, in those boxes you can change the delays. The one you're talking about is "Pop-up actions delay".

"Map display delay" is used when you select another city than your active one from your list of cities. On my computer, it takes around 8 second to redraw the sea map with the new selected city.
"Pop-up actions delay" is the delay done between each action done on the pop-up window.
When you click a city on the sea map, the pop-up window appears, "City loading delay" is the delay between this click and the first action done on the pop-up.

On the bottom of the window, you have a time section, just fill it with the current time before saving your script and launch it. Don't fill 10:33:- and save at 10h33m55s for instance or you won't have enough time to launch the script. You can have a time test to the second if you fill the seconds box (called SS).
Or you can simply remove the time test loop in the generated script.
As scripts were supposed to be running while I was not in front of my computer, I did not add the option to disable the time test loop.
10/29/2010 23:55 Battal Gazi#10
thanks I will try it the next hours with a test person/person and will go to bed ;o)
07/12/2011 16:40 johnmirra#11
what does "maj" in "maj to cancel" mean?
07/12/2011 19:03 io.#12
Sorry, a small part I forgot to translate :)
It means MAJUSCULE or in english SHIFT.
07/13/2011 14:59 johnmirra#13
you're still using this thing? Maybe even improved it some. I can't quite figure it all out. A detailed HowTo or guide on a small scale would be nice.

Edit: I got to clicking here and there and i think i got the idea. Making scripts for attacking and supporting cities is beginning to look very grim.
07/13/2011 16:09 io.#14
Hi,

I don't play this game anymore for months now (too much time eaten). I did not improve anything since this release.

Anyway, lately (few weeks before quitting the game) I was using another way to play.
Instead of creating multiple scripts, I started to open multiple tabs with everything ready for my attackS. The only thing remaining to do was clicking on the attack button at the right time.

So my new script was very simple and was only testing hours, minutes and seconds if needed, then it clicked on attack and closed the tab or switched to the next one.

Last time I used it, it looked like this :

Code:
While 1
	If @HOUR = 7 Then
	;1
		If @MIN = 05 Then
			MouseClick ( "left", 1546, 12, 1, 0 )
			Sleep ( 2000 )
			LanceAttaque ()
		EndIf
	EndIf

	If @HOUR = 4 Then
	;2
		If @MIN = 05 Then
			MouseClick ( "left", 1746, 12, 1, 0 )
			Sleep ( 2000 )
			LanceAttaque ()
		EndIf

 	;3
 		If @MIN = 11 Then
			MouseClick ( "left", 1946, 12, 1, 0 )
			Sleep ( 2000 )
			LanceAttaque ()
 		EndIf

;~ 	;4
;~ 		If @MIN = 30 and @SEC = 32 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;5
;~ 		If @MIN = 38 and @SEC = 36 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;6
;~ 		If @MIN = 57 and @SEC = 02 Then
;~ 			LanceAttaque ()
;~ 			Exit
;~ 		EndIf

;~ 	;7
;~ 		If @MIN = 19 and @SEC = 28 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;8
;~ 		If @MIN = 19 and @SEC = 47 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;9
;~ 		If @MIN = 20 and @SEC = 28 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;10
;~ 		If @MIN = 20 and @SEC = 47 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;11
;~ 		If @MIN = 21 and @SEC = 4 Then
;~ 			LanceAttaque ()
;~ 		EndIf

;~ 	;12
;~ 		If @MIN = 22 and @SEC = 4 Then
;~ 			LanceAttaque ()
;~ 		EndIf
;~ 	ElseIf @HOUR = 6 Then
;~ 	;13
;~ 		If @MIN = 48 and @SEC = 40 Then
;~ 			LanceAttaque ()
;~ 			Exit
;~ 		EndIf
;~ 		Exit
	EndIf

; Change this to modify precision of attack launching
	Sleep ( 20000 )
WEnd

Func LanceAttaque ()
	MouseClick ( "left", 2186, 565, 1, 0 )
	Sleep ( 2000 )
	; Change by ctrl-tab to switch to next tab instead of closing it
	Send ( "^w" )
EndFunc

Func LanceAttaqueAllie ()
	MouseClick ( "left", 2190, 690, 1, 0 )
	Sleep ( 1000 )
	MouseClick ( "left", 2280, 478, 1, 0 )
	Sleep ( 1000 )
	Send ( "^w" )
EndFunc
07/30/2013 02:59 beaten#15
hi,

i can't do the downlaod. Can you give me the link? Those links are empty of files...