Elden Ring: Script to farm the rolling rock ball

Post gaming related scripts
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 07 Aug 2022, 07:05

Hi,
Here's a script to farm the rock ball at Lenne's rise grace point.
You will need to have Torrent selected, and if you have problems summoning him alternately, adjust line 149 for your map load times.
Also, you may need to have Lenne's rise unfavorited for this one I think.
Also, I advise keeping the movement tooltips because removing them might offset the timings.
As a final note, there's always a chance that the rock hit you, although I tested this for hours and it doesn't seem to happen with these timings, but you never know. To avoid losing your runes in case that happens, you may want to increase Vigor first, then go on from there.
Here's the code:

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
Process, priority, , high
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{
GetKeyState, rstate, r
if (rstate = "D") {
	tooltip, r, 700, 300, 12
	SetTimer, RemoveTooltip12, -1000
Send, {r  up}
Sleep 30
}
GetKeyState, estate, e
if (estate = "D") {
	tooltip, e, 730, 330, 13
	SetTimer, RemoveTooltip13, -1000
Send, {e  up}
Sleep 30
}
GetKeyState, fstate, f
if (fstate = "D") {
	tooltip, f, 760, 360, 14
	SetTimer, RemoveTooltip14, -1000
Send, {f  up}
Sleep 30
}
GetKeyState, gstate, g
if (gstate = "D") {
	tooltip, g, 790, 390, 15
	SetTimer, RemoveTooltip15, -1000
Send, {g  up}
Sleep 30
}
GetKeyState, wstate, w
if (wstate = "D") {
	tooltip, w, 820, 420, 16
	SetTimer, RemoveTooltip16, -1000
Send, {w  up}
Sleep 30
}
GetKeyState, sstate, s
if (sstate = "D") {
	tooltip, s, 850, 450, 17
	SetTimer, RemoveTooltip17, -1000
Send, {s  up}
Sleep 30
}
GetKeyState, astate, a
if (astate = "D") {
	tooltip, a, 880, 480, 18
	SetTimer, RemoveTooltip18, -1000
Send, {a  up}
Sleep 30
}
GetKeyState, dstate, d
if (dstate = "D") {
	tooltip, d, 910, 510, 19
	SetTimer, RemoveTooltip19, -1000
Send, {d  up}
Sleep 30
}


;; 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 Lenne'sGrace.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 5000
	Imagesearch, , , 119, 1017, 584, 1035, *55 *Transblack Next.png
If (ErrorLevel = 1) {
Send, {e up}
Sleep 145
Send, {e down}
Sleep 3000
}
Sleep 1000

loop, 1000 {
ImageSearch, , ,1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
If (ErrorLevel = 0){
	break
}
}

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

;BlockInput, MouseMove
Sleep 60
Send, {e up}
Sleep 60
Send, {r down}
Sleep 360
Send, {r up}
Sleep 30
Send, {d down}{s down}
	tooltip, 1 ds, 900, 600, 2
SetTimer, RemoveToolTip2, -1600
Sleep 1600
Send, {space down}{w down}{d up}{s up}
	tooltip, 2 w S, 900, 600, 3
SetTimer, RemoveToolTip3, -2000
Sleep 2000
Send, {d down}
	tooltip, 3 wd S, 900, 600, 4
SetTimer, RemoveToolTip4, -550
Sleep 550
Send, {d up}
	tooltip, 4 w S, 900, 600, 5
SetTimer, RemoveToolTip5, -7400
sleep 7400
Send, {a down}
	tooltip, 5 wa S, 900, 600, 6
SetTimer, RemoveToolTip6, -300
Sleep 300
Send, {a up}
	tooltip, 6 w S, 900, 600, 7
SetTimer, RemoveToolTip7, -200
sleep 200
Send, {a down}
	tooltip, 7 wa S, 900, 600, 8
SetTimer, RemoveToolTip8, -300
Sleep 300
Send, {space up}{w up}{d down}{a up}
	tooltip, 8 d, 900, 600, 9
SetTimer, RemoveToolTip9, -600
Sleep 400
Send, {s down}
	tooltip, 9 ds, 900, 600, 10
SetTimer, RemoveToolTip10, -200
Sleep 400
send, {w down}{s up}
	tooltip, 10 w, 900, 600, 11
SetTimer, RemoveToolTip11, -100
sleep 100
Send, {d down}{space down}
	tooltip, 11 wd S, 900, 600, 12
SetTimer, RemoveToolTip12, -2300
sleep 2300
Send, {w up}{d up}{space up}
sleep 2300
}
return

RemoveToolTip:
ToolTip
return
RemoveToolTip2:
ToolTip,,,, 2
return
RemoveToolTip3:
ToolTip,,,,3
return
RemoveToolTip4:
ToolTip,,,,4
return
RemoveToolTip5:
ToolTip,,,,5
return
RemoveToolTip6:
ToolTip,,,,6
return
RemoveToolTip7:
ToolTip,,,,7
return
RemoveToolTip8:
ToolTip,,,,8
return
RemoveToolTip9:
ToolTip,,,,9
return
RemoveToolTip10:
ToolTip,,,,10
return
RemoveToolTip11:
ToolTip,,,,11
return
RemoveToolTip12:
ToolTip,,,,12
return
RemoveToolTip13:
ToolTip,,,,13
return
RemoveToolTip14:
ToolTip,,,,14
return
RemoveToolTip15:
ToolTip,,,,15
return
RemoveToolTip16:
ToolTip,,,,16
return
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
RemoveToolTip19:
ToolTip,,,,19
return
RemoveToolTip20:
ToolTip,,,,20
return
I hope it works for you. if it doesn't let me know.
Regards.


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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 08 Aug 2022, 20:34

I've added a jump to avoid colliding with the deer on top of the left climb, this seems to be more consistent:*edit code deprecated
Last edited by Noo0B on 13 Aug 2022, 05:20, edited 1 time in total.

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 11 Aug 2022, 10:18

If you are having load freezes during this script, you may want to uninstall Edge via command line. Shutting off your screen during load also cause this.
This seems to happen a lot more constantly here than with the Albinauric script, but removing Edge solved it. It has to do with backgroud processes, but more than that, don't ask me.
Here's the code I'm using right now, which is very much the same, except for a longer load wait and longer wait for the runes:
* edit code deprecated
Last edited by Noo0B on 13 Aug 2022, 05:18, edited 1 time in total.

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 11 Aug 2022, 18:25

As an addendun to the previous reply, I've performed a fresh windows install and noticed that Edge did not seem to interfere with the chances of the game freezing anymore, but shutting down the screen still does. I've tested it a few hours only, so this could be related to something else entirely different.
Another thing that I noticed was that the timings looked different, with the collision with the exposed root and the end of movement 2 not happening as always as it used to before this install.
This behavior happened mainly at the very first runs of the script, and then it continued with less probability.
I'm totally at odd why this happens like this. I've noticed that sometimes the first run of the script offsets differently, but this seemed constantly different.
So, I've patched the timings to allow a more constant result at the end of movement 2 so the long run don't end up too much to the right.
*edit: code deprecated
Last edited by Noo0B on 13 Aug 2022, 05:22, edited 1 time in total.

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 13 Aug 2022, 05:13

So, I came up with a code that relaunches Elden Ring in case it crashes, and restarts the farming script.
Also, I found out that my system was having some erratic behavior regarding symbols, with inconsistent behavior before and after a W10 fresh install.
Regarding the symbols, this may have prevented the script from running for some. I've found a solution, but I still don't quite understand how it works. If your code is failing to interpret "ELDEN RING™", "™" can be interpreted by adding Global Unicode to your Windows (10 in my case) language administrative configurations. Somewhere around my last setup copy-and-paste "ELDEN RING™" got changed to "ELDEN RING™" with the "™" being substituted with an "x99" inside a black box. That worked for me before, and now it doesn't. So, I'm gonna go with "™" and those that have problems with it just do the Global Unicode setting.
Also, I found out that there's a missing capture on the files. It stopped the code from adjusting to each rig load times with the ImageSearch for it, making the code dependent of the sleep time before its search.
As for the reload code, you will need to follow the instructions on this post for the reload script to get Admin rights and skip the UAC popup : viewtopic.php?f=74&t=107303&p=477189#p477189. I named my shortcut "EldenRingCloseTsch", you can use this name to avoid having to change the farm script at lines 158 and 159. It doesn't matter what you name the AHK reload script you will copy from here, as long the .bat *edit: "and .ahk" points to it. Also, the farm script name I use is "BallFarm7restart.ahk" and if you don't want to edit the reload script's line 83 , use this.
You can test if the scripts are working together by removing the ";" from the tooltips and more specifically alternating it for the next line at lines 140, 142 and 154. This will force the script to interpret that it's stuck on the load screen and launch the reloader script.
Also, make sure to adjust the timings for your rig, most importantly before the Next.png file searches on both scripts.
*edited to add .ahk file name line
This is not tested, so use with caution.
here's the missing capture:
https://drive.google.com/file/d/1XRj4SX4JLVnmULI5DD44f7tPW4oMlm2P/view?usp=sharing and here's the farm script with "ELDEN RING™":

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
Process, priority, , high
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™
;#UseHook Off
F6::reload
F8::ExitApp


F7::Gosub main

main:
loop {
GetKeyState, rstate, r
	if (rstate = "D") {
		tooltip, r, 700, 300, 12
		SetTimer, RemoveTooltip12, -1000
	Send, {r  up}
	Sleep 30
	}
GetKeyState, estate, e
	if (estate = "D") {
		tooltip, e, 730, 330, 13
		SetTimer, RemoveTooltip13, -1000
	Send, {e  up}
	Sleep 30
	}
GetKeyState, fstate, f
	if (fstate = "D") {
		tooltip, f, 760, 360, 14
		SetTimer, RemoveTooltip14, -1000
	Send, {f  up}
	Sleep 30
	}
GetKeyState, gstate, g
	if (gstate = "D") {
		tooltip, g, 790, 390, 15
		SetTimer, RemoveTooltip15, -1000
	Send, {g  up}
	Sleep 30
	}
GetKeyState, wstate, w
	if (wstate = "D") {
		tooltip, w, 820, 420, 16
		SetTimer, RemoveTooltip16, -1000
	Send, {w  up}
	Sleep 30
	}
GetKeyState, sstate, s
	if (sstate = "D") {
		tooltip, s, 850, 450, 17
		SetTimer, RemoveTooltip17, -1000
	Send, {s  up}
	Sleep 30
	}
GetKeyState, astate, a
	if (astate = "D") {
		tooltip, a, 880, 480, 18
		SetTimer, RemoveTooltip18, -1000
	Send, {a  up}
	Sleep 30
	}
GetKeyState, dstate, d
	if (dstate = "D") {
		tooltip, d, 910, 510, 19
		SetTimer, RemoveTooltip19, -1000
	Send, {d  up}
	Sleep 30
	}
;; 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 Lenne'sGrace.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 4000
;Sleep 2000
loop, 10000 {
;loop, 2 {
	Imagesearch, , , 148, 1018, 382, 1034, *55 *Transblack Next.png
		If (ErrorLevel = 1) {
			Send, {e up}
			Sleep 145
			Send, {e down}
			Sleep 1000
;			tooltip, Next.png not found, 900, 600, 14
;			SetTimer, RemoveToolTip14, -1000
			break
		}
		If (A_Index =10000) and (ErrorLevel = 0){
;		If (A_Index = 2) and (ErrorLevel = 0){
;		tooltip, Next.png  found, 900, 700, 15
;		SetTimer, RemoveToolTip15, -1000
		run, EldenRingCloseTsch
		Process, WaitClose, EldenRingCloseTsch
		ExitApp
		}
;		If (ErrorLevel = 2) {
;			tooltip, Next.png Error, 900, 800, 16
;			SetTimer, RemoveToolTip16, -1000
;			break
;		}
}
Sleep 1000
loop, 1000 {
ImageSearch, , ,1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
	If (ErrorLevel = 0){
	break
	}
}

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

;BlockInput, MouseMove
Sleep 60
Send, {e up}
Sleep 60
Send, {r down}
Sleep 60
Send, {r up}
Sleep 30
Send, {d down}{s down}
	tooltip, 1 ds, 900, 600, 2
SetTimer, RemoveToolTip2, -1600
Sleep 1600
Send, {space down}{w down}{d up}{s up}
	tooltip, 2 w S, 900, 600, 3
SetTimer, RemoveToolTip3, -2000
Sleep 2000
Send, {d down}
	tooltip, 3 wd S, 900, 600, 4
SetTimer, RemoveToolTip4, -550
Sleep 550
Send, {d up}
	tooltip, 4 w S, 900, 600, 5
SetTimer, RemoveToolTip5, -7300
sleep 5400
Send, {f down}
	tooltip, 5 f F, 900, 650, 6
SetTimer, RemoveToolTip6, -1660
Sleep 30
Send, {f Up}
Sleep 600
Send, {f down}
Sleep 30
Send, {f Up}
sleep, 1200

Send, {a down}
	tooltip, 6 wa S, 900, 600, 7
SetTimer, RemoveToolTip7, -300
Sleep 300
Send, {a up}{space up}
	tooltip, 7 w, 900, 600,8
SetTimer, RemoveToolTip8, -500
sleep 500
Send, {a down}
	tooltip, 8 wa, 900, 600, 9
SetTimer, RemoveToolTip9, -500
Sleep 500
Send,{w up}{d down}{a up}
	tooltip, 9 d, 900, 600, 10
SetTimer, RemoveToolTip10, -200
Sleep 200
Send, {s down}
	tooltip, 10 ds, 900, 600, 11
SetTimer, RemoveToolTip11, -500
Sleep 500
send, {w down}{s up}{space down}
	tooltip, 11 w S, 900, 600, 12
SetTimer, RemoveToolTip12, -100
sleep 100
Send, {d down}
	tooltip, 12 wd S, 900, 600, 13
SetTimer, RemoveToolTip13, -2300
sleep 2300
Send, {w up}{d up}{space up}
sleep 2500
}
return

RemoveToolTip:
ToolTip
return
RemoveToolTip2:
ToolTip,,,, 2
return
RemoveToolTip3:
ToolTip,,,,3
return
RemoveToolTip4:
ToolTip,,,,4
return
RemoveToolTip5:
ToolTip,,,,5
return
RemoveToolTip6:
ToolTip,,,,6
return
RemoveToolTip7:
ToolTip,,,,7
return
RemoveToolTip8:
ToolTip,,,,8
return
RemoveToolTip9:
ToolTip,,,,9
return
RemoveToolTip10:
ToolTip,,,,10
return
RemoveToolTip11:
ToolTip,,,,11
return
RemoveToolTip12:
ToolTip,,,,12
return
RemoveToolTip13:
ToolTip,,,,13
return
RemoveToolTip14:
ToolTip,,,,14
return
RemoveToolTip15:
ToolTip,,,,15
return
RemoveToolTip16:
ToolTip,,,,16
return
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
RemoveToolTip19:
ToolTip,,,,19
return
RemoveToolTip20:
ToolTip,,,,20
return
Finally, the reloader 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.
;Process, close, ELDEN RING™
SetTitleMatchMode, 2
#MaxThreadsperHotkey 2
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
Process, close, eldenring.exe
Sleep, 100
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, 10000 {
	Imagesearch, , , 148, 1018, 382, 1034, *115 *Transblack Next.png
		If (ErrorLevel = 1) {
;			tooltip, Next.png not found, 900, 600, 14
;			SetTimer, RemoveToolTip14, -1000
			break
		}
		If (A_Index = 10000) and (ErrorLevel = 0){
;			tooltip, Next.png found, 900 + A_Index*10, 700, 15
;			SetTimer, RemoveToolTip15, -1000
			run, EldenRingCloseTsch
			Return
		}
;		If (ErrorLevel = 2) {
;			tooltip, Next.png Error, 900, 800, 16
;			SetTimer, RemoveToolTip16, -1000
;			break
;		}
}
Sleep 1000
loop, 1000 {
	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, BallFarm7restart.ahk
			Sleep, 2000
			Send, {F7 down}
			Sleep, 50
			Send, {F7 up}
			tooltip, EldenRingClose exited, 1000, 800, 17
			SetTimer, RemoveToolTip17, -1000
			Sleep, 1000
	break
	}
}
RemoveToolTip14:
ToolTip,,,,14
return
RemoveToolTip15:
ToolTip,,,,15
return
RemoveToolTip16:
ToolTip,,,,16
return
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
ExitApp
Last edited by Noo0B on 28 Aug 2022, 07:43, edited 1 time in total.

schmielphth
Posts: 1
Joined: 21 Aug 2022, 14:07

Re: Elden Ring: Script to farm the rolling rock ball

Post by schmielphth » 21 Aug 2022, 14:10

Any ideas why this script causes me not to be able to alt-tab into the game?

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 22 Aug 2022, 00:33

Most likely screen coordinates.
If you have a different screen arrangement than mine this might happen.
You may need to adapt the screen coordinates to your setup.
You may want to start by trying to change or removing these lines:

Code: Select all

WinGetPos, WinX, WinY, WinW, WinH, ELDEN RING™
if (WinX !=0)
	Winmove, ELDEN RING™, , 0, 0

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 28 Aug 2022, 07:24

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

Moradin
Posts: 6
Joined: 21 Oct 2022, 02:45

Re: Elden Ring: Script to farm the rolling rock ball

Post by Moradin » 21 Oct 2022, 03:08

I've tried to get this to work.. however, it doesn't seen to recognise the Elden Ring Window.. as per your post earlier, i tried to add unicode etc, to language settings, for the tm.. but no clue what i'm doing wrong. it loads,, and gives a pop up window, if i try to load the ball script again, saying 'it's already loaded;, overwrite etc? ''' so i know the script is actually running...

Moradin
Posts: 6
Joined: 21 Oct 2022, 02:45

Re: Elden Ring: Script to farm the rolling rock ball

Post by Moradin » 21 Oct 2022, 03:50

Further testing with a messagebox, shows that it does detect the keyboard Function keys, in that i can start, stop, etc.. so it get's to Main.. and they does nothing...

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 22 Oct 2022, 04:14

First you need to know if the script is working with ER.
either remove the
WinActivate ELDEN RING™
#IfWinActive, ELDEN RING™
or do the unicode setting, then under the file tab on SciTE choose encoding utf8 with bom, paste the TM back to the code and save.
Using resolution 1080p, xbox controller. One of images "Yretrieve" points to it, you need to change at least that one if you are not using the controller.

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 22 Oct 2022, 15:37

Here's another version of the script, with a few addups.
Considerations are:
Removing the movement tooltips may or may not have offset the movement. It seems that it doesn`t change the outcome of the script though.
The last Imagesearch position parameters were set with the movement tooltips and may not prevent the script from continuing if the player hits the tree from the left or hit a deer and climb on the left rock. Looks like it can work some times but it may fail. I could not test it due to the unlikelyhood of that happening.
The retrieve code was placed on a random position. If you are dying, which you shouldn't, and the runes are spawning elsewhere, increase the sleep time before the search or move the retrieve code back to where the runes are spawning.
You may need to adjust the timings, specially for the next.png and score ImageSearchs.
You may need your own captures.
The resolution used was 1080p with an xbox controller for the YRetrieve capture.
Use borderless windowed.
Here's the capture for the poscheck: https://drive.google.com/file/d/1Z9QwvJqunK4z_C7HDsgQQBt_LMSpWGi6/view?usp=sharing
and the 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™
Send, {w up}{a up}{s up}{r up}{e up}{f up}{g up}{d up}{space up}
xposList:= [[1750, 1771], [1761, 1782], [1772, 1793], [1783, 1805], [1794, 1816]
,[1806, 1827] , [1817, 1840], [1830, 1850], [1843, 1865]]
F8::ExitApp
F9::Pause
F6::reload

F7::
score := 0
score0 := 0
score0reload := 0
loopindex := 0
completionindex := 0
pos1fail := 0
pos2fail := 0
alignment := 0
sessiontotal := 0
deathindex := 0
deathtoggle := 0
starttime := A_Now
starttimems := A_TickCount
loop {
	loop{
		SetTimer, RemoveToolTip4, -60
		Send, {w up}{a up}{s up}{r up}{e up}{f up}{g up}{d up}{space up}
		if deathtoggle
			deathindex += 1
		deathtoggle := 1
		pos2alignmentsum := 0
		pos2alignmentavg := 0
		pos1alignment := 0
		pos2alignment := 0
		previousscore := score
		loopindex += 1
		deaths := alignment - completionindex
		Sleep 50
		Send, {w up}{a up}{r up}{e up}{f up}{g up}{d up}{o up}{space up}
		Sleep 50
		Send, {g down}
		Sleep 50
		Send, {g up}
		Sleep 200
		loop, 300 {
			ImageSearch, , , 1780, 90, 1836, 139, *95 *transblack Compass.png
				if (ErrorLevel = 0)
					break
				if (ErrorLevel = 2)
					break, 2
				if (A_Index = 300)
					break, 2
			Sleep 30
		}
		Sleep 50
		Send, {f down}
		Sleep 50
		Send, {f up}
		Sleep 50
		loop,200 {
			Imagesearch, , , 52, 150, 116, 970, *95 *transblack Lenne'sGrace.png
				if (ErrorLevel = 0)
					break
			if (A_Index = 200) {
				Sleep 30
				Send, {f up}
				Sleep 30
				Send, {f down}
				Sleep 30
				Send, {f up}
				Sleep 30
				break
			}
			Sleep 30
		}
		Send, {e down}
		Sleep 30
		Send, {e up}
		Sleep 30
		Loop, 200 {
			Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
				if (ErrorLevel = 0) {
					Send, {e down}
					Sleep 30
					Send, {e up}
					break
				}
			if (A_Index = 200) {
				Sleep 30
				Send, {e up}
				Sleep 30
				Send, {e down}
				Sleep 30
				Send, {e up}
				Sleep 30
			}
			Sleep 30
		}
		Send, {e down}
		Sleep 1000
		loop, 10000 {
			Imagesearch, , , 148, 1018, 382, 1034, *65 *Transblack Next.png
				if (ErrorLevel = 1) {
					if (A_Index = 1) {
						Send, {e up}
						Sleep 145
						Send, {e down}
						Sleep 2000
					}
					break
				}
				if (A_Index = 10000) and (ErrorLevel = 0) {
					run, MohgwinFarmTSch
					ExitApp
				}
			Sleep 30
		}
		Sleep 500
		Send, {e up}
		Sleep 750
		Loopindexdivisor := loopindex - 1
		completion := completionindex / loopindexdivisor
		if (completionindex = 0)
			completion := 0
		completion := round(completion, 2)
		completionpercentage := round(completion * 100)
		alignmentpct := alignment / loopindexdivisor
		if (alignment = 0)
			alignmentpct := 0
		alignmentpct := round(alignmentpct, 2)
		alignmentpercentage := round(alignmentpct * 100)
		alignmentfails := pos1fail + pos2fail
		Tooltip, farm attempts: %Loopindexdivisor%`ncomplete farms = %completionindex%`ndeaths = %deaths%`nalignmentfails = %alignmentfails%`npos1fail = %pos1fail%`npos2fail = %pos2fail%`ntotal alignments = %alignment%`nalignment `% = %alignmentpercentage% `%`ndeathindex = %deathindex%`ncompletion `%= %completionpercentage% `%, 0, 1080, 3
		Sleep 450
		loop, 400 {
			ImageSearch, , , 1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					Sleep, 1700
					score =
					For each, xpos in xposList {
						Loop, 11 {
							digit := A_Index - 1
							image :="Digit" digit ".png"
							Tooltip,., xpos.1, 1080,4
							SetTimer, RemoveToolTip4, -100
							ImageSearch,,, xpos.1, 1025, xpos.2, 1047, *115 *transblack %image%
							err := ErrorLevel
							if (digit = 10)
								digit:= 0
						} Until !err
					score .= err ? "_" : digit
					}
					score := round(score)
					sessionscore := score - previousscore
					if (loopindex = 1)
						sessionscore := 0
					sessiontotal += sessionscore
					elapsedtime := A_Now
					elapsedtimess := elapsedtime
					elapsedtimemm := elapsedtime
					elapsedtimehh := elapsedtime
					elapsedtimedd := elapsedtime
					elapsedtimems := A_TickCount - starttimems
					elapsedtimedd -= starttime, days
					elapsedtimehh -= starttime, hours
					elapsedtimemm -= starttime, minutes
					elapsedtimess -= starttime, seconds
					elapsedtimess -= elapsedtimemm * 60
					elapsedtimemm -= elapsedtimehh * 60
					elapsedtimehh -= elapsedtimedd * 24
					scorerates := round(sessiontotal / elapsedtimems * 1000)
					scoreratem := round(sessiontotal / elapsedtimems * 60, 2)
					scorerateh := round(sessiontotal / elapsedtimems * 3.6, 2)
						if (sessionscore = 0)
							scorerate := 0
					Tooltip, score = %score%`nsession score = %sessionscore%`nrun time = %elapsedtimedd%d %elapsedtimehh%h%elapsedtimemm%m%elapsedtimess%s`nsession total = %sessiontotal%`naverage score/s= %scorerates% runes/s`naverage score/m = %scoreratem%k runes/m`naverage score/h = %scorerateh%M runes/h, 191, 995, 4
					SetTimer, RemoveToolTip4, -60000
					if (score0 = 0) {
						Tooltip, score0reload = %score0reload%`nscore0 = %score0%, 191, 843, 5
						SetTimer, RemoveToolTip5, -7000
						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 = 10) {
						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
						}
						{
						if loopindex > 1
							score0 += 1
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"A_Index = 10", 1100, 800, 2
						SetTimer, RemoveToolTip2, -4000
						break
						}
					}
				}
		}
		Sleep 60
		Send, {e up}
		Sleep 1600
		Send, {r down}
		Sleep 60
		Send, {r up}
		Sleep 50
		Send, {d down}{s down}
		Sleep 1600
		Send, {space down}{w down}{d up}{s up}
		Sleep 2000
		Send, {d down}
		Sleep 550
		Send, {d up}
		sleep 5400
		Send, {f down}
		Sleep 30
		Send, {f Up}
		Sleep 600
		Send, {f down}
		Sleep 30
		Send, {f Up}
		sleep, 1200
		Send, {a down}
		Sleep 300
		Send, {a up}{w up}{space up}
		Sleep 2000
		if (score0 > 0) or (loopindex = 1) {
			Sleep 1000
			ImageSearch, , , 862, 908, 927, 920, *75 *transblack YRetrieve.png
				if (ErrorLevel = 0) {
					Sleep 550
					Send, {e down}
					Sleep 50
					Send, {e up}
					Sleep 50
					if (score0 > 0) {
						score0reload := 0
						score0 := 0
					}
				}
		}
		sleep, 100
		loop {
			pos1alignment := 0
			pos1alignmentsum := 0
			pos1alignmentavg := 0
			pos1alignmentfail := 0
			loop {
				ImageSearch, BallPosCheck1x, BallPosCheck1y, 900, 117, 953, 127, *40 *transblack BallPosCheck1.png
					if (ErrorLevel = 0) {
						pos1alignmentsum += BallPosCheck1x
						pos1alignment += 1
						Tooltipindex:= 2 + A_Index
						Tooltipindex2:= 30 * A_Index
						tooltipindex3 := 0
						if (tooltipindex > 20) {
							tooltipindex3 += 50
							tooltipindex := 3
						}
						tooltip, %BallPosCheck1x%x, BallPosCheck1x + tooltipindex3, BallPosCheck1y + Tooltipindex2, %tooltipindex%
						SetTimer, RemoveToolTip%tooltipindex%, -3500
						if (pos1alignment = 18) {
							pos1alignmentavg := pos1alignmentsum / 18
							alignment += 1
							break, 2
						}
					}
					if (ErrorLevel) {
						BallPosCheck1x :=
						BallPosCheck1y :=
						pos1alignmentfail += 1
						if (pos1alignmentfail = 18) {
							deathtoggle := !deathtoggle
							pos1fail += 1
							if (score0 > 0)
								score0reload += 1
							break, 3
						}
					}
				Sleep 30
			}
		Sleep 30
		}
		Sleep 30
		Send, {w down}
		sleep 500
		Send, {a down}
		Sleep 500
		Send,{w up}{d down}{a up}
		Sleep 200
		Send, {s down}
		Sleep 500
		send, {w down}{s up}{space down}
		sleep 100
		Send, {d down}
		sleep 2300
		Send, {w up}{d up}{space up}
		sleep 4000
		ImageSearch, , , 1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					deathtoggle := !deathtoggle
					completionindex += 1
				}
	}
}
return

RemoveToolTip:
ToolTip
return
RemoveToolTip2:
ToolTip,,,, 2
return
RemoveToolTip3:
ToolTip,,,,3
return
RemoveToolTip4:
ToolTip,,,,4
return
RemoveToolTip5:
ToolTip,,,,5
return
RemoveToolTip6:
ToolTip,,,,6
return
RemoveToolTip7:
ToolTip,,,,7
return
RemoveToolTip8:
ToolTip,,,,8
return
RemoveToolTip9:
ToolTip,,,,9
return
RemoveToolTip10:
ToolTip,,,,10
return
RemoveToolTip11:
ToolTip,,,,11
return
RemoveToolTip12:
ToolTip,,,,12
return
RemoveToolTip13:
ToolTip,,,,13
return
RemoveToolTip14:
ToolTip,,,,14
return
RemoveToolTip15:
ToolTip,,,,15
return
RemoveToolTip16:
ToolTip,,,,16
return
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
RemoveToolTip19:
ToolTip,,,,19
return
RemoveToolTip20:
ToolTip,,,,20
return

robbversion1
Posts: 1
Joined: 06 Jan 2023, 14:31

Re: Elden Ring: Script to farm the rolling rock ball

Post by robbversion1 » 06 Jan 2023, 14:37

@Noo0B
I'm using your latest iteration of the Lenne's macro and it works great except for the score portion. The score and runes all show '0' after every successful run. I imagine it has to do with the timings like you mentioned in your last post but i'm not sure what I should be changing. I'm pretty new when it comes to AHK and scripting.

Thank you so much for the time and effort you put on this macro!

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 22 Jan 2023, 17:16

@robbversion1
Hi, thank you for trying this script, I'm sorry for the delayed response.
I'll reinstall the game and try with the provided captures and code to check it out.

lolgrade
Posts: 1
Joined: 25 Jan 2023, 19:34

Re: Elden Ring: Script to farm the rolling rock ball

Post by lolgrade » 25 Jan 2023, 19:36

Hi, im new to elden ring and to ahk ive already tried this method manually but its boring.. i dont know how to get the script started any help please? do i need to download the code compile it and run the .exe? ive done that but nothing happens ingame. thanks in advance

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 13 Feb 2023, 22:29

@lolgarde
Just press F7 to run the script. You will need all the files in the same directory.
@robbversion1
Sorry, the digit captures were missing from this post, along with another capture.

Here's another version of the script that worked better for me now, with the files:https://drive.google.com/drive/folders/1FcZ75fqW7F26LijvQ0VATMBtpZzdFIvQ?usp=sharing
and the 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™
Send, {w up}{a up}{s up}{r up}{e up}{f up}{g up}{d up}{space up}
xposList:= [[1750, 1771], [1761, 1782], [1772, 1793], [1783, 1805], [1794, 1816]
,[1806, 1827] , [1817, 1840], [1830, 1850], [1843, 1865]]
F8::ExitApp
F9::Pause
F6::reload

F7::
score := 0
score0 := 0
score0reload := 0
loopindex := 0
completionindex := 0
pos1fail := 0
pos2fail := 0
alignment := 0
sessiontotal := 0
deathindex := 0
deathtoggle := 0
starttime := A_Now
starttimems := A_TickCount
loop {
	loop{
		SetTimer, RemoveToolTip4, -60
		Send, {w up}{a up}{s up}{r up}{e up}{f up}{g up}{d up}{space up}
		if deathtoggle
			deathindex += 1
		deathtoggle := 1
		pos2alignmentsum := 0
		pos2alignmentavg := 0
		pos1alignment := 0
		pos2alignment := 0
		previousscore := score
		loopindex += 1
		deaths := alignment - completionindex
		Sleep 50
		Send, {w up}{a up}{r up}{e up}{f up}{g up}{d up}{o up}{space up}
		Sleep 50
		Send, {g down}
		Sleep 50
		Send, {g up}
		Sleep 200
		loop, 300 {
			ImageSearch, , , 1780, 90, 1836, 139, *95 *transblack Compass.png
				if (ErrorLevel = 0)
					break
				if (ErrorLevel = 2)
					break, 2
				if (A_Index = 300)
					break, 2
			Sleep 30
		}
		Sleep 50
		Send, {f down}
		Sleep 50
		Send, {f up}
		Sleep 50
		loop,50 {
			Imagesearch, , , 52, 150, 136, 1070, *95 *transblack Lenne'sGrace.png
				if (ErrorLevel = 0)
					break
			if (A_Index = 50) {
				Sleep 30
				Send, {f up}
				Sleep 30
				Send, {f down}
				Sleep 30
				Send, {f up}
				Sleep 30
				break
			}
			Sleep 30
		}
		Send, {e down}
		Sleep 30
		Send, {e up}
		Sleep 30
		Loop, 200 {
			Imagesearch, , , 1151, 582, 1162, 592, *115 *Transblack TravelCancel.png
				if (ErrorLevel = 0) {
					Sleep 30
					Send, {e down}
					Sleep 30
					Send, {e up}
					break
				}
			if (A_Index = 200) {
				Sleep 30
				Send, {e up}
				Sleep 30
				Send, {e down}
				Sleep 30
				Send, {e up}
				Sleep 30
			}
			Sleep 30
		}
		Send, {e down}
		Sleep 1000
		loop, 10000 {
			Imagesearch, , , 148, 1018, 382, 1034, *65 *Transblack Next.png
				if (ErrorLevel = 1) {
					if (A_Index = 1) {
						Send, {e up}
						Sleep 145
						Send, {e down}
						Sleep 2000
					}
					break
				}
				if (A_Index = 10000) and (ErrorLevel = 0) {
					run, MohgwinFarmTSch
					ExitApp
				}
			Sleep 30
		}
		Sleep 500
		Send, {e up}
		Sleep 750
		Loopindexdivisor := loopindex - 1
		completion := completionindex / loopindexdivisor
		if (completionindex = 0)
			completion := 0
		completion := round(completion, 2)
		completionpercentage := round(completion * 100)
		alignmentpct := alignment / loopindexdivisor
		if (alignment = 0)
			alignmentpct := 0
		alignmentpct := round(alignmentpct, 2)
		alignmentpercentage := round(alignmentpct * 100)
		alignmentfails := pos1fail + pos2fail
		Tooltip, farm attempts: %Loopindexdivisor%`ncomplete farms = %completionindex%`ndeaths = %deaths%`nalignmentfails = %alignmentfails%`npos1fail = %pos1fail%`npos2fail = %pos2fail%`ntotal alignments = %alignment%`nalignment `% = %alignmentpercentage% `%`ndeathindex = %deathindex%`ncompletion `%= %completionpercentage% `%, 0, 0, 3
		Sleep 450
		loop, 400 {
			ImageSearch, , , 1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					Sleep, 700
					score =
					For each, xpos in xposList {
						Loop, 11 {
							digit := A_Index - 1
							image :="Digit" digit ".png"
							Tooltip,., xpos.1, 1080,4
							SetTimer, RemoveToolTip4, -100
							ImageSearch,,, xpos.1, 1025, xpos.2, 1047, *115 *transblack %image%
							err := ErrorLevel
							if (digit = 10)
								digit:= 0
						} Until !err
					score .= err ? "_" : digit
					}
					score := round(score)
					sessionscore := score - previousscore
					if (loopindex = 1)
						sessionscore := 0
					sessiontotal += sessionscore
					elapsedtime := A_Now
					elapsedtimess := elapsedtime
					elapsedtimemm := elapsedtime
					elapsedtimehh := elapsedtime
					elapsedtimedd := elapsedtime
					elapsedtimems := A_TickCount - starttimems
					elapsedtimedd -= starttime, days
					elapsedtimehh -= starttime, hours
					elapsedtimemm -= starttime, minutes
					elapsedtimess -= starttime, seconds
					elapsedtimess -= elapsedtimemm * 60
					elapsedtimemm -= elapsedtimehh * 60
					elapsedtimehh -= elapsedtimedd * 24
					scorerates := round(sessiontotal / elapsedtimems * 1000)
					scoreratem := round(sessiontotal / elapsedtimems * 60, 2)
					scorerateh := round(sessiontotal / elapsedtimems * 3.6, 2)
						if (sessionscore = 0)
							scorerate := 0
					Tooltip, score = %score%`nsession score = %sessionscore%`nrun time = %elapsedtimedd%d %elapsedtimehh%h%elapsedtimemm%m%elapsedtimess%s`nsession total = %sessiontotal%`naverage score/s= %scorerates% runes/s`naverage score/m = %scoreratem%k runes/m`naverage score/h = %scorerateh%M runes/h, 191, 0, 4
					SetTimer, RemoveToolTip4, -60000
					if (score0 = 0) {
						Tooltip, score0reload = %score0reload%`nscore0 = %score0%, 191, 843, 5
						SetTimer, RemoveToolTip5, -7000
						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 = 10) {
						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
						}
						{
						if loopindex > 1
							score0 += 1
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"A_Index = 10", 1100, 0, 2
						SetTimer, RemoveToolTip2, -4000
						break
						}
					}
				}
		}
		Sleep 60
		Send, {e up}
		Sleep 1600
		Send, {r down}
		Sleep 60
		Send, {r up}
		Sleep 50
		Send, {d down}{s down}
		Sleep 1600
		Send, {space down}{w down}{d up}{s up}
		Sleep 2000
		Send, {d down}
		Sleep 550
		Send, {d up}
		sleep 5400
		Send, {f down}
		Sleep 30
		Send, {f Up}
		Sleep 600
		Send, {f down}
		Sleep 30
		Send, {f Up}
		sleep, 1200
		Send, {a down}
		Sleep 250
		Send, {a up}{w up}{space up}
		Sleep 2000
		if (score0 > 0) or (loopindex = 1) {
			Sleep 1000
			ImageSearch, , , 862, 908, 927, 920, *75 *transblack YRetrieve.png
				if (ErrorLevel = 0) {
					Sleep 550
					Send, {e down}
					Sleep 50
					Send, {e up}
					Sleep 50
					if (score0 > 0) {
						score0reload := 0
						score0 := 0
					}
				}
		}
		sleep, 100
		loop {
			pos1alignment := 0
			pos1alignmentsum := 0
			pos1alignmentavg := 0
			pos1alignmentfail := 0
			loop {
				ImageSearch, BallPosCheck1x, BallPosCheck1y, 900, 117, 953, 127, *40 *transblack BallPosCheck1.png
					if (ErrorLevel = 0) {
						pos1alignmentsum += BallPosCheck1x
						pos1alignment += 1
						Tooltipindex:= 2 + A_Index
						Tooltipindex2:= 30 * A_Index
						tooltipindex3 := 0
						if (tooltipindex > 20) {
							tooltipindex3 += 50
							tooltipindex := 3
						}
						tooltip, %BallPosCheck1x%x, BallPosCheck1x + tooltipindex3, BallPosCheck1y + Tooltipindex2, %tooltipindex%
						SetTimer, RemoveToolTip%tooltipindex%, -3500
						if (pos1alignment = 18) {
							pos1alignmentavg := pos1alignmentsum / 18
							alignment += 1
							break, 2
						}
					}
					if (ErrorLevel) {
						BallPosCheck1x :=
						BallPosCheck1y :=
						pos1alignmentfail += 1
						if (pos1alignmentfail = 18) {
							deathtoggle := !deathtoggle
							pos1fail += 1
							SetTimer, RemoveToolTip4, -10
							SetTimer, RemoveToolTip3, -10
							if (score0 > 0)
								score0reload += 1
							break, 3
						}
					}
				Sleep 30
			}
		Sleep 30
		}
		Sleep 30
		Send, {w down}
		sleep 500
		Send, {a down}
		Sleep 500
		Send,{w up}{d down}{a up}
		Sleep 200
		Send, {s down}
		Sleep 500
		send, {w down}{s up}{space down}
		sleep 100
		Send, {d down}
		sleep 2300
		Send, {w up}{d up}{space up}
		sleep 4000
		ImageSearch, , , 1685, 1026, 1705, 1045, *55 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					deathtoggle := !deathtoggle
					completionindex += 1
				}
	}
}
return

RemoveToolTip:
ToolTip
return
RemoveToolTip2:
ToolTip,,,, 2
return
RemoveToolTip3:
ToolTip,,,,3
return
RemoveToolTip4:
ToolTip,,,,4
return
RemoveToolTip5:
ToolTip,,,,5
return
RemoveToolTip6:
ToolTip,,,,6
return
RemoveToolTip7:
ToolTip,,,,7
return
RemoveToolTip8:
ToolTip,,,,8
return
RemoveToolTip9:
ToolTip,,,,9
return
RemoveToolTip10:
ToolTip,,,,10
return
RemoveToolTip11:
ToolTip,,,,11
return
RemoveToolTip12:
ToolTip,,,,12
return
RemoveToolTip13:
ToolTip,,,,13
return
RemoveToolTip14:
ToolTip,,,,14
return
RemoveToolTip15:
ToolTip,,,,15
return
RemoveToolTip16:
ToolTip,,,,16
return
RemoveToolTip17:
ToolTip,,,,17
return
RemoveToolTip18:
ToolTip,,,,18
return
RemoveToolTip19:
ToolTip,,,,19
return
RemoveToolTip20:
ToolTip,,,,20
return

Yessir0924
Posts: 1
Joined: 26 Feb 2023, 11:44

Re: Elden Ring: Script to farm the rolling rock ball

Post by Yessir0924 » 26 Feb 2023, 11:51

Hi, I got all the files in the same directory. Untitled.ahk and Ballfarm folder including the files "https://drive.google.com/drive/folders/1FcZ75fqW7F26LijvQ0VATMBtpZzdFIvQ?usp=sharing." When I run the script and try to activate it using F7 it doesn't seem to do anything. I already am on Torrent yet no input is made by ahk. Idk im just confused. It only runs until line 021: Return (518.13). Sorry I am new.

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

Re: Elden Ring: Script to farm the rolling rock ball

Post by Noo0B » 09 Mar 2023, 05:07

@Yessir0924
I'm not sure why it would skip the commands, since return should be at the end of the script.
The commands before the return on the command history will show what caused the script to skip the lines.
Another thing is that all gaming AHK scripts only work on * Edit Borderless windowed, I'd try that first if you did not know of it.
Good luck.

Karil
Posts: 1
Joined: 03 Aug 2023, 08:26

Re: Elden Ring: Script to farm the rolling rock ball

Post by Karil » 03 Aug 2023, 08:28

every other run i stop into the side of the road and the boulder get me

Post Reply

Return to “Gaming Scripts (v1)”