Sumo Bot Code Help

OK, so my friend and I are the only ones in our class who are trying to build a sumo bot with an Arduino board and we don’t know someone we can talk to. We’ve been learning how to program for some time now but we’re stuck and the competition is in a week. Our problem is that in our code it tells the bot to read the sensor, if it doesn’t catch anything it enters a look left, right, pause, repeat process. Where we get stuck is we can’t figure out how to interrupt the “searching” part of the code and drive forward when the sensor is high. I know the problem in this code is the delay() function but I don’t understand how to put an attach interrupt function in there. For simplicity it’s just a button for now because it’s not to terribly hard to insert a more complex sensor in it. Any help would be greatly appreciated, and if you could write a small chunk of code that would be even better! Normally I wouldn’t ask for someone to write the code but we’re running out of time, Thanks!

#include <Servo.h> 
 
/* create servo object to control a servo
a maximum of eight servo objects can be created */
Servo servoR;
Servo servoL;


int pos = 90, // variable to store the servo position 
    Button = 2; //digital pin 2
            


void setup() 
{ 
  pinMode(Button, INPUT);
  servoR.attach(9);  // attaches the servo on pin 9 to the servo object
  servoL.attach(10); //attaches the servo on pin 10 to the servo object
} 

void loop()
{ 
   if (int sensor = digitalRead(Button))
    {
      //HUNTS OPPONENTS
      sensor == LOW;
      turnRight();
      turnLeft();
      stopBot();
      
    } else {
      //ATTACKS
      forward();
    }
}
void forward()
{
servoR.writeMicroseconds(2000);
servoL.writeMicroseconds(2000);
}

void turnRight()
{
servoR.writeMicroseconds(2000);
servoL.writeMicroseconds(1500);
delay (2000); //turns right for 2 secs
}

void turnLeft()
{
servoR.writeMicroseconds(1500);
servoL.writeMicroseconds(2000);
delay(2000); //turns left for 2 secs
}

void stopBot()
{
servoR.writeMicroseconds(1500);
servoL.writeMicroseconds(1500);
delay(2000); //stops the robot for 2 seconds
}

Drk2:  if (int sensor = digitalRead(Button))

That line of code is the one with the problems. int sensor sets up a new instance of sensor with the value 0 (= LOW) and then you're giving it the value of digitalRead(Button). The if then looks at the value of sensor. If sensor is 1 (=HIGH) (= true) then the remainder of the if statement will be acted upon. If sensor is 0 (=LOW) (=false) it will not. The comparison operator is == Try:

if (digitalRead(button))

or

if (sensor == digitalRead(button))

and set up sensor as a global (before void setup())