When my robot is centered(variable x) to the object, and when my distance is equaled to some amount(variable d). I would like it to drop my arm() function, do it once but redo if variables change.
Are you asking for permission or help? If you want permission, go ahead.
If you need help, you need to define what you need help with. Calling the function when x is equal to some value and d is equal to some value is easy:
if(x == SomeValue && d == SomeOtherValue)
To ensure that arm() only gets called once:
bool armDone = false;
// Some stuff
if(x == SomeValue && d == SomeOtherValue && !armDone)
ardMode = true;
At some point in the code, you will need to set armDone back to false, or else the arm will never move again.