script to farm the albinaurics in loop on Elden ring

Post gaming related scripts
pierreL
Posts: 1
Joined: 26 Apr 2022, 03:42

script to farm the albinaurics in loop on Elden ring

Post by pierreL » 26 Apr 2022, 03:56

I post here my first script on AHK hoping it will help someone other than me :)

past level 400 , leveling up is a hell and is really time consumming , with this script , you will be abble to farm the albinaurics at mohgwyn's palace in loop while at work or sleeping .

Please note :
- the key to switch left to another locked ennemy needs to be P
- the key to activate the golden wave of your weapon needs to be Left shift
- the key to stop the script is Right shift
- the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
- you can modify the script in any way you desire , enjoy ;)

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.
SetTitleMatchMode, 2

#IfWinActive, ELDEN RING™

#F7::
loop
{
Send, {z down}
Sleep 3000
Send, {z up}
Sleep 10

Send, {q down}
Sleep 979
Send, {z down}
Sleep, 16

Send, {q up}
Sleep 1100
Send, {z up}
Sleep, 30

Send, {a down}
Sleep 100
Send, {a up}
Sleep, 100

Send, {p down}
Sleep 100
Send, {p up}
Sleep, 100

Send, {p down}
Sleep 100
Send, {p up}
Sleep, 100

Send, {p down}
Sleep 100
Send, {p up}
Sleep, 100

Send, {p down}
Sleep 100
Send, {p up}
Sleep, 100

Send, {z down}
Sleep 700
Send, {z up}
Sleep 10

Send, {LShift down}
Sleep 7000
Send, {g down}
Sleep, 10

Send, {LShift up}
Sleep 500
Send, {f down}
Sleep, 30

Send, {g up}
Sleep 30
Send, {f up}
Sleep, 30

Send, {e down}
Sleep 245
Send, {e up}
Sleep, 135

Send, {e down}
Sleep 5700
Send, {e up}
Sleep, 0
}

return
RShift::ExitApp

#IfWinActive

colas
Posts: 1
Joined: 03 May 2022, 03:44

Re: script to farm the albinaurics in loop on Elden ring

Post by colas » 03 May 2022, 04:33

Thanks for your script!

I have adapted it for my use, with some changes:
  • start the script with F7, stop with F8
  • the key to activate the golden wave of your weapon is TAB
  • I only use direction keys, W A S D: I do front, left, front.
  • I start by traveling to the site of grace, so that the script can be started whatever the current position (close to the site)

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.

;; inspired from: https://www.autohotkey.com/boards/viewtopic.php?f=19&t=103259
;; - the key to activate the golden wave of your weapon is TAB
;; - start the script with F7, stop with F8
;; - the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
;; - direction keys are W A S D

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2

#IfWinActive, ELDEN RING™

F7::
loop
{
;; G F E E ==> we go the the closest site of grace
Send, {g down}
Sleep 30
Send, {g up}
Sleep, 900

Send, {f down}
Sleep 30
Send, {f up}
Sleep, 30

Send, {e down}
Sleep 245
Send, {e up}
Sleep, 135

Send, {e down}
Sleep 5700
Send, {e up}
Sleep, 200

;; W A W ==> we zig zag into position
Send, {w down}
Sleep 5000
Send, {w up}
Sleep 10

Send, {a down}
Sleep 1050
Send, {a up}
Sleep, 16

Send, {w down}
Sleep 750
Send, {w up}
Sleep 30

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
Sleep, 7000
}

return
F8::ExitApp

#IfWinActive

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 30 Jul 2022, 19:33

Hi, thanks for the script.
This script really got me hooked back into AHK!
I created a couple different versions that use a shorter route to a different spot for farming the Albinaurics that may or may not yeld more runes.
It is coded with my timings and one goes near the edge for 40k runes most of the times on a NG+0 so use that one at your own risk and make sure to use your runes before trying.
I also added a reload option on F6 in case anyone wants to try to fiddle with it.
It's always good to learn new things and this code just gave me a reason to try.
I Also want to try to write a scoreboard code for the total runes and each run separately, so I'll be looking for help on that on another post.
Here's the scripts:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.

;; inspired from: https://www.autohotkey.com/boards/viewtopic.php?f=19&t=103259
;; - the key to activate the golden wave of your weapon is TAB
;; - start the script with F7, reload with F6 and stop with F8
;; - the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
;; - direction keys are W A S D

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2

#IfWinActive, ELDEN RING™
F6::reload
F7::
loop
{
;; G F E E ==> we go the the closest site of grace
Send, {g down}
Sleep 30
Send, {g up}
Sleep, 400

Send, {f down}
Sleep 30
Send, {f up}
Sleep, 30

Send, {e down}
Sleep 145
Send, {e up}
Sleep, 85

Send, {e down}
Sleep 4300
Send, {e up}
Sleep, 100

;; W A W ==> we zig zag into position


Send, {w down}
Sleep, 10
Send, {space down}
Sleep, 950
Send, {a down}
Sleep, 490
Send, {a up}
Sleep, 1240
Send, {a down}
Sleep, 230
Send, {a up}
Sleep, 630
Send, {space up}
Sleep, 10
Send, {w up}
Sleep, 10

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
Sleep, 7000
}

return
F8::ExitApp
#IfWinActive
This next one is the one that goes near the edge:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.

;; inspired from: https://www.autohotkey.com/boards/viewtopic.php?f=19&t=103259
;; - the key to activate the golden wave of your weapon is TAB
;; - start the script with F7, Reload with F6 and stop with F8
;; - the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
;; - direction keys are W A S D

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2

#IfWinActive, ELDEN RING™
F6::reload
F7::
loop
{
;; G F E E ==> we go the the closest site of grace
Send, {g down}
Sleep 30
Send, {g up}
Sleep 400

Send, {f down}
Sleep 30
Send, {f up}
Sleep 30

Send, {e down}
Sleep 145
Send, {e up}
Sleep 85

Send, {e down}
Sleep 4300
Send, {e up}
Sleep 100

;; W A W ==> we zig zag into position


Send, {w down}
Sleep 30
Send, {space down}
Sleep 1760
Send, {a down}
Sleep 800
Send, {a up}
Sleep 1260
Send, {space up}
Sleep 30
Send, {a down}
Sleep 1000
Send, {a up}
Sleep 30
Send, {d down}
Sleep 30
Send, {d up}
Send, {w up}
Sleep 10

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
Sleep 6500
}

return
F8::ExitApp

#IfWinActive
Thanks again.

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 02 Aug 2022, 16:48

So, I've added a few things to the script to guarantee it's working:
It uses InageCheck to verify the load steps to make sure to get into the map , and it also only starts movement after loading, so possible longer map load times don't offset your movement.
It also makes sure the character is facing the Albinaurics before sending the skill, because the edge drop to the little platform sometimes makes commands get ignored.
If you by some reason happen to die, it also collect your runes for you and restart the process.
This is coded for a 1080p resolution with a left main monitor in case of double monitors.

https://drive.google.com/file/d/19ogWFfB1MePjjDKKYpYqIXIl3vi6w6f1/view?usp=sharing
for the screen captures.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.

;; inspired from: https://www.autohotkey.com/boards/viewtopic.php?f=19&t=103259
;; - the key to activate the golden wave of your weapon is TAB
;; - start the script with F7, Reload with F6 and stop with F8
;; - the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
;; - direction keys are W A S D

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
;SetKeyDelay, 20, 20
#MaxThreadsperHotkey 2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
WinGetPos, WinX, WinY, WinW, WinH, ELDEN RING™
if (WinX !=0)
	Winmove, ELDEN RING™, , 0, 0
SetBatchLines, -1

#IfWinActive, ELDEN RING™
F6::reload
F8::ExitApp
F7::
Gosub main

main:
loop{

;; G F E E ==> we go the the closest site of grace
Sleep 30
Send, {g down}
Sleep 30
Send, {g up}
loop, 300 {
ImageSearch, , ,1802, 100, 1816, 119, *25 *transblack Compass.png
If (ErrorLevel = 0){
	break
}
If (A_Index = 300){
	Sleep, 100
	Gosub main
	break
}
}
Send, {f down}
Sleep 30
Send, {f up}
Sleep 30
loop,100 {
	Imagesearch, , , 52, 150, 116, 970, *25 *transblack GraceList.png
If (ErrorLevel = 0) {
	break
	}
	If (A_Index = 100) {
Sleep 30
Send, {f up}
Sleep 30
Send, {f down}
Sleep 30
Send, {f up}
Sleep 30
break
}
}


Send, {e down}
Sleep 30
Send, {e up}
Sleep 85
Loop, 100 {
	Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
If (ErrorLevel = 0) {
Send, {e up}
Sleep 85
Send, {e down}
Sleep 45
break
}
}

Send, {e down}
Sleep 2000
	Imagesearch, , , 119, 1017, 584, 1035, *55 *Transblack Next.png
If (ErrorLevel = 1) {
Send, {e up}
Sleep 145
Send, {e down}
Sleep 2000
}
Sleep 2000

loop, 100 {
ImageSearch, , ,862, 908, 927, 920, *55 *transblack YRetrieve.png
If (ErrorLevel = 0){
Sleep 300
Send, {e up}
Sleep 300
Send, {e down}
Sleep 30
Send, {e up}
	Gosub main
	break
}
ImageSearch, , ,1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
If (ErrorLevel = 0){
	break
}
else
ImageSearch, , ,-1085, 1026, 0, 1045, *55 *transblack RuneIcon.png
If (ErrorLevel = 0){
	break
}
}

;; W A W ==> we zig zag into position

;BlockInput, MouseMove
Send, {e up}
Sleep 300
Send, {w down}
Sleep 30
Send, {space down}
Sleep 1760
Send, {a down}
Sleep 1000
Send, {a up}
Sleep 1500
Send, {a down}
Sleep 350
Send, {space up}{a up}{d down}
Sleep 210
Send, {d up}{w up}
Sleep 50 ; you may need to adjust this for the Pixelsearch to work
Loop {
PixelSearch, PixelX, PixelY, 840, 400, 841, 600, 0x6EB0CF, 35, fast
If (ErrorLevel = 1){
SoundBeep, 500
Send, {w down}{d down}
Sleep 30
Send, {d up}{w up}
break
}
If (ErrorLevel = 0) {
SoundBeep, 1000
ToolTip, %PixelX% %PixelY%,PixelX, PixelY
SetTimer, RemoveToolTip, -3000
break
}
}

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
;BlockInput, MouseMoveOff
Sleep 6500
}
return

RemoveToolTip:
ToolTip
return

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 04 Aug 2022, 03:01

So, here's a script to show how many runes you earned each time.
You will need to set a Board.ini file on the script directory and use screen captures for the score scan.
I think the smallest capture possible is 6x6 so you may want to use smaller ones than what I use, wich are the whole number.
Depending on your machine, it may offset the farm script timings, so adjust timings on both scripts if needed.
Also, make sure to change the name of the file or the script so they match.
This will help you find the sweet spot to get the most Aubinaurics. Turn it off with a ";" on the command line if you are not watching.
Here's https://drive.google.com/file/d/1CaDXzkMwiKxTwc4pMT2M6hcBpYylOh-z/view?usp=sharing my files and both scripts:
*edit: deprecated

Code: Select all

#Persistent
#SingleInstance Force
Process, Priority,, low
Critical off
CoordMode, Pixel
CoordMode, Tooltip
xList    := [[1750, 1771], [1761, 1782], [1772, 1793], [1783, 1805], [1794, 1816]
           , [1806, 1827], [1817, 1840], [1830, 1850], [1843, 1865]]
Iniread, scoreold, Board.ini, score, score
sleep, 6500
score =
For each, x in xList {
 Loop, 11 {
  digit := A_Index - 1
   image :="Digit" digit ".png"
  ImageSearch,,, x.1, 1025, x.2, 1047, *115 *transblack %image%
  err := ErrorLevel
  If (digit = 10)
   digit:= 0
 } Until !err
 score .= err ? "_" : digit
}
IniWrite, %score%, Board.ini, score,score
scoreminus:= score - scoreold
Tooltip, last run= %scoreminus%, 900, 900, 2
SetTimer, RemoveToolTip2, -3000
return

RemoveToolTip:
ToolTip
return
RemoveToolTip2:
ToolTip, , , , 2
return

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
;; inspired from: https://www.autohotkey.com/boards/viewtopic.php?f=19&t=103259
;; - the key to activate the golden wave of your weapon is TAB
;; - start the script with F7, Reload with F6 and stop with F8
;; - the timings between each inputs are adapted to my rig , make sure to adapt the timings to yours
;; - direction keys are W A S D

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
;SetKeyDelay, 20, 20
#MaxThreadsperHotkey 2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
WinGetPos, WinX, WinY, WinW, WinH, ELDEN RING™
if (WinX !=0)
	Winmove, ELDEN RING™, , 0, 0
SetBatchLines, -1
WinActivate ELDEN RING™
#IfWinActive, ELDEN RING™
F6::reload
F8::ExitApp
F7::
Gosub main

main:
loop{
run MikeywwScoreboardforfarm.ahk
;; G F E E ==> we go the the closest site of grace
Sleep 30
Send, {g down}
Sleep 30
Send, {g up}
loop, 300 {
ImageSearch, , ,1802, 100, 1816, 119, *25 *transblack Compass.png
If (ErrorLevel = 0){
	break
}
If (A_Index = 300){
	Sleep, 100
	Gosub main
	break
}
}
Send, {f down}
Sleep 30
Send, {f up}
Sleep 30
loop,100 {
	Imagesearch, , , 52, 150, 116, 970, *25 *transblack GraceList.png
If (ErrorLevel = 0) {
	break
	}
	If (A_Index = 100) {
Sleep 30
Send, {f up}
Sleep 30
Send, {f down}
Sleep 30
Send, {f up}
Sleep 30
break
}
}


Send, {e down}
Sleep 30
Send, {e up}
Sleep 85
Loop, 100 {
	Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
If (ErrorLevel = 0) {
Send, {e up}
Sleep 85
Send, {e down}
Sleep 45
break
}
}

Send, {e down}
Sleep 2000
	Imagesearch, , , 119, 1017, 584, 1035, *55 *Transblack Next.png
If (ErrorLevel = 1) {
Send, {e up}
Sleep 145
Send, {e down}
Sleep 2000
}
Sleep 2000

loop, 100 {
ImageSearch, , ,862, 908, 927, 920, *55 *transblack YRetrieve.png
If (ErrorLevel = 0){
Sleep 300
Send, {e up}
Sleep 300
Send, {e down}
Sleep 30
Send, {e up}
	Gosub main
	break
}
ImageSearch, , ,1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
If (ErrorLevel = 0){
	break
}
else
ImageSearch, , ,-1085, 1026, 0, 1045, *55 *transblack RuneIcon.png
If (ErrorLevel = 0){
	break
}
}

;; W A W ==> we zig zag into position

;BlockInput, MouseMove
Send, {e up}
Sleep 300
Send, {w down}
Sleep 30
Send, {space down}
Sleep 1760
Send, {a down}
Sleep 1000
Send, {a up}
Sleep 1400
Send, {a down}
Sleep 400
Send, {space up}{a up}{d down}
Sleep 140
Send, {d up}{w up}
Sleep 50 ; you may need to adjust this for the Pixelsearch to work
Loop {
PixelSearch, PixelX, PixelY, 820, 400, 821, 600, 0x6EB0CF, 35, fast
If (ErrorLevel = 1){
SoundBeep, 500
Send, {w down}{d down}
Sleep 30
Send, {d up}{w up}
break
}
If (ErrorLevel = 0) {
SoundBeep, 1000
ToolTip, %PixelX% %PixelY%,PixelX, PixelY
SetTimer, RemoveToolTip, -3000
break
}
}

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
;BlockInput, MouseMoveOff
Sleep 6500
}
return

RemoveToolTip:
ToolTip
return
Last edited by Noo0B on 06 Sep 2022, 03:52, edited 1 time in total.

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 07 Aug 2022, 07:10

Here's a little correction for the script:
You may want to change this

Code: Select all

	Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
If (ErrorLevel = 0) {
Send, {e up}
Sleep 85
Send, {e down}
Sleep 45
break
}
into this:

Code: Select all

	Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
If (ErrorLevel = 1) {
Sleep 30
Send, {e down}
Sleep 30
Send, {e up}
break
}

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 22 Aug 2022, 01:22

Here's an update to the code.
Since I don't have access to the weapon anymore I can not test it, so this is just code from another script.
The main changes are that it's now faster to capture the score and calculate each farm. It uses the score capture inside the code without having to call another script and most importantly it goes into a few statements to verify if you died and failed to collect the runes. If the runes are out of reach from their search code location - by the grace in this case - it will kill the script after a couple tries until the player manually collects them. At least that's how it worked on the other script, so I left the tooltips there to help in case someone wants to change it. I'm not sure how needed this is in this script, since the runes seem to always be by the grace, but just in case they don't, this will save you from losing them.
This post viewtopic.php?f=74&t=107303&p=477189#p477189 shows how to call another script, provided below, to restart Elden Ring and the script in case the game crashes. Make sure to check lines 94/95 and lines 62/74 on the reload script for their names so that they match. Please note that the names are different from what was used in the other farm code posts. Also, I haven't tested the timings for these changes or pretty much anything in this script as well so might be unwanted errors coming up with the files provided, their file names or so.
If you don't want any of these and feel comfortable with the shorter timings from the previous script, you can just remove the code you don't want or change the {* up} part from the previous code to improve on that.
Here's the new code:

Code: Select all

#NoEnv
#Warn
#SingleInstance Force
Process, priority, , high
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 2
#MaxThreadsperHotkey 2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
WinGetPos, WinX, WinY, WinW, WinH, ELDEN RING™
if (WinX !=0)
	Winmove, ELDEN RING™, , 0, 0
SetBatchLines, -1
WinActivate ELDEN RING™
#IfWinActive, ELDEN RING™
;#UseHook Off
xposList:= [[1750, 1771], [1761, 1782], [1772, 1793], [1783, 1805], [1794, 1816]
,[1806, 1827] , [1817, 1840], [1830, 1850], [1843, 1865]]
score := 0
score0 := 0
score0reload := 0
F6::reload
F8::ExitApp
F9::Pause
F7::Gosub main
main:
previousscore := score
loop {
	Sleep 50
	Send, {r up}{e up}{f up}{g up}{w up}{a up}{d up}{o up}
	Sleep 50
	Send, {g down}
	Sleep 30
	Send, {g up}
	loop, 300 {
		ImageSearch, , , 1802, 100, 1816, 119, *25 *transblack Compass.png
			If (ErrorLevel = 0) {
				break
			}
			If (A_Index = 300) {
				Sleep, 100
				Gosub main
				break
			}
	}
	Send, {f down}
	Sleep 30
	Send, {f up}
	Sleep 30
	loop,100 {
		Imagesearch, , , 85, 150, 105, 970, *25 *transblack GraceList.png
			If (ErrorLevel = 0)
				break
		If (A_Index = 100) {
			Sleep 30
			Send, {f up}
			Sleep 30
			Send, {f down}
			Sleep 30
			Send, {f up}
			Sleep 30
			break
		}
	}
	Send, {e down}
	Sleep 30
	Send, {e up}
	Sleep 30
	Loop, 100 {
		Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
			If (ErrorLevel = 0) {
				Send, {e down}
				Sleep 30
				Send, {e up}
				break
			}
	}
	Send, {e down}
	Sleep 1000
	loop, 1000 {
		Imagesearch, , , 148, 1018, 382, 1034, *55 *Transblack Next.png
			If (ErrorLevel = 1) {
				If (A_Index = 1) {
					Send, {e up}
					Sleep 145
					Send, {e down}
					Sleep 1000
				}
				break
			}
			If (A_Index =1000) and (ErrorLevel = 0) {
				run, MohgwinFarmTSch
				Process, WaitClose, MohgwinFarmTSch
				ExitApp
			}
	}
	Sleep 500
	loop, 400 {
		ImageSearch, , , 1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
			If (ErrorLevel = 0) {
				Sleep, 2000
				score =
				For each, xpos in xposList {
					Loop, 11 {
						digit := A_Index - 1
						image :="Digit" digit ".png"
						ImageSearch,,, xpos.1, 1025, xpos.2, 1047, *115 *transblack %image%
						err := ErrorLevel
						If (digit = 10)
							digit:= 0
					} Until !err
				score .= err ? "_" : digit
				}
				sessiontotal := score - previousscore
				Tooltip, score = %score%`nsession total = %sessiontotal%, 900, 900
				SetTimer, RemoveToolTip, -2000
				If (score0 = 0) {
					Tooltip, score0reload = %score0reload%`nscore0 = %score0%, 400, 100, 2
					SetTimer, RemoveToolTip2, -4000
					break
				}
				If (score0 = 1) {
					Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%, 400, 100
					SetTimer, RemoveToolTip, -4000
					If (score < 150000) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`nscore < 150000`n"break", 600, 300, 2
						SetTimer, RemoveToolTip2, -4000
						break
					}
					If (score > 150000) {
						If (score < 290000) {
							Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`nscore > 150000`n"ExitApp", 700, 400, 2
							SetTimer, RemoveToolTip2, -4000
							Exitapp
						}
						Else {
							score0 := 0
							score0reload := 0
							break
						}
					}
					If (score = 0) {
						Score0+= 1
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`nscore = 0`n"Break", 800, 500, 2
						SetTimer, RemoveToolTip2, -4000
						break
					}
				}
			}
			If (ErrorLevel = 1) {
				If (A_Index = 1) {
					Send, {e down}
					Sleep 50
					Send, {e up}
					Sleep 350
				}
				If (A_Index = 400) {
					If (score0 = 2) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"exitApp", 900, 600, 2
						SetTimer, RemoveToolTip2, -4000
						ExitApp
					}
					If (score0reload > 0) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"Continue", 1000, 700, 2
						SetTimer, RemoveToolTip2, -4000
						continue
					}
					{
					score0 += 1
					Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"A_Index = 400", 1100, 800, 2
					SetTimer, RemoveToolTip2, -4000
					}
				}
			}
	}
	Sleep 60
	Send, {e up}
	Sleep 450
	ImageSearch, , , 862, 908, 927, 920, *55 *transblack YRetrieve.png
		If (ErrorLevel = 0) {
			Send, {e down}
			Sleep 50
			Send, {e up}
			Sleep 550
			If (score0 > 0) {
				score0reload := 0
				score0 := 0
			}
		}

;; W A W ==> we zig zag into position

;BlockInput, MouseMove
Send, {e up}
Sleep 300
Send, {w down}
Sleep 30
Send, {space down}
Sleep 1760
Send, {a down}
Sleep 1000
Send, {a up}
Sleep 1400
Send, {a down}
Sleep 400
Send, {space up}{a up}{d down}
Sleep 140
Send, {d up}{w up}
Sleep 50 ; you may need to adjust this for the Pixelsearch to work
Loop {
PixelSearch, PixelX, PixelY, 820, 400, 821, 600, 0x6EB0CF, 35, fast
If (ErrorLevel = 1){
SoundBeep, 500
Send, {w down}{d down}
Sleep 30
Send, {d up}{w up}
break
}
If (ErrorLevel = 0) {
SoundBeep, 1000
ToolTip, %PixelX% %PixelY%,PixelX, PixelY
SetTimer, RemoveToolTip, -3000
break
}
}

;; TAB ==> we activate the weapon skill and wait some time to collect runes
Send, {TAB down}
Sleep 30
Send, {TAB up}
;BlockInput, MouseMoveOff
Sleep 6500
}
return

RemoveToolTip:
ToolTip
return
and here's the reload code:

Code: Select all

#NoEnv
; #Warn
SendLevel 1
SendMode Input
SetWorkingDir %A_ScriptDir%
;Process, close, ELDEN RING™
SetTitleMatchMode, 2
#MaxThreadsperHotkey 2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
Process, close, eldenring.exe
Sleep, 400
run, start_protected_game.exe, C:\Program Files (x86)\Steam\steamapps\common\ELDEN RING\Game
loop {
	ImageSearch, , , 689, 414, 704, 431, *25 *Transblack EldenRingStart.png
		if (ErrorLevel = 0) {
			Send, {enter down}
			sleep, 50
			Send, {enter up}
			break
		}
	}
loop {
	ImageSearch, , , 846, 601, 873, 611, *25 *Transblack EldenRingOK.png
		if (ErrorLevel = 0) {
			MouseMove, 962, 661
			Send, {LButton down}
			sleep, 50
			Send, {LButton up}
			break
		}
	}
loop {
	ImageSearch, , , 891, 742, 915, 753, *25 *Transblack EldenRingInformation.png
		if (ErrorLevel = 0) {
			MouseMove, 950, 749
			sleep, 50
			Send, {LButton down}
			sleep, 50
			Send, {LButton up}
			break
		}
	}
loop {
	ImageSearch, , , 689, 414, 704, 431, *25 *Transblack EldenRingStart.png
		if (ErrorLevel = 0) {
			MouseMove, 966, 808
			sleep, 50
			Send, {LButton down}
			sleep, 50
			Send, {LButton up}
			break
		}
	}
sleep, 5000
loop, 1000 {
	Imagesearch, , , 148, 1018, 382, 1034, *115 *Transblack Next.png
		If (ErrorLevel = 1)
			break
		If (A_Index = 10000) and (ErrorLevel = 0) {
			run, MohgwinFarmClose
			Return
		}
}
Sleep 1000
loop, 400 {
	If (A_Index = 1) {
			tooltip, RuneIcon.png search started, 1100, 800, 18
			SetTimer, RemoveToolTip18, -1000
		}
ImageSearch, , ,1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
	If (ErrorLevel = 0){
			run, MohgwinFarm20.ahk
			Sleep, 2000
			Send, {F7 down}
			Sleep, 50
			Send, {F7 up}
			tooltip, MohgwinFarmClose exited, 1000, 800, 17
			SetTimer, RemoveToolTip17, -1000
			Sleep, 1000
	break
	}
}
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
ExitApp
Their names are MohgwinFarm20.ahk and MohgwinFarmClose.ahk if that makes it easier for you or I missed something, and the elevated task is named MohgwinFarmTSch. Special thanks to Mikeyww for providing the score code.
Last edited by Noo0B on 24 Aug 2022, 13:51, edited 1 time in total.

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 22 Aug 2022, 03:19

I forgot to edit the statements for this script, so where its < and > 150000 adjust to whatever you are getting on a single farm. You may want to take into consideration the yellow-eyed mobs that give 5x runes too. Accordingly, double that or so on the other statement for quitting the script after 2 failed tries to retrieve the runes.

Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: script to farm the albinaurics in loop on Elden ring

Post by Noo0B » 28 Aug 2022, 07:25

You may want to add a "process, waitclose ,..." line to the reload code.
I've had a few instances where the game was left unattended for hours and probably hanged and got closed but didn't restart properly.
I'm not sure this will fix it, but seems it is a good first step.
*edit
You may also want to increase the time before it launchess the process to let steam do its thing.
*edit2
The above error was probly caused by the script name not matching with the reload script. So, if you are not reloading, it's worth checking that.

Post Reply

Return to “Gaming Scripts (v1)”