Tentative Starfield load loot script
Posted: 10 Oct 2023, 03:14
First of all this is a tentative script, it's my first 2.0 script, timings are not optimized and it has no game crash reload code, I haven't found a way to move the screen or mouse and there's bugs and no statistics or tooltips.
What it does is that it spam kill an enemy and saves if the loot is good so be careful or you might end without disk space. Like I said it's tentative and not tested.
This is done on 1080p no scaling, English int keyboard, English language game.
Requirements are that you make a full save whith you looking down and your enemy is right in front of you and about to die. I used the mining laser on this one but it can be any weapon to finish off the enemy, just adapt the script accordingly. You can do a quicksave but remember to run the loop hotkey (f7) inside the game proper because the code to get off the initial menus do not work and it will rewrite your quicksave - at least it did here, but a lot of strage things happen here anyway. Name your save the local time like 235959.png on it and capture it when it is not selected with printscreen, cropping a wee bit less of the digits on it using paint for example. Make a second capture for the same save when the save is selected naming it like before but with a w on the end like 235959w.png. Edit the script on line 14 with the digits from your save localtime.
Edit the movement code according to your save so you will always have your victim centered on your screen.
Download these captures if you do not want to use your own, they might actually be good.
https://1drv.ms/u/s!AgzOWuNb0PCFgZES7Me91intDjPusw?e=1AoA1S
enjoy.
What it does is that it spam kill an enemy and saves if the loot is good so be careful or you might end without disk space. Like I said it's tentative and not tested.
This is done on 1080p no scaling, English int keyboard, English language game.
Requirements are that you make a full save whith you looking down and your enemy is right in front of you and about to die. I used the mining laser on this one but it can be any weapon to finish off the enemy, just adapt the script accordingly. You can do a quicksave but remember to run the loop hotkey (f7) inside the game proper because the code to get off the initial menus do not work and it will rewrite your quicksave - at least it did here, but a lot of strage things happen here anyway. Name your save the local time like 235959.png on it and capture it when it is not selected with printscreen, cropping a wee bit less of the digits on it using paint for example. Make a second capture for the same save when the save is selected naming it like before but with a w on the end like 235959w.png. Edit the script on line 14 with the digits from your save localtime.
Edit the movement code according to your save so you will always have your victim centered on your screen.
Download these captures if you do not want to use your own, they might actually be good.
https://1drv.ms/u/s!AgzOWuNb0PCFgZES7Me91intDjPusw?e=1AoA1S
Code: Select all
#Warn
#SingleInstance Force
ProcessSetPriority "H"
SendMode "event"
SetWorkingDir A_ScriptDir
SetTitleMatchMode 2
#MaxThreadsperHotkey 2
SetKeyDelay 0, 50
SetMouseDelay 50
WinActivate "Starfield"
HotIfWinActive "Starfield"
InstallMouseHook
toggle := false
time:= "110157"
timeimg:= "*55 " time ".png"
timewimg:= "*55 " time "w.png"
x_time:= "x_%time%"
y_time:= "y_%time%"
x_timew:= "x_%time%w"
y_timew:= "y_%time%w"
timew:= "%time%w"
;-------------------------------------------------------------------------
f11:: {
exitapp
}
;-------------------------------------------------------------------------
f6:: {
reload
}
;-------------------------------------------------------------------------
;----------------------------------------------------------------------------
F7:: {
global
sleep(100)
if imagesearch(&x_sfquit, &y_sfquit, 50, 640, 129, 719, "*55 sfquit.png") {
send('esc')
sleep(200)
}
sleep(250)
if imagesearch(&x_sfback, &y_sfback, 1760, 1000, 1799, 1029, "*55 sfback.png") {
send('esc')
sleep(200)
}
loop {
item:= 0
sleep(100)
;----------------------------------------------------------------------------
load ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;----------------------------------------------------------------------------
sleep(7000) ; load delay
;---------custom movement
lbutton
send "{lbutton down}"
sleep(50)
w
a
send "{w down}{a down}"
sleep(200)
send "{a up}"
sleep(50)
send "{w up}"
sleep(50)
lbutton
send "{lbutton up}"
sleep(200)
;------------item scan
;----------------------------------------------------------------------------
loot ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;----------------------------------------------------------------------------
sleep(200)
if (item = 1) {
;----------------------------------------------------------------------------
save ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;----------------------------------------------------------------------------
sleep(2500) ;save delay
}
;----------------------------------------------------------------------------
}
}
;---------functions
;----------------------------------------------------------------------------
;f12::{
; loot
;}
;----------------------------------------------------------------------------
loot() {
global
if imagesearch(&x_loot, &y_loot, 0, 0, 1920,1080, "*55 lootbox.png") {
loop 99 {
sleep 50
if (pixelsearch(&x_legendary, &y_legendary, x_loot-120, y_loot+50, x_loot+120,y_loot+60, 0xEDC162, 30) or imagesearch(&x_calibratedw, &y_calibratedw, x_loot-120, y_loot+50, x_loot+120,y_loot+460, "*75 calibratedw.png") or imagesearch(&x_calibratedw, &y_calibratedw, x_loot-120, y_loot+50, x_loot+120,y_loot+460, "*75 calibratedb.png") or imagesearch(&x_calibratedw, &y_calibratedw, x_loot-120, y_loot+50, x_loot+120,y_loot+460, "*75 modifiedp.png") or imagesearch(&x_calibratedw, &y_calibratedw, x_loot-120, y_loot+50, x_loot+120,y_loot+460, "*75 advancedw.png")) {
item:= 1
e
loop 9 {
send "{e down}"
sleep(50)
send "{e up}"
sleep(50)
}
break
}
}
}
}
;----------------------------------------------------------------------------
load() {
global
esc
send "{esc down}"
sleep(50)
send "{esc up}"
sleep(200)
up
loop 8 {
send "{up down}"
sleep(50)
send "{up up}"
sleep(50)
}
down
loop 2 {
send "{down down}"
sleep(50)
send "{down up}"
sleep(50)
}
sleep(200)
enter
send "{enter down}"
sleep(50)
send "{enter up}"
sleep(200)
loop {
down
send "{down down}"
sleep(50)
send "{down up}"
sleep(100)
if (A_Index <7)
i:= A_Index*70
i2:= i
if imagesearch(&x_time, &y_time, 1010, 320+i, 1105,443+i, timeimg) {
loop {
up
send "{up down}"
sleep(50)
send "{up up}"
sleep(100)
if imagesearch(&x_timew, &y_timew, 1010, 320+i, 1105,443+i, timewimg) {
enter
loop 2 {
sleep(50)
send "{enter down}"
sleep(50)
send "{enter up}"
}
break 2
}
}
}
if (A_Index >999)
break
}
}
;-------------------------------------------------------------------------
save() {
global
esc
send "{esc down}"
sleep(50)
send "{esc up}"
sleep(500)
up
loop 8 {
send "{up down}"
sleep(50)
send "{up up}"
sleep(100)
}
down
send "{down down}"
sleep(50)
send "{down up}"
sleep(100)
enter
send "{enter down}"
sleep(50)
send "{enter up}"
sleep(200)
up
loop 6 {
send "{up down}"
sleep(50)
send "{up up}"
sleep(50)
}
sleep(50)
enter
send "{enter down}"
sleep(50)
send "{enter up}"
sleep(50)
}
;----------------------------------------------------------------------------
quickload() {
global
f9down := GetKeyState("f9")
sleep(50)
if (f9down = 1) {
sleep(50)
send "{f9 up}"
sleep(50)
}
send "{f9}"
}
;----------------------------------------------------------------------------
enter() {
global
enterdown := GetKeyState("enter")
sleep(50)
if (enterdown = 1) {
sleep(50)
send "{enter up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
lbutton() {
global
lbuttondown := GetKeyState("lbutton")
sleep(50)
if (lbuttondown = 1) {
sleep(50)
send "{lbutton up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
e() {
global
edown := GetKeyState("e")
sleep(50)
if (edown = 1) {
sleep(50)
send "{e up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
esc() {
global
escdown := GetKeyState("esc")
sleep(50)
if (escdown = 1) {
sleep(50)
send "{esc up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
w() {
global
wdown := GetKeyState("w")
sleep(50)
if (wdown = 1) {
sleep(50)
send "{w up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
a() {
global
adown := GetKeyState("a")
sleep(50)
if (adown = 1) {
sleep(50)
send "{a up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
s() {
global
sdown := GetKeyState("s")
sleep(50)
if (sdown = 1) {
sleep(50)
send "{s up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
d() {
global
ddown := GetKeyState("d")
sleep(50)
if (ddown = 1) {
sleep(50)
send "{d up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
up() {
global
updown := GetKeyState("up")
sleep(50)
if (updown = 1) {
sleep(50)
send "{up up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
down() {
global
downdown := GetKeyState("down")
sleep(50)
if (downdown = 1) {
sleep(50)
send "{down up}"
sleep(50)
}
}
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------