King of avalon farm bot Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Jaybals

King of avalon farm bot  Topic is solved

24 Nov 2017, 18:32

It has been a looooong time since I wrote any ahk scripts, however I wanted to try to get something going for king of avalon.

The eventual goal here is to have one script that can run 4 or 5 instances of the game (on Nox) to gather resources (from alliance buildings and tiles), collect resources as they are produced in the cities, kill monsters, heal troops, use resource items, dump food into a bank and restart the game as needed when Nox freezes. I realize that's a lot and it will take some time. I already started a script to run 1 account to the alliance mine with BlueStacks and 4 accounts with Nox. I have yet to test the Nox script. Hopefully with some input from others we can piece this thing together.

Here is the script for BlueStacks:

Code: Select all

#SingleInstance, Force



Button_Color := "0x164C67"		;corner of the call back button
Button_X := 298
Button_Y := 185





!X::		;ctl+X to start the script
	Loop
		{
			PixelGetColor,Current_color,Button_X,Button_Y,RGB	;checks to see if troops are out
			if(Current_Color!=Button_Color)
				{
					MouseClick, Left, 512, 355		;alliance mine
					sleep, 3000
					MouseClick, Left, 594, 365		;gather
					sleep, 4000
					MouseClick, Left, 755, 326		;troop formation
					sleep, 1000
					MouseClick, Left, 840, 555		;send
					sleep, 10000
				}
		}
	return

^A::	Pause, Toggle	return		;Alt+A to pause and unpause
Here is the untested Nox script:

Code: Select all

#SingleInstance, Force



Button_Color := "0x164C67"		;corner of the call back button
Button_X := 298
Button_Y := 185





WinGet, Nox, List, NoxPlayer		;list Nox windows
	return

!X::		;ctl+X to start the script
	Loop
		{
			WinActivate,ahk_id %Nox1%		;switch to first window
			sleep, 1000
			PixelGetColor,Current_color,Button_X,Button_Y,RGB	;checks to see if troops are out
			if(Current_Color!=Button_Color)
				{
					MouseClick, Left, 512, 355		;alliance mine
					sleep, 2000
					MouseClick, Left, 594, 365		;gather
					sleep, 4000
					MouseClick, Left, 755, 326		;troop formation
					sleep, 1000
					MouseClick, Left, 840, 555		;send
					sleep, 10000
				}
			WinActivate,ahk_id %Nox2%		;switch to second window
			sleep, 1000
			PixelGetColor,Current_color,Button_X,Button_Y,RGB	;checks to see if troops are out
			if(Current_Color!=Button_Color)
				{
					MouseClick, Left, 512, 355		;alliance mine
					sleep, 2000
					MouseClick, Left, 594, 365		;gather
					sleep, 4000
					MouseClick, Left, 755, 326		;troop formation
					sleep, 1000
					MouseClick, Left, 840, 555		;send
					sleep, 10000
				}
			WinActivate,ahk_id %Nox3%		;switch to third window
			sleep, 1000
			PixelGetColor,Current_color,Button_X,Button_Y,RGB	;checks to see if troops are out
			if(Current_Color!=Button_Color)
				{
					MouseClick, Left, 512, 355		;alliance mine
					sleep, 2000
					MouseClick, Left, 594, 365		;gather
					sleep, 4000
					MouseClick, Left, 755, 326		;troop formation
					sleep, 1000
					MouseClick, Left, 840, 555		;send
					sleep, 10000
				}
			WinActivate,ahk_id %Nox4%		;switch to fourth window
			sleep, 1000
			PixelGetColor,Current_color,Button_X,Button_Y,RGB	;checks to see if troops are out
			if(Current_Color!=Button_Color)
				{
					MouseClick, Left, 512, 355		;alliance mine
					sleep, 2000
					MouseClick, Left, 594, 365		;gather
					sleep, 4000
					MouseClick, Left, 755, 326		;troop formation
					sleep, 1000
					MouseClick, Left, 840, 555		;send
					sleep, 10000
				}
		}
	return

^A::	Pause, Toggle	return		;Alt+A to pause and unpause
Jaybals

Re: King of avalon farm bot

25 Nov 2017, 09:27

A few things about the scripts: resolution was set to 960x540. Alliance mine was centered on the screen already using a bookmark. The way I always enter the map is by using coords from mail because it zooms out further.

I already started editing the BlueStacks script to loop for 30 minuets then restart the program, but it is a very crude way of doing it (by clicking the close button then double clicking the desktop icon). I would like to see if I can get it to detect if the game is frozen then restart by running the program rather than double clicking an icon.
xRaggon

Re: King of avalon farm bot

24 Jan 2018, 07:06

Cześć! , jak dalej potoczyło się sytuacja z tym skryptem?
Anonymous1

Re: King of avalon farm bot

14 Jun 2018, 01:53

Are its work?or server detect a apllication
Aslan

Re: King of avalon farm bot

18 Aug 2018, 18:06

Just go to http://www.jeobots.com

A lot easier and does a lot more. And super cheap compared to others. I love donations script, helps a lot when trying to heal alliance hospital troops.

Also sends marches fast. Have had 75 farms and no sms verifications.
dottie0803
Posts: 2
Joined: 07 Aug 2020, 12:50

Re: King of avalon farm bot

11 Aug 2020, 14:07

Would someone with the script please get in touch with me. Thank you
User avatar
KindRobot
Posts: 2
Joined: 27 Jan 2021, 08:21

Re: King of avalon farm bot

27 Jan 2021, 08:30

Did someone make this work ? I`m really curious how to start this stuff
[email protected]
atomant
Posts: 4
Joined: 12 Mar 2021, 20:45

Re: King of avalon farm bot

12 Mar 2021, 20:48

how can I help?
I'm a programmer 30+ years.
atomant
Posts: 4
Joined: 12 Mar 2021, 20:45

Re: King of avalon farm bot

12 Mar 2021, 21:31

The script when executed gives me the error
Error: Parameter #1 invalid.
Line 078: Pause, Toggle return
atomant
Posts: 4
Joined: 12 Mar 2021, 20:45

Re: King of avalon farm bot

12 Mar 2021, 21:32

^A::Pause, Toggle return ;Alt+A to pause and unpause
gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: King of avalon farm bot

12 Mar 2021, 21:41

atomant wrote:
12 Mar 2021, 21:31
The script when executed gives me the error
Error: Parameter #1 invalid.
Line 078: Pause, Toggle return
Remove the return from that line- that's obviously a syntax error.
Apart from that, I don't know the game and can't help.
atomant
Posts: 4
Joined: 12 Mar 2021, 20:45

Re: King of avalon farm bot

13 Mar 2021, 06:08

Oh this is cool.
ok I've modified this script, just using a single session at the moment, however, in KOA, I am not getting the bridge chest, checking if the OK button for the popup is green and if so, clicking it. then sleep for 10.5 minutes.
cool, it all adds up.
next for the next feature, getting the farm resources :) Just have to work out how to drag the mouse to move the screen first.
koarss
Posts: 1
Joined: 17 Jan 2023, 14:48

Re: King of avalon farm bot

17 Jan 2023, 14:51

Regarding the current resource sale, have you made a new robot yet?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot], LepG and 62 guests