a game DB patcher script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
way1000
Posts: 90
Joined: 20 Jun 2016, 02:19

a game DB patcher script

Post by way1000 » 28 May 2022, 14:07

i have some text files 1, 2, 3, 4

based on file 2 and 3 the result file "full stats" (file 1) will be created

the result file is the most important file

file 4 contents will replace column 9 of the result file "full stats" (file 1)
and they will repeat, entire list repeats every time it ends when added

file 2 contents will replace column 6 of the result file "full stats" (file 1)

file 3 contents will replace column 1 of the result file "full stats" (file 1)

the result will depend on how long the lists 2 and 3 are

file 4 repeats over and over
Screenshot_5.png
Screenshot_5.png (78.83 KiB) Viewed 745 times
Attachments
ahk program for db.rar
(5.39 KiB) Downloaded 30 times

way1000
Posts: 90
Joined: 20 Jun 2016, 02:19

Re: a game DB patcher script

Post by way1000 » 28 May 2022, 14:19

this is the result desired
full stats.txt
(3.62 KiB) Downloaded 25 times

way1000
Posts: 90
Joined: 20 Jun 2016, 02:19

Re: a game DB patcher script

Post by way1000 » 28 May 2022, 19:22

plz help

i depend on it

Descolada
Posts: 1128
Joined: 23 Dec 2021, 02:30

Re: a game DB patcher script

Post by Descolada » 29 May 2022, 03:56

Where are you so far with your script?

way1000
Posts: 90
Joined: 20 Jun 2016, 02:19

Re: a game DB patcher script

Post by way1000 » 29 May 2022, 04:34

Descolada wrote:
29 May 2022, 03:56
Where are you so far with your script?
no script so far..

plz help

Descolada
Posts: 1128
Joined: 23 Dec 2021, 02:30

Re: a game DB patcher script  Topic is solved

Post by Descolada » 29 May 2022, 07:31

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%

FileRead, file1, full stats.txt
FileRead, file2, levels.txt
FileRead, file3, names.txt
FileRead, file4, imgs.txt

result := ""
fullstats := StrSplit(Trim(file1, "`r`n"), A_Tab)
file2 := StrSplit(Trim(file2, "`r`n"), "`r`n")
file3 := StrSplit(Trim(file3, "`r`n"), "`r`n")
file4 := StrSplit(Trim(file4, "`r`n"), "`r`n")

Loop, % Min(file2.MaxIndex(), file3.MaxIndex())
{
	current := fullstats
	current[9] := file4[Mod(A_index-1, file4.MaxIndex())+1]
	current[6] := file2[A_index]
	current[1] := file3[A_index]
	result .= StrJoin(A_Tab, current*) "`n"
}

FileDelete, result.txt
FileAppend, %result%, result.txt

ExitApp

StrJoin(sep, params*) { ; by geek from https://autohotkey.com/boards/viewtopic.php?t=7124
    for index,param in params
        str .= sep . param
    return SubStr(str, StrLen(sep)+1)
}
Since you wanted somebody to just write the script for you, then if it works you are welcome to tip me with crypto at Coinbase @Descolada or
Ethereum: 0x3B2d1806F62Faee9e7d0F1B99105D5D1AE6E9Ce5
BTC: bc1qau34mefccamtf0hnnpu5mzfqelfz0cd3yts0sl

way1000
Posts: 90
Joined: 20 Jun 2016, 02:19

Re: a game DB patcher script

Post by way1000 » 29 May 2022, 07:58

thank you

Post Reply

Return to “Gaming Help (v1)”