Vex Comp. Code Formatted Right?

I’d like to ask if my code is shown to be formatted correctly, and will run correctly once ready for competition.

#pragma config(Motor, port1, WheelRight, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, WheelLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ClawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ClawMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, LeverMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, LeverMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, WheelLeft1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, WheelRight1, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX)

//Competition Control and Competition Run Time Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(105)

#include “Vex_Competition_Includes.c”

void pre_auton()
{

bStopTasksBetweenModes = true;

}

task autonomous()
{

//Autonomous place-holder (test code)
if(vexRT[Btn7U])
{
	startTask(autonomous);
	//Test Code (Do NOT use)
	motor[WheelRight] = -127;
	motor[WheelLeft]  = 127;
	wait1Msec(1000);


	motor[WheelRight] = 127;
	motor[WheelLeft]  = -127;
	wait1Msec(1000);

	motor[WheelRight] = 0;
	motor[WheelLeft] = 0;
	AutonomousCodePlaceholderForTesting();
}

}

task usercontrol()
{
if(vexRT [Btn7D] == 0)
{
startTask(usercontrol);

    while (true)
    {
	   motor[WheelLeft]	=	vexRT[Ch1];
	   motor[WheelRight1]	=	vexRT[Ch2];

	   motor[WheelLeft1]	=	vexRT[Ch4];
	   motor[WheelRight]	=	vexRT[Ch3];

		{
			motor(WheelLeft)	=	100;
		}
		{
			motor(WheelLeft)	=	100;
		}
		{
			motor(WheelLeft1)	=	100;
		}
		{
			motor(WheelLeft1)	=	100;
		}

		{
			motor(WheelRight)	=	100;
		}
		{
			motor(WheelRight)	=	100;
		}
			{
			motor(WheelRight1)	=	100;
		}
		{
			motor(WheelRight1)	=	100;
		}



		if(vexRT[Btn6D] == 1)
		{
			motor(LeverMotor)	=	-120;
			motor(LeverMotor1)	=	-120;
		}

		else if(vexRT(Btn6U) == 1)
		{
			motor(LeverMotor)	=	120;
			motor(LeverMotor1)	=	120;
		}
		else
		{
			motor(LeverMotor)	=	0;
			motor(LeverMotor1)	=	0;
		}


		if(vexRT(Btn5U) == 1)
		{
			motor(ClawMotor)	=	120;
			motor(ClawMotor1)	=	120;
		}

		else if(vexRT(Btn5D) == 1)
		{

			motor(ClawMotor)	=	-120;
			motor(ClawMotor1)	=	-120;
		}
		else
		{

			motor(ClawMotor)	=	0;
			motor(ClawMotor1)	=	0;
			
			//set timing chain at same time
		}
	}
}

}

Do you really need ALL of those “{” “}” s? Also, unless I am missing something, when you set motor(WheelLeft) =100; It is no longer being controlled by the joystick. And nowhere do you tell the motors to stop. Follow the logic, what controls the starting and the stopping of the motors?
Also motor(WheelLeft) =100; should use brackets not parenthesis, motor[WheelLeft] =100;
task usercontrol()
{
if(vexRT [Btn7D] == 0) <— What is the purpose of this? What will happen if the button is pushed? The motors will stop?
{
startTask(usercontrol); Redundant to task usercontrol()

while (true)
{
motor[WheelLeft] = vexRT[Ch1];
motor[WheelRight1] = vexRT[Ch2];

motor[WheelLeft1] = vexRT[Ch4];
motor[WheelRight] = vexRT[Ch3];

{ <–why?
motor(WheelLeft) = 100; What do you expect to happen here? motor[WheelLeft] will run at 100
} <–why? Your motors are going to run at 100 and will not be controlled by the joystick
{ <–why?
motor(WheelLeft) = 100; motor[WheelLeft] will run at 100
} <–why?
{ <–why?
motor(WheelLeft1) = 100; motor[WheelLeft1] will run at 100
} <–why?
{ <–why?
motor(WheelLeft1) = 100; motor[WheelLeft1] will run at 100
} <–why?

{ <–why?
motor(WheelRight) = 100; motor(WheelRight) will run at 100
} <–why?
{ <–why?
motor(WheelRight) = 100; motor(WheelRight) will run at 100
} <–why?
{ <–why?
motor(WheelRight1) = 100; motor(WheelRight1) will run at 100
} <–why?
{ <–why?
motor(WheelRight1) = 100; motor(WheelRight1) will run at 100
}

if(vexRT[Btn6D] == 1) Here down looks fine.
{
motor(LeverMotor) = -120;
motor(LeverMotor1) = -120;
}

else if(vexRT(Btn6U) == 1)
{
motor(LeverMotor) = 120;
motor(LeverMotor1) = 120;
}
else
{
motor(LeverMotor) = 0;
motor(LeverMotor1) = 0;
}

if(vexRT(Btn5U) == 1)
{
motor(ClawMotor) = 120;
motor(ClawMotor1) = 120;
}

else if(vexRT(Btn5D) == 1)
{

motor(ClawMotor) = -120;
motor(ClawMotor1) = -120;
}
else
{

motor(ClawMotor) = 0;
motor(ClawMotor1) = 0;

//set timing chain at same time
}
}
}
}

Apologies for such a late response.

I realized that sequence with the multiple brackets and motors running at 100 made no sense. Those were meant to be placed in the test autonomous period code, not in the user control portion.

Hopefully this code should look better:
#pragma config(Motor, port1, WheelRight, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, WheelLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ClawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ClawMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, LeverMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, LeverMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, WheelLeft1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, WheelRight1, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX)

//Competition Control and Competition Run Time Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(105)

#include “Vex_Competition_Includes.c” //Important do NOT remove

void pre_auton() //Pre-autonomous period exists
{

bStopTasksBetweenModes = true; //Self-explanatory (stop tasks between modes)

}

task autonomous()
{

//Autonomous period

if(vexRT[Btn7U])
{
	startTask(autonomous);      
	//Starts autonomous
while (true)
	{
		motor[WheelLeft]	=	vexRT[Ch1];
		motor[WheelRight1]	=	vexRT[Ch2];

		motor[WheelLeft1]	=	vexRT[Ch4];
		motor[WheelRight]	=	vexRT[Ch3];

		if(vexRT[Btn6D] == 1)
		{
			motor[LeverMotor]	=	-120;
			motor[LeverMotor1]	=	-120;
		}

		else if(vexRT(Btn6U) == 1)
		{
			motor[LeverMotor]	=	120;
			motor[LeverMotor1]	=	120;
		}
		else
		{
			motor[LeverMotor]	=	0;
			motor[LeverMotor1]	=	0;
		}


		if(vexRT(Btn5U) == 1)
		{
			motor[ClawMotor]	=	120;
			motor[ClawMotor1]	=	120;
		}

		else if(vexRT(Btn5D) == 1)
		{

			motor[ClawMotor]	=	-120;
			motor[ClawMotor1]	=	-120;
		}
		else
		{

			motor[ClawMotor]	=	0;
			motor[ClawMotor1]	=	0;

		}
}

}
}

//Starts usercontrol period
task usercontrol()
{
if(vexRT[Btn7D])
{
startTask(usercontrol);

	while (true)
	{
		motor[WheelLeft]	=	vexRT[Ch1];
		motor[WheelRight1]	=	vexRT[Ch2];

		motor[WheelLeft1]	=	vexRT[Ch4];
		motor[WheelRight]	=	vexRT[Ch3];                     //Wheel controls

		if(vexRT[Btn6D] == 1)
		{
			motor[LeverMotor]	=	-120;
			motor[LeverMotor1]	=	-120;                       //Arm/lever
		}

		else if(vexRT(Btn6U) == 1)
		{
			motor[LeverMotor]	=	120;
			motor[LeverMotor1]	=	120;
		}
		else
		{
			motor[LeverMotor]	=	0;
			motor[LeverMotor1]	=	0;
		}


		if(vexRT(Btn5U) == 1)
		{
			motor[ClawMotor]	=	120;
			motor[ClawMotor1]	=	120;
		}

		else if(vexRT(Btn5D) == 1)
		{

			motor[ClawMotor]	=	-120;
			motor[ClawMotor1]	=	-120;
		}
		else
		{

			motor[ClawMotor]	=	0;
			motor[ClawMotor1]	=	0;

			//set timing chain at same time
			//chain auto syncs
		}
	}
}

}

You still have errors. Edits to your code with comments:


#pragma config(Motor, port1, WheelRight, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, WheelLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ClawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ClawMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, LeverMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, LeverMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, WheelLeft1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, WheelRight1, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#pragma platform(VEX)

//Competition Control and Competition Run Time Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(105)

#include "Vex_Competition_Includes.c" //Important do NOT remove

void pre_auton()	//Pre-autonomous period exists
{

	bStopTasksBetweenModes = true; //Self-explanatory (stop tasks between modes)
}

task autonomous()
{

	//Autonomous period

	/////////////////////// you do not need to start the task, that is done by the field control
	//if(vexRT[Btn7U])
	//{
	//	startTask(autonomous);
	//	//Starts autonomous 

	// ... deleted duplicate copy of user control
}

//Starts usercontrol period
task usercontrol()
{
	/////////////////////// you do not need to start the task, that is done by the field control

	//if(vexRT[Btn7D])
	//{
	//	startTask(usercontrol);


	while (true)
	{
		////////////////////////////////////////this does not make sense for any typical drive base
		//motor[WheelLeft]	=	vexRT[Ch1];
		//motor[WheelRight1]	=	vexRT[Ch2];

		//motor[WheelLeft1]	=	vexRT[Ch4];
		//motor[WheelRight]	=	vexRT[Ch3]; //Wheel controls

		// tank drive control
		motor[WheelLeft]	=	vexRT[Ch3];
		motor[WheelLeft1]	=	vexRT[Ch3];
		motor[WheelRight1] =	vexRT[Ch2];
		motor[WheelRight]	=	vexRT[Ch2]; 


		// lever on 6U+D
		if(vexRT[Btn6D] == 1)
		{
			motor[LeverMotor]	=	-120;
			motor[LeverMotor1]	=	-120; //Arm/lever
		}
		else if(vexRT(Btn6U) == 1)
		{
			motor[LeverMotor]	=	120;
			motor[LeverMotor1]	=	120;
		}
		else
		{
			motor[LeverMotor]	=	0;
			motor[LeverMotor1]	=	0;
		}


		// claw on 5U+D
		if(vexRT(Btn5U) == 1)
		{
			motor[ClawMotor]	=	120;
			motor[ClawMotor1]	=	120;
		}
		else if(vexRT(Btn5D) == 1)
		{

			motor[ClawMotor]	=	-120;
			motor[ClawMotor1]	=	-120;
		}
		else
		{
			motor[ClawMotor]	=	0;
			motor[ClawMotor1]	=	0;
			//set timing chain at same time
			//chain auto syncs
		}

	}
}


// Please people, if you are going to post code, please use the 

and

 tags
// It keeps the formatting of your code and makes it look nice.  So rather than a wall of text
// to try to read, it's something we can all help you with

Will do. Thank you for letting me know.