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
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