Eternium gold and crafting ingredients farming bot

Post gaming related scripts
Malevonace
Posts: 4
Joined: 16 Aug 2020, 03:30

Eternium gold and crafting ingredients farming bot

16 Aug 2020, 03:41

Hello,
For everyone who still enjoys the game but hates the mind numbing grinding that you have to do at higher levels, here is a gold farming bot. It is not perfect and I am not a programmer by trade. Far from it. However it can still make 20+ millions a day with a good gear (1000%+ gold find). It is written in Autohotkey and only works on Windows (no android I am afraid but there are options for that as well). It is the only scripting language that I am familiar with. It is very easy to install and to start a new script all you have to do is to right click a folder and select New->AutoHotkey Script.
The parameters of the bot have been specifically setup to be compatible with my screen resolution (1440/900) and my colour range of my computer. Feel free to customize to your own screen.
A useful tool to determine the coordinates of the screen is included in Autohotkey and is called WindowSpy. Alternatively you can use a small script like this :

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force

F5::
MouseGetPos X, Y  
ToolTip, %X% %Y%
return

;;this hotkey is to reset the tool-tip and clear it from screen
F8::
Reload
return

;;this hotkey is to completely exit the script
Escape::exitapp
The script itself is modular and some basic image recognition has been used to speed up the script. All the image recognition functions can be replaced with simple screen clicks and sleep timers.
This is the main script. It uses two libraries, found bellow and some pictures stored in a folder called ScriptImages (located in the same folder as the script). It can do arena type maps or severed mountain. It uses an F5 to start arenas and F6 to start Severed Mountain. The map you choose to start has to be the last one played and the caracter has to be in the default position just above the starting portal.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force
#Include Eterniumlibrary.ahk
#Include Mypreciouslibrary.ahk
#IfWinActive Eternium
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;Arenas;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Farmandsalvage()
{
 Salvage()
 StartArenaAfterSalvage() 
 Fight()
}

Farm()
{
 StartArenaNoSalvage() 
 Fight()
}


F5::
  Loop
   {
     Farmandsalvage()
     Loop, 20
     {
       Farm()
     }
   }
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;Severed Mountain;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FarmandsalvageSM()
{
 Salvage()
 StartArenaAfterSalvage() 
 FightSM()
}

FarmSM()
{
 StartArenaNoSalvageSM() 
 FightSM()
}


F6::
  Loop
   {
     FarmandsalvageSM()
     Loop, 35
     {
       FarmSM()
     }
   }
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
F8::Reload
Escape::exitapp
Here is the first library (just a normal, separate script that has to be called Eterniumlibrary )

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#Include Mypreciouslibrary.ahk

StartCurrentLevel()
{
  Searchimageandsingleclick(1100, 500, 1394, 818, 40, 10, "Play.png")
  Searchimageandsingleclickwithescape(530, 749, 925, 820, 40, 10, "Start.png", 2000)
}


Salvage()
{
sleep 1000
LoopClickandwait(1266, 429, 1, 1400)
LoopClickandwait(913, 304, 1, 100)
;Searchimageandsingleclickwithescape(231, 364, 538, 404, 60, 10, "SalvageEpics.png", 400)
Searchimageandsingleclickwithescape(235, 304, 541, 339, 60, 10, "SalvageRare.png", 400)
Searchimageandsingleclickwithescape(455, 635, 685, 690, 90, 300, "SalvageYes.png", 400)
Searchimageandsingleclick(1205, 42, 1267, 99, 40, 200, "SalvageX.png")
}

Stashitems()
{
LoopClickandwait(525, 200, 1, 400)
MatrixClick(760, 185, 75, 75, 8, 5, 2, 10)
Searchimageandsingleclickwithescape(1280, 67, 1334, 120, 60, 400, "StashX.png", 30)
}

StartArenaAfterSalvage()
{
LoopClickandwait(340, 156, 1, 1300)  ;;Move towards stash
Stashitems()
LoopClickandwait(502, 111, 1, 20)  ;;Enter gate
StartCurrentLevel()
}

StartArenaNoSalvage() 
{
sleep 50
StartTime := A_TickCount
Loop,
  {
     If Imageonscreen(1100, 500, 1394, 818, 40,"Play.png") = 1
           {
                       StartCurrentLevel()
                       break
           }      
     Else If (A_TickCount - StartTime > 3000)
           {
                       StartCurrentLevel()
                       break
           }
     Else
           {
                       LoopClickandwait(722, 160, 1, 200)
           }
  }
}


StartArenaNoSalvageSM() 
{
sleep 500
LoopClickandwait(722, 160, 2, 1000)
StartCurrentLevel()
}

Endlevel()
{
            Click, 42, 816   ;Click hero icon
            Searchimageandsingleclickwithescape(1120, 78, 1250, 120, 40, 1, "Finishlevel.png", 800)
            Searchimageandsingleclickwithescape(456, 636, 690, 700, 60, 1000, "FinishLevelYes.png", 300)
}

Fight()
{
Sleep 1000
Click, 722, 779 
StartTime := A_TickCount
LevelStartTime := A_TickCount
Loop
  {
     LevelElapsedTime := A_TickCount - LevelStartTime
     if LevelElapsedTime > 120000 ;;reset if something went very wrong and script got jammed
           {
                       Endlevel()
                       break
           }
     If Imageonscreen(285, 765, 840, 831, 80, "LevelEnd.png") = 0
           {
              ElapsedTime := A_TickCount - StartTime
              if ElapsedTime > 3000
              {
              StartTime := A_TickCount
              LoopRightClickandwait(814, 479, 1, 500) ;; atack in arenas
              }
           } 
      Else If Imageonscreen(285, 765, 840, 831, 80, "LevelEnd.png") = 1
          {
           Sleep 2200
           Endlevel()
           break
          }
  }
}

FightSM()
{
Sleep 1000
StartTime := A_TickCount
LevelStartTime := A_TickCount
Loop
  {
     LevelElapsedTime := A_TickCount - LevelStartTime
     if LevelElapsedTime > 15000 ;;reset if something went very wrong and script got jammed
           {
           Send {1}
           LoopClickandwait(1307, 405, 1, 500) ;; 1307
           Sleep 2500
           Click, 722, 779 
           Sleep 6000
           Endlevel()
           break
           }
     If Imageonscreen(285, 765, 840, 831, 100, "LevelEnd.png") = 0
           {
              ElapsedTime := A_TickCount - StartTime
              if ElapsedTime > 700
              {
              StartTime := A_TickCount
              LoopClickandwait(852, 259, 1, 100)
              LoopClickandwait(1307, 405, 1, 500) ;; 1307
              }
           } 
      Else If Imageonscreen(280, 760, 840, 831, 80, "LevelEnd.png") = 1
          {
           Send {1}
           LoopClickandwait(1307, 405, 1, 500) ;; 1307
           Sleep 2500
           Click, 722, 779 
           Sleep 6000
           Endlevel()
           break
          }
  }
}
Here is the second library(just a normal, separate script that has to be called Mypreciouslibrary , in the same folder as the main script ):

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

GetMouseCoorsAndColour()
{
MouseGetPos X, Y 
PixelGetColor Color, %X%, %Y%, RGB
ToolTip, Mouse position is %x%x%Y% Colour is %Color%
}

LoopClickandwait(xclickpos, yclickpos, loopcounter, waittimemilisecconds)
{
  Loop, %loopcounter%
    {
      Click, %xclickpos%, %yclickpos%
      Sleep, %waittimemilisecconds%
    }
}


LoopRightClickandwait(xrclickpos, yrclickpos, rloopcounter, rwaittimemilisecconds)
{
  Loop, %rloopcounter%
    {
      Click, right, down, %xrclickpos%, %yrclickpos%
      Sleep, 50
      Click, right, up, %xrclickpos%, %yrclickpos%
      Sleep, %rwaittimemilisecconds%
    }
}


MatrixClick(startx, starty, xgain, ygain, repeatx, repeaty, clickcount, clicksleep)
{
xnow := startx
ynow := starty
Loop, %repeatx%
 {
  Loop, %repeaty%
   {
   LoopClickandwait(xnow, ynow, clickcount, clicksleep)
   tempy := ynow + ygain
   ynow := tempy
   }
  ynow := starty
  tempx := xnow + xgain
  xnow := tempx
 }
}


Searchimageandclick(startpointx, startpointy, endpointx, endpointy, confidence, sleeptimer, filename)
{
     coordMode,pixel
     ImageSearch, FoundX, FoundY, %startpointx%, %startpointy%, %endpointx%, %endpointy%, *%confidence% %A_ScriptDir%\ScriptImages\%filename%
     if (ErrorLevel = 0)
        {
         Click, %FoundX%, %FoundY%
         Sleep, %sleeptimer%
        } 
}



Searchimageandsingleclick(startpointx, startpointy, endpointx, endpointy, confidence, sleeptimer, filename)
{
Loop
  {
     coordMode,pixel
     ImageSearch, FoundX, FoundY, %startpointx%, %startpointy%, %endpointx%, %endpointy%, *%confidence% %A_ScriptDir%\ScriptImages\%filename%
     if (ErrorLevel = 0)
        {
         Click, %FoundX%, %FoundY%
         Sleep, %sleeptimer%
         break
        } 
  }
}


Searchimageandsingleclickwithescape(startpointx, startpointy, endpointx, endpointy, confidence, sleeptimer, filename, escapetimer)
{
StartTime := A_TickCount
Loop
  {
     coordMode,pixel
     ImageSearch, FoundX, FoundY, %startpointx%, %startpointy%, %endpointx%, %endpointy%, *%confidence% %A_ScriptDir%\ScriptImages\%filename%
     if (ErrorLevel = 0)
        {
         Click, %FoundX%, %FoundY%
         Sleep, %sleeptimer%
         break
        } 
      if (A_TickCount - StartTime > escapetimer)
           {
                       Click, %startpointx%, %startpointy%
                       break
           }
  }
}


Imageonscreen(startpointx, startpointy, endpointx, endpointy, confidence, filename)
{
     coordMode,pixel
     ImageSearch, FoundX, FoundY, %startpointx%, %startpointy%, %endpointx%, %endpointy%, *%confidence% %A_ScriptDir%\ScriptImages\%filename%
     if (ErrorLevel = 0)
         return 1
     else return 0
}
I used a small windows free app called Lightshot to take the images, but many other alternatives are available (including paint).
Here us how my image folder looks like
Screenshot_3.png
Screenshot_3.png (19 KiB) Viewed 6962 times
bashiralnory
Posts: 1
Joined: 16 Aug 2020, 05:23

Re: Eternium gold and crafting ingredients farming bot

16 Aug 2020, 05:33

hi any tutorial for beginners on how to use it ?
Malevonace
Posts: 4
Joined: 16 Aug 2020, 03:30

Re: Eternium gold and crafting ingredients farming bot

16 Aug 2020, 09:31

1. Install Autohotkey
2. Install LightShot
3. Create a new simple folder anywhere you want and name it something relevant.
4. Inside the new folder you created make another new folder named ScriptImages and 4 blank new ahk scripts (right click- new- Ahk script).
5. Name the first one Mouse position and copy the first batch code in my post.
6. Name the second script Eternium bot and copy inside it the seccond code batch in my post.
7. Name the third script Eterniumlibrary and copy the third code block inside it.
8. Name the forth script Mypreciouslibrary and copy the forth code block inside it.

Set your screen resolution to 1440x900.
Run Eternium bot. Start Eternium. Login and do a run of severed Mountain. Set view distance to 150%. At the end of the run, don't use the portal. Instead press finish level from character screen. After the city loads press F6 to start the bot.
F8 to stop bot

There might be additional setting up to do. In that case a simple explination will not be enough.
Malevonace
Posts: 4
Joined: 16 Aug 2020, 03:30

Re: Eternium gold and crafting ingredients farming bot

16 Aug 2020, 09:32

Lightshot and The mouse position script are used for advanced setup.
ditrih210
Posts: 1
Joined: 19 Aug 2020, 04:46

Re: Eternium gold and crafting ingredients farming bot

19 Aug 2020, 04:55

how to run this in 1360x768 ?
Malevonace
Posts: 4
Joined: 16 Aug 2020, 03:30

Re: Eternium gold and crafting ingredients farming bot

19 Aug 2020, 12:47

ditrih210 wrote:
19 Aug 2020, 04:55
how to run this in 1360x768 ?
Hi you would have to adjust the value of the screen coordinates for each on screen action (i.e click) as it is dependent on the resolution.
sobimask
Posts: 1
Joined: 05 Sep 2020, 10:48

Re: Eternium gold and crafting ingredients farming bot

05 Sep 2020, 10:55

Did anyone tried and get banned from it as a result?
I did put some about 100$ on my real account and thinking to use this farming bot on my real account,
But i'm scared getting my real account banned......

Also I couldn't find 1440x900 on my screen resolution,
I always use 1920x1080, and as I am such a beginner, how do I get to know the coordinates?
And how you get the coordinates numbers..??

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 9 guests