You can use "Result" variables that are predefined in BAS. There are 9 of them.
If you need more you can use filesystem actions and create TXT or CSV files
to store any number you need. Similar to that you can use database for such
tasks too.
As this is way too complicated with BAS and no one has an idea how to solve it I simply built my needed bot with Zennoposter and finished it in no time.