04-11-2019, 05:14 PM
(This post was last modified: 04-11-2019, 05:17 PM by sirpipthegreat.)
If you're set on using a file to do it, this should work.
str temp
if(FileExists("%USERPROFILE%\Desktop\test.txt")) ;; check if file exists
,temp.getfile("%USERPROFILE%\Desktop\test.txt") ;; stores contents of file to string 'temp'.
,temp=val(temp)+1 ;; evaluate string 'temp' as integer and increment by one.
else
,temp=1 ;; if file does not exist, set # of runs to 1.
temp.setfile("%USERPROFILE%\Desktop\test.txt") ;; write string 'temp' to file.