Trying to use tasks in VexCode Pro v5

Hi si im trying to use tasks in vex code pro in order to track the motor velcity and if it dipps below a certain point then to spin the intake forward for a little then contuie as normal. When ever i try using the task my robot just dosent accpet any inputs. Any help is greatly appreiactied.`#include

"vex.h"

using namespace vex;
competition Competition;

/*---------------------------------------------------------------------------*/
/*                             VEXcode Config                                */
/*                                                                           */
/*  Before you do anything else, start by configuring your motors and        */
/*  sensors. In VEXcode Pro V5, you can do this using the graphical          */
/*  configurer port icon at the top right. In the VSCode extension, you'll   */
/*  need to go to robot-config.cpp and robot-config.h and create the         */
/*  motors yourself by following the style shown. All motors must be         */
/*  properly reversed, meaning the drive should drive forward when all       */
/*  motors spin forward.                                                     */
/*---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------*/
/*                             JAR-Template Config                           */
/*                                                                           */
/*  Where all the magic happens. Follow the instructions below to input      */
/*  all the physical constants and values for your robot. You should         */
/*  already have configured your motors.                                     */
/*---------------------------------------------------------------------------*/

Drive chassis(

//Pick your drive setup from the list below:
//ZERO_TRACKER_NO_ODOM
//ZERO_TRACKER_ODOM
//TANK_ONE_FORWARD_ENCODER
//TANK_ONE_FORWARD_ROTATION
//TANK_ONE_SIDEWAYS_ENCODER
//TANK_ONE_SIDEWAYS_ROTATION
//TANK_TWO_ENCODER
//TANK_TWO_ROTATION
//HOLONOMIC_TWO_ENCODER
//HOLONOMIC_TWO_ROTATION
//
//Write  here:
TANK_ONE_SIDEWAYS_ROTATION,

//Add the names of your Drive motors into the motor groups below, separated by commas, i.e. motor_group(Motor1,Motor2,Motor3).
//You will input whatever motor names you chose when you configured your robot using the sidebar configurer, they don't have to be "Motor1" and "Motor2".

//Left Motors:
motor_group(LF,LM,LB),

//Right Motors:
motor_group(RF,RM,RB),

//Specify the PORT NUMBER of your inertial sensor, in PORT format (i.e. "PORT1", not simply "1"):
PORT11,

//Input your wheel diameter. (4" omnis are actually closer to 4.125"):
3.25,

//External ratio, must be in decimal, in the format of input teeth/output teeth.
//If your motor has an 84-tooth gear and your wheel has a 60-tooth gear, this value will be 1.4.
//If the motor drives the wheel directly, this value is 1:
0.75,

//Gyro scale, this is what your gyro reads when you spin the robot 360 degrees.
//For most cases 360 will do fine here, but this scale factor can be very helpful when precision is necessary.
360,

/*---------------------------------------------------------------------------*/
/*                                  PAUSE!                                   */
/*                                                                           */
/*  The rest of the drive constructor is for robots using POSITION TRACKING. */
/*  If you are not using position tracking, leave the rest of the values as  */
/*  they are.                                                                */
/*---------------------------------------------------------------------------*/

//If you are using ZERO_TRACKER_ODOM, you ONLY need to adjust the FORWARD TRACKER CENTER DISTANCE.

//FOR HOLONOMIC DRIVES ONLY: Input your drive motors by position. This is only necessary for holonomic drives, otherwise this section can be left alone.
//LF:      //RF:    
PORT1,     -PORT2,

//LB:      //RB: 
PORT3,     -PORT4,

//If you are using position tracking, this is the Forward Tracker port (the tracker which runs parallel to the direction of the chassis).
//If this is a rotation sensor, enter it in "PORT1" format, inputting the port below.
//If this is an encoder, enter the port as an integer. Triport A will be a "1", Triport B will be a "2", etc.
PORT8,

//Input the Forward Tracker diameter (reverse it to make the direction switch):
2,

//Input Forward Tracker center distance (a positive distance corresponds to a tracker on the right side of the robot, negative is left.)
//For a zero tracker tank drive with odom, put the positive distance from the center of the robot to the right side of the drive.
//This distance is in inches:
1.0,

//Input the Sideways Tracker Port, following the same steps as the Forward Tracker Port:
PORT17,

//Sideways tracker diameter (reverse to make the direction switch):
-2,

//Sideways tracker center distance (positive distance is behind the center of the robot, negative is in front):
-7.5

);

/* 
  Driver Control Functions
*/
int current_auton_selection = 0;
int allianceColor = 0;
bool auto_started = false;
bool mogoToggle = false;
bool intakeToggle = false;
bool doinkerToggle = false;
bool mog = true;
bool boing = true;
void pistact(){
    mogoToggle = !mogoToggle;
    Mogo.set(mogoToggle);
}
void intake_pistact(){
    intakeToggle = !intakeToggle;
    intakeLift.set(intakeToggle);
}
void intake_cont(){
      if (Controller1.ButtonL2.pressing()){
        Hooks.spin(reverse, 127, percent);
        Intake.spin(reverse, 127, percent);
      }
      else if (Controller1.ButtonL1.pressing()){
        Hooks.spin(forward, 127, percent);
        Intake.spin(forward, 127, percent);
      }
      else {
        Hooks.stop();
        Intake.stop();
      }
}
void mogo_cont(){
  mogoToggle = !mogoToggle;
  Mogo.set(mogoToggle);
}
void doinker_tog(){
    doinkerToggle = !doinkerToggle;
    doink.set(doinkerToggle);
}
void full_mog(){
      if(Controller1.ButtonR2.pressing()){
        if (mog) {
          mogo_cont();
          mog = false;
        }
      }
      else {
        mog = true;
      }
    }
void full_boing(){
        if(Controller1.ButtonR1.pressing()){
        if (boing) {
          doinker_tog();
          boing = false;
        }
      }
      else {
        boing = true;
      }

}
void intakeFullFWD2(){
  Intake.spin(forward, 1200, volt);
  Hooks.spin(forward, 1200, volt);
}
void intakeFullREV2(){
  Intake.spin(reverse, 1200, volt);
  Hooks.spin(reverse, 1200, volt);
}
void intakeFullStop2(){
  Intake.stop();
  Hooks.stop();
}
vex::task betterJerk;
float count = 0;
void speedcheck(){
  if(Hooks.velocity(rpm) < -100){
    count = 1;
  }
  else if(Hooks.velocity(rpm) > -200){
  count = 0;
  }
}
int foo() {
  int count = 0;

  while(true) {
    if(count > 0){
      intakeFullStop2();
      Hooks.spin(forward);
    }
    else if(count < 1){
      continue;
    vex::task::sleep(10);
  }
  
  return(0);
}
}

// // vex::task SigmaFix;
// vex::task gregation;
// int velocityCheckTask() {
//   while (true) {
//     // Get the current velocity of the motor
//     double HookVel = Hooks.velocity(rpm);
//     // Check if the velocity is below 20 RPM
//     if (HookVel < 20) {
//       // Spin the motor forward at 50% power
//       Hooks.spin(forward, 50, pct);
//     // Small delay to avoid overloading the CPU
//     task::sleep(20);
//   }
// }
// }
// Task for other code (example: controlling another motor)
// int colorsort(){ //prob cooked
//   while(true) {
//     if (allianceColor == 1){
//       if (Optical3.color() == blue){
//         waitUntil(Optical3.color() == !blue);
//         wait(250, msec);
//         Hooks.stop();
//         wait(250, msec);
//     }
//   }
//     if (allianceColor == 2){
//       if (Optical3.color() == red){
//         waitUntil(Optical3.color() == !red);
//         wait(250, msec);
//         Hooks.stop();
//         wait(250, msec);
//       }
//     }
//     task::sleep(20);
//   }
// }
/**
 * Function before autonomous. It prints the current auton number on the screen
 * and tapping the screen cycles the selected auton by 1. Add anything else you
 * may need, like resetting pneumatic components. You can rename these autons to
 * be more descriptive, if you like.
 */

void pre_auton() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();
  default_constants();
  Inertial11.calibrate();

  while(!auto_started){
    Brain.Screen.clearScreen();
    Brain.Screen.printAt(5, 20, "JAR Template v1.2.0");
    Brain.Screen.printAt(5, 40, "Battery Percentage:");
    Brain.Screen.printAt(5, 60, "%d", Brain.Battery.capacity());
    Brain.Screen.printAt(5, 80, "Chassis Heading Reading:");
    Brain.Screen.printAt(5, 100, "%f", chassis.get_absolute_heading());
    Brain.Screen.printAt(5, 120, "Selected Auton:");
    switch(current_auton_selection){
      case 0:
        Brain.Screen.printAt(5, 140, "Red Plus AWP");
        break;
      case 1:
        Brain.Screen.printAt(5, 140, "Red Minus AWP");
        break;
      case 2:
        Brain.Screen.printAt(5, 140, "Blue Plus AWP");
        break;
      case 3:
        Brain.Screen.printAt(5, 140, "Blue Minus AWP");
        break;
      case 4:
        Brain.Screen.printAt(5, 140, "Skills");
        break;
    }
    if(Brain.Screen.pressing()){
      while(Brain.Screen.pressing()) {}
      current_auton_selection ++;
    } else if (current_auton_selection == 5){
      current_auton_selection = 0;
    }
    task::sleep(10);
  }
}

/**
 * Auton function, which runs the selected auton. Case 0 is the default,
 * and will run in the brain screen goes untouched during preauton. Replace
 * drive_test(), for example, with your own auton function you created in
 * autons.cpp and declared in autons.h.
 */

void autonomous(void) {
  auto_started = true;
  // SigmaFix   = vex::task(velocityCheckTask);
  // gregation = vex::task(colorsort);
  switch(current_auton_selection){ 
    case 0:
      allianceColor = 1;
      drive_test(); //red plus awp
      break;
    case 1:
      allianceColor = 1;
      pose_test(); // red minus awp
      break;
    case 2:
      allianceColor = 2;
      turn_test(); // blue plus awp
      break;
    case 3:
      allianceColor = 2;
      swing_test(); // blue minus awp
      break;
    case 4:
      Skills(); //i think you can figure out what this one is
      break;
 }
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              User Control Task                            */
/*                                                                           */
/*  This task is used to control your robot during the user control phase of */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void usercontrol(void) {
  // User control code here, inside the loop
//  vex::task newtask( foo );
  while (1) {
    // betterJerk   = vex::task( JerkFunction );
    intakeLift.set(true);
    doink.set(false);
    // vex::task newtask( foo );
    // SigmaFix   = vex::task(velocityCheckTask);
    // gregation = vex::task(colorsort);
    // This is the main execution loop for the user control program.
    // Each time through the loop your program should update motor + servo
    // values based on feedback from the joysticks.

    // ........................................................................
    // Insert user code here. This is where you use the joystick values to
    // update your motors, etc.
    // ........................................................................
    while(true){
      chassis.control_arcade();
      intake_cont();
      full_boing();
      full_mog();
      speedcheck();
      Brain.Screen.printAt(5, 160,"%f",count);
      // vex::task newtask( foo );
      

      // colorsort();
    }
    //Replace this line with chassis.control_tank(); for tank drive 
    //or chassis.control_holonomic(); for holo drive.
    wait(20, msec); // Sleep the task for a short amount of time to
                    // prevent wasted resources.
  }
}

//
// Main will set up the competition functions and callbacks.
//
int main() {
  // Set up callbacks for autonomous and driver control periods.
  Competition.autonomous(autonomous);
  Competition.drivercontrol(usercontrol);
  // vex::task newtask( foo );



  // Run the pre-autonomous function.
  pre_auton();

  // Prevent main from exiting with an infinite loop.
  while (true) {
    wait(100, msec);
  }
}