Y variable known when x variable known

No. I made up that function name and insides to stand in for the complicated stuff that you said you already know how to “download” because we do not have a clue about whatever makes x & y.

Did you read this:

And especially the tutorial at

It does an excellent job of explaining how to build an easy to understand and maintain program by using functions like readXnY() and useXnY() to organize and communicate a thought process behind the programming.

I’m glad you see a way forward because it still isn’t clear to the rest of the world what you need.