Macro Macro109
int k c m d
k=1; c=2; m=3; d=4 ;;example values
str sData sFile.expandpath("$documents$\Kills.txt")
int k2(k) c2(c) m2(m) d2(d)
if FileExists(sFile)
,sData.getfile(sFile)
,ARRAY(str) a
,if(findrx(sData "^Matches: (\d+)[]Kills: (\d+)[]Chickendinners: (\d+)[]Deaths: (\d+)[]$" 0 0 a)<0) end "invalid file format"
,m2+val(a[1]); k2+val(a[2]); c2+val(a[3]); d2+val(a[4]);
sData=F"Matches: {m2}[]Kills: {k2}[]Chickendinners: {c2}[]Deaths: {d2}[]"
sData.setfile(sFile)
out sData ;;delete this line