Elden Ring: Script to farm the rolling rock ball

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

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

Post by Noo0B » 05 Aug 2023, 00:02

@ Karil if its alternating it's probably the load timings into the game being too short for your system. If you use a SATA disk it's most likely that. It could also be that the allignment loop or it's imagesearch isn't working well if that's the rock side. The boulder should almost never hit you, much lower than 1% chance here.
3zz
Posts: 1
Joined: 30 Nov 2023, 19:01

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

Post by 3zz » 30 Nov 2023, 19:05

first of all i wanted to say thank you for your work second of all why the script only work for 3 times
Zidane5929
Posts: 1
Joined: 14 Jan 2024, 17:52

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

Post by Zidane5929 » 15 Jan 2024, 03:13

@Noo0B
Hey man, I appreciate all the work and effort you have put into this script. However, I cannot get this to work...it sometimes maybe works once then stops working. even with default timings, it doesn't seem to work. I'm running this on pc. I have disabled my FasterRespawn, FixCamera mods and have also disabled my in-game Reshade. is there any fix to this? what is the camera speed I need to set is there anything specific I need to do in order for it to run. A video showing how to set this up will indeed provide useful, not to me but to all too. thank you in advance
Discord: Zephyrus5929 (For faster communication).
Noo0B
Posts: 154
Joined: 26 Jan 2018, 19:54

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

Post by Noo0B » 16 Mar 2024, 18:23

@Zidane5929 @3zz
Sorry for the delayed response. All I can think of is that you need to adjust the code and use some preset settings for it to work. Ahk codes only work on borderless windowed. This code is for 1080p resolution. It uses a keyboard AND joystick for inputs (i think). It may need to have the grace favored. The camera probably may need to be set to the slowest. It may be problematic if you use multiple monitors. As to adjusting the script to your pc, depending on your disk, you may need to increase the load times. If you do not use 1080p, you will need to redo the captures and coordinates. you may need to adjust the keys for your keyboard/joystick setup.
Try reading the script and undestanding what it does, and do your own magic. It's quite easy the way it's written.
Noo0B
Posts: 154
Joined: 26 Jan 2018, 19:54

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

Post by Noo0B » 16 Mar 2024, 20:24

may need to redo the captures, they seem to keep corrupting :)
Last edited by Noo0B on 16 Mar 2024, 20:38, edited 1 time in total.
Noo0B
Posts: 154
Joined: 26 Jan 2018, 19:54

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

Post by Noo0B » 16 Mar 2024, 20:37

also, this is a 1.1 code, save it using SciTE4AHK selecting utf8+bom from the first tab on top. You may need the next.png from the other script i posted here. This uses English, not sure if it matters.
here's a 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™
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 {
			PixelSearch, , , 1813, 100, 1815, 103, 0xB8BDBF, 30, Fast
				if (ErrorLevel = 0)
					break
				if (ErrorLevel = 2)
					break, 2
				if (A_Index = 300)
					break, 2
			Sleep 50
		}
		Sleep 50
		Send, {f down}
		Sleep 50
		Send, {f up}
		Sleep 50
		loop,20 {
			Imagesearch, , , 52, 150, 116, 970, *95 *transblack Lenne'sGrace.png
				if (ErrorLevel = 0)
					break
			if (A_Index = 20) {
				Sleep 50
				Send, {f down}
				Sleep 50
				Send, {f up}
				Sleep 50
				break
			}
			Sleep 50
		}
		Send, {e down}
		Sleep 50
		Send, {e up}
		Sleep 50
		Loop, 20 {
			Imagesearch, , , 1151, 582, 1162, 592, *75 *Transblack TravelCancel.png
				if (ErrorLevel = 0) {
					Send, {e down}
					Sleep 50
					Send, {e up}
					break
				}
			if (A_Index = 20) {
				Sleep 50
				Send, {e down}
				Sleep 50
				Send, {e up}
				Sleep 50
			}
			Sleep 50
		}
		Send, {e down}
		Sleep 50
		Send, {e up}
		Sleep 1900
		loop, 10000 {
			Imagesearch, , , 148, 1018, 382, 1034, *105 *Transblack Next.png
				if (ErrorLevel = 1) {
					if (A_Index = 1) {
						Sleep 150
						Send, {e down}
						Sleep 50
					}
					break
				}
				if (A_Index = 10000) and (ErrorLevel = 0) {
					run, MohgwinFarmTSch
					ExitApp
				}
			Sleep 50
		}
		Sleep 750
		Sleep 1450
		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
		loop, 400 {
			ImageSearch, , , 1685, 1026, 1705, 1045, *25 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					Sleep 150
					Send, {e up}
					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, 753, 5
						SetTimer, RemoveToolTip5, -7000
						break
					}
					if (score0 = 1) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%, 400, 100
						SetTimer, RemoveToolTip, -4000
						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
Noo0B
Posts: 154
Joined: 26 Jan 2018, 19:54

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

Post by Noo0B » 16 Mar 2024, 21:28

This moveset is slower but apparently more reliable, can't say for sure.

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 {
			PixelSearch, , , 1813, 100, 1815, 103, 0xB8BDBF, 30, Fast
				if (ErrorLevel = 0)
					break
				if (ErrorLevel = 2)
					break, 2
				if (A_Index = 300)
					break, 2
			Sleep 50
		}
		Sleep 50
		Send, {f down}
		Sleep 50
		Send, {f up}
		Sleep 50
		loop,20 {
			Imagesearch, , , 52, 150, 116, 970, *95 *transblack Lenne'sGrace.png
				if (ErrorLevel = 0)
					break
			if (A_Index = 20) {
				Sleep 50
				Send, {f down}
				Sleep 50
				Send, {f up}
				Sleep 50
				break
			}
			Sleep 50
		}
		Send, {e down}
		Sleep 50
		Send, {e up}
		Sleep 50
		Loop, 20 {
			Imagesearch, , , 1151, 582, 1162, 592, *75 *Transblack TravelCancel.png
				if (ErrorLevel = 0) {
					Send, {e down}
					Sleep 50
					Send, {e up}
					break
				}
			if (A_Index = 20) {
				Sleep 50
				Send, {e down}
				Sleep 50
				Send, {e up}
				Sleep 50
			}
			Sleep 50
		}
		Send, {e down}
		Sleep 50
		Send, {e up}
		Sleep 1900
		loop, 10000 {
			Imagesearch, , , 148, 1018, 382, 1034, *105 *Transblack Next.png
				if (ErrorLevel = 1) {
					if (A_Index = 1) {
						Sleep 150
						Send, {e down}
						Sleep 50
					}
					break
				}
				if (A_Index = 10000) and (ErrorLevel = 0) {
					run, MohgwinFarmTSch
					ExitApp
				}
			Sleep 50
		}
		Sleep 750
		Sleep 1450
		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
		loop, 400 {
			ImageSearch, , , 1685, 1026, 1705, 1045, *25 *transblack RuneIcon.png
				if (ErrorLevel = 0) {
					Sleep 150
					Send, {e up}
					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, 753, 5
						SetTimer, RemoveToolTip5, -7000
						break
					}
					if (score0 = 1) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%, 400, 100
						SetTimer, RemoveToolTip, -4000
						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 900
		Send, {d up}{s up}
		Sleep 600
		Send, {w down}
		Sleep 2400
		Send, {d down}
		Sleep 700
		Send, {d up}
		sleep 7700
		Send, {f down}
		Sleep 30
		Send, {f Up}
		Sleep 600
		Send, {f down}
		Sleep 30
		Send, {f Up}
		sleep, 1600
		Send, {a down}
		Sleep 300
		Send, {a up}{w 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, 993, 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
MaruSama
Posts: 1
Joined: 19 Jun 2024, 08:06

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

Post by MaruSama » 19 Jun 2024, 09:03

So for me the script worked for half an hour. I descided to dump my runes and relaunch the script. after that it started normal, even rlaunched an attempt after the allignment error but stopped the script after two successful runs? Video here: https://youtu.be/q47cz9dwXNk
Amayiski7
Posts: 1
Joined: 07 Jul 2024, 13:07

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

Post by Amayiski7 » 07 Jul 2024, 13:08

any updates on this, later versions seem to be broken
Noo0B
Posts: 154
Joined: 26 Jan 2018, 19:54

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

Post by Noo0B » 27 Oct 2024, 21:47

I remember that issue happening too, but I honestly do not remember what it was exactly, most likely squeezing timing with useless code convolution around and before the load.
I found 2 code versions I forked, can't say much about them.
Maybe they are worse than the original, I picked the one that looked more functional.
try slowing the camera and doing it offline to avoid the lag.

Code: Select all

#NoEnv
#Warn
#SingleInstance Force
Process, priority, , high
SendMode event
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, "{space up}{e up}{w up}{a up}{s up}{d up}{r up}{f up}{q up}{g 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
pos0fail := 0
alignment := 0
sessiontotal := 0
deathindex := 0
deathtoggle := 0
starttime := A_Now
starttimems := A_TickCount
loop {
	Tooltip, entering gameloop , 1000, 580, 2
	loop{
		SetTimer, RemoveToolTip, -60
		send, "{space up}{e up}{w up}{a up}{s up}{d up}{r up}{f up}{q up}{g up}"
		if deathtoggle
			deathindex += 1
		deathtoggle := 1
		pos0alignmentsum := 0
		pos0alignmentavg := 0
		pos0alignment := 0
		previousscore := score
		loopindex += 1
		deaths := alignment - completionindex
		Sleep 100
		Send, "{space up}{e up}{w up}{a up}{s up}{d up}{r up}{f up}{q up}{g up}"
		Sleep 100
		Send, "{g down}"
		Sleep 50
		Send, "{g up}"
		Sleep 200
		Tooltip, map screen scan , 1000, 580, 2
		loop, 30 {
			PixelSearch, , , 1813, 100, 1815, 103, 0xB8BDBF, 30, Fast
				if (ErrorLevel = 0)
					break
				if (ErrorLevel = 2)
					break, 2
				if (A_Index = 300)
					break, 2
			Sleep 50
		}
		Sleep 50
		Send, "{f down}"
		Sleep 50
		Send, "{f up}"
		Sleep 50
		Tooltip, Lenne's grace scan , 1000, 580, 2
		loop,20 {
			Imagesearch, , , 52, 150, 116, 970, *95 *transblack Lenne'sGrace.png
				if (ErrorLevel = 0) {
					Tooltip, Lenne's grace found in list , 1000, 580, 2
					break
				}
			if (A_Index = 20) {
				Sleep 50
				Send, "{f down}"
				Sleep 50
				Send, "{f up}"
				Sleep 50
				break
			}
			Sleep 50
		}
		Send, "{e down}"
		Sleep 50
		Send, "{e up}"
		Sleep 150
		Tooltip, TravelCancel.png search , 1000, 580, 2
		Loop, 20 {
			Imagesearch, , , 1151, 582, 1162, 592, *75 *Transblack TravelCancel.png
				if (ErrorLevel = 0) {
					Tooltip, image found , 1000, 580, 2
					Send, "{e down}"
					Sleep 50
					Send, "{e up}"
					break
				}
			if (A_Index = 20) {
				Sleep 50
				Send, "{e down}"
				Sleep 50
				Send, "{e up}"
				Sleep 50
			}
			Sleep 50
		}
		Send, "{e down}"
		Sleep 50
		Send, "{e up}"
		Sleep 1900
		Tooltip, load check , 1000, 580, 2
		loop, 1000 {
			pixelsearch, , , 1800, 1026, 1800, 1028, 0x7E9DA4, 20, fast
				if (ErrorLevel = 1) {
					if (A_Index = 200) {
						Sleep 150
						Send, "{e down}"
						Sleep 50
						Send, "{e up}"
					}
					break
				}
				if (A_Index = 1000) and (ErrorLevel = 0) {
					run, EldenringRestartModTSch
					ExitApp
				}
			Sleep 50
		}
		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 := pos0fail
		Tooltip, farm attempts: %Loopindexdivisor%`ncomplete farms = %completionindex%`ndeaths = %deaths%`nalignmentfails = %alignmentfails%`npos0fail = %pos0fail%`ntotal alignments = %alignment%`nalignment `% = %alignmentpercentage% `%`ndeathindex = %deathindex%`ncompletion `%= %completionpercentage% `%, 0, 1080, 2
		loop, 400 {
			pixelsearch, , , 1671, 1016, 1672, 1022, 0x6F858B, 20, fast
				if (ErrorLevel = 0) {
					score =
					For each, xpos in xposList {
						Loop, 11 {
							digit := A_Index - 1
							tooltipindex := 21 - A_Index
							image :="Digit" digit ".png"
							ImageSearch,,, xpos.1, 1025, xpos.2, 1047, *95 *transblack %image%
							err := ErrorLevel
							if (digit = 10)
								digit:= 0
							Tooltip,., xpos.1, 1080, 3
							SetTimer, RemoveToolTip3, -100
							Tooltip,% digit, xpos.1, 1060,%tooltipindex%
							SetTimer, RemoveToolTip%tooltipindex%, -5100
						} Until !err
					score .= err ? "0" : digit
					}
					score := round(score)
					if (loopindex = 1)
						previousscore := 0
					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
					SetTimer, RemoveToolTip, -60000
					if (score0 = 0) {
						Tooltip, score0reload = %score0reload%`nscore0 = %score0%, 191, 783, 4
						SetTimer, RemoveToolTip4, -7000
						break
					}
					if (score0 = 1) {
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%, 400, 100, 4
						SetTimer, RemoveToolTip4, -4000
						if (score = 0) {
							Score0 += 1
							Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`nscore = 0`n"Break", 800, 800, 4
							SetTimer, RemoveToolTip4, -4000
							break
						} else {
							Score0 := 0
							break
						}
					}
				}
				if (ErrorLevel = 1) {
					if (A_Index = 400) {
						if (score0 = 2) {
							Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"exitApp", 900, 600, 4
							SetTimer, RemoveToolTip4, -4000
							ExitApp
						}
						if (score0reload > 0) {
							Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`n"Continue", 1000, 700, 4
							SetTimer, RemoveToolTip4, -4000
							continue
						}
						{
						if loopindex > 1
							score0 += 1
						Tooltip, ErrorLevel = %ErrorLevel%`nscore0 = %score0%`nscore0reload = %score0reload%`nA_Index = %A_Index%, 1100, 800, 4
						SetTimer, RemoveToolTip4, -4000
						break
						}
					}
				}
		}
		Sleep 60
		Send, "{e up}"
		Sleep 600
		Sleep 500
		Send, "{d down}{s down}"
		Sleep 500
		Send, "{d up}{s up}{r down}"
		Sleep 1500
		Send, "{q down}{r up}"
		Sleep 1500
		loop {
			pos0alignment := 0
			pos0alignmentsum := 0
			pos0alignmentavg := 0
			pos0alignmentfail := 0
			loop {
				sleep, 50
				pixelsearch, ballposcheck0x, ballposcheck0y, 905, 113, 925, 114, 0x7C9598, 20, fast
					if (ErrorLevel = 0) {
						pos0alignmentsum += ballposcheck0x
						pos0alignment += 1
						tooltipindex:= 2 + A_Index
						tooltipindex2:= 30 * A_Index
						tooltipindex3 := 0
						if (tooltipindex > 20) {
							tooltipindex3 += 50
							tooltipindex := 3
						}
						tooltip, %ballposcheck0x%x, ballposcheck0x + tooltipindex3, ballposcheck0y + tooltipindex2, %tooltipindex%
						SetTimer, RemoveToolTip%tooltipindex%, -3500
						if (pos0alignment = 18) {
							pos0alignmentavg := pos0alignmentsum / pos0alignment
							pos0alignmentavg := round(pos0alignmentavg)
							alignment +=  1
							tooltip, avg %pos0alignmentavg%x, pos0alignmentavg, 80, 3
								settimer, removetooltip3, -3000
							if (pos0alignmentavg < 916) or (pos0alignmentavg > 920) {
								if (pos0alignmentavg > 920) {
									send, "{numpad6 down}"
									sleep 10
									send, "{numpad6 up}"
									sleep 1000
									break
								}
								if (pos0alignmentavg < 916) {
									send, "{numpad4 down}"
									sleep 10
									send, "{numpad4 up}"
									sleep 1000
									break
								}
							} else
							break, 2
						}
					}
					if (ErrorLevel) {
						ballposcheck0x :=
						ballposcheck0y :=
						pos0alignmentfail += 1
						if (pos0alignmentfail = 18) {
							deathtoggle := !deathtoggle
							pos0fail += 1
							if (score0 > 0)
								score0reload += 1
							break, 3
						}
					}
;				}
			}
		}
		Send, "{w down}{q up}"
		Sleep 3000
		Send, "{w up}"
		Sleep 100
;		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
;					}
;				}
;		}
		Send,"{e down}{w down}"
		Sleep 100
		Send,"{e up}"
		Sleep 10200
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{e up}{w down}"
		Sleep 100
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{e up}{w down}"
		Sleep 100
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{e up}{w down}"
		Sleep 100
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{e up}{w down}"
		Sleep 100
		Send, "{w up}{e down}"
		Sleep 100
		Send, "{e up}{w down}"
		sleep 1000
		Send, "{a down}"
		sleep 200
		Send, "{w up}{a up}"
		sleep 1000
;		loop {
;			pos1alignment := 0
;			pos1alignmentsum := 0
;			pos1alignmentavg := 0
;			pos1alignmentfail := 0
;			loop {
;				ImageSearch, ballposcheck1x, ballposcheck1y, 900, 117, 993, 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
;						}
;					}
		send,"{d down}"
		sleep 300
		send, "{w down}"
		sleep 500
		send, "{space down}"
		sleep 2000
		Send, "{space up}{w up}{d up}"
		sleep 1500
		loop, 200 {
			pixelsearch, , , 1671, 1016, 1672, 1022, 0x6F858B, 20, fast
					if (ErrorLevel = 0) {
						deathtoggle := !deathtoggle
						completionindex += 1
						break
					} else if ((ErrorLevel = 0) and (A_Index = 200)) {
						break
				}
		}
		sleep 200
	}
	sleep 200
}

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

Return to “Gaming Scripts (v1)”