Need help with IF, I guess

Hello all,
New to Arduino and I have a question about a condition.
How do I make the code move on to the next line (on step #3) if either one condition is met.
Either time of two hours is up or top switch closes.

/*
 dual float switches, 3 solinoids

the circuit:
lower float switch opens solenoid to turn RODI unit on
and opens solenoid 1 to flush RO membrane for 3 min. Then
solenoid 1 closes and solenoid 2 opens for 1 minute to divert TDS
water to waste. Then solenoid 2 closes and solenoid 3 opens to 
make good water. [color=red]Water continues to run until time is up 
or upper float switch is acitivated[/color].Once any one of this conditions 
is met, solenoid 3 closes, solenoid 1 opens and runs for 4 mins 
to flush membrane. Then all silenoids are closed.
 */

// constants won't change. They're used here to
// set pin numbers:
const int Float1T = 2;     // the number of float switch top
const int Float2B = 3;      // the number of float switch bottom
const int Solenoid1 =  7;      // the number for main water solenoid
const int Solenoid2 =  6;        //the number for RO drain solenoid
const int Solenoid3 = 5;        // the number for DI solenoid

// variables will change:
int buttonState1 = 0;         // variable for reading the pushbutton status
int buttonState2 = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the Solenoid pin as an output:
  pinMode(Solenoid1, OUTPUT); 
  pinMode(Solenoid2, OUTPUT);
  pinMode(Solenoid3, OUTPUT); 
  // initialize the Float switch as an input:
  pinMode(Float1T, INPUT_PULLUP);
  pinMode(Float2B, INPUT_PULLUP);
}

void loop(){
  // read the state of the float valves:
  buttonState1 = digitalRead(Float1T);
  buttonState2 = digitalRead(Float2B);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:  
  
  if (buttonState1 == LOW && buttonState2 == LOW) {       
    digitalWrite(Solenoid1, HIGH); 
    digitalWrite(Solenoid2, LOW); 
    digitalWrite(Solenoid3, LOW); 
    delay(180000);                 // FLUSH FOR 3 MIN
    digitalWrite(Solenoid1, LOW); 
    digitalWrite(Solenoid2, HIGH); 
    digitalWrite(Solenoid3, LOW); 
    delay(60000);                 // FLUSH FOR 1 MIN
    digitalWrite(Solenoid1, LOW); 
    digitalWrite(Solenoid2, LOW); 
    digitalWrite(Solenoid3, HIGH); 
    delay(7200000);               //SET 2 HOURS OR UNTIL TOP SWITCH CLOSES TO MAKE CLEAN WATER
    digitalWrite(Solenoid1, HIGH); 
    digitalWrite(Solenoid2, LOW); 
    digitalWrite(Solenoid3, LOW); // 
    delay(240000);                // FLUSH FOR 4 MINS
    digitalWrite(Solenoid1, LOW); // 
    digitalWrite(Solenoid2, LOW); // 
    digitalWrite(Solenoid3, LOW); // 
  }
  
  
}

I got this from the internet by the way, I hope it is ok.

Thank you

When you use delay() everything stops and waits until the specified time elapses. You won't be able to read any switches or do anything until the delay() times out. Then execution continues with the next instruction. So once your IF statement is met, and the enclosed code is run, you've got to wait over 2 hours to read your buttons again.

The key take-away is "don't use delay()."

Some resources to learn about using millis() (and micros()) for timing.

Beginner's guide to millis()
The several things at a time tutorial.
Blink without delay.

To give some aid with your actual question, have a look at the Logical OR reference page.

if(condition1 == "purple" || condition2 == "elephant")
{
do something here
}

The two "pipes" are the same as OR.

And I agree with the others about not using "delay()". It's useful in some cases, especially when you're debugging. But it really messes up the flow when you need your script to multitask.

DangerToMyself:
To give some aid with your actual question, have a look at the Logical OR reference page.

if(condition1 == "purple" || condition2 == "elephant")

{
do something here
}




The two "pipes" are the same as OR.

And I agree with the others about not using "delay()". It's useful in some cases, especially when you're debugging. But it really messes up the flow when you need your script to multitask.

I find delay() useful in limited circumstances as well. The keyword or is also the same as 'or' (not 'OR' though.) I however took it as the OP wanted to test true only if both buttons are true. Using the data type boolean for the buttonState variables will make the program more obvious when read, but ints should also work, as long as they are directly set to 0 or some other value.