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.
Maybe not the best way to do it but you can scrape all possible urls on the page and then add all to a new list then you can take a random line from the list and click it. That would 100% work.