Robot state(auto/driver control)

Is it possible, to let the robot know which state it’s in? I am planning to use this for the LCD(code chooser) because, usually when the robot disconnects mid match and connects back, it jumps right into pre_auton and then you are screwed for the rest of the match. Thanks in advance.

Yes, the internal variable bIfiAutonomousMode will be “true” when the robot is in autonomous and “false” when in driver control. The internal variable bIfiRobotDisabled will give you the enabled or disabled status of the robot. These only work reliably when the robot is connected to a competition switch or the field control system.
You can see an example of their use in some of the examples this thread.
https://vexforum.com/t/robotc-lcd-autonomous-selection/24818/1