{"mode":"Text","hardwareTarget":"brain","textContent":"#region VEXcode Generated Robot Configuration\nfrom vex import *\nfrom vex_globals import *\nimport math\nimport random\n\n# Robot initialization for AIM platform\nrobot = Robot()\n\n# Timer initialization\ntimer = Timer()\n\n# Controller initialization\ncontroller = Onestick()\n\n# AI Vision configuration code\nrobot.vision.model_detection(True)\nrobot.vision.tag_detection(True)\n\n# Console Colors\ndef set_console_text_color(COLOR):\n    if (COLOR == Color.RED):\n        print(\"\\033[31m\", end=\"\")\n    elif (COLOR == Color.GREEN):\n        print(\"\\033[32m\", end=\"\")\n    elif (COLOR == Color.BLUE):\n        print(\"\\033[34m\", end=\"\")\n    elif (COLOR == Color.BLACK):\n        print(\"\\033[30m\", end=\"\")\n    elif (COLOR == Color.WHITE):\n        print(\"\\033[37m\", end=\"\")\n    elif (COLOR == Color.YELLOW):\n        print(\"\\033[33m\", end=\"\")\n    elif (COLOR == Color.ORANGE):\n        print(\"\\033[91m\", end=\"\")\n    elif (COLOR == Color.PURPLE):\n        print(\"\\033[35m\", end=\"\")\n    elif (COLOR == Color.CYAN):\n        print(\"\\033[36m\", end=\"\")\n    elif (COLOR == Color.TRANSPARENT):\n        print(\"\\033[97m\", end=\"\")\n    else:\n        print(\"\\033[30m\", end=\"\")\n\n# Clear Console\ndef clear_console():\n    print(\"\\033[2J\", end=\"\")\n\n# Used to find the format string for printing numbers with the\n# desired number of decimal places\ndef console_format(variable):\n    # If the input is a string, return it as is\n    if isinstance(variable, str):\n        return variable\n    # Otherwise, apply precision logic for numbers\n    precision = 0\n    # Equivalent to setting precision to 'All Digits'\n    if console_precision is None:\n        precision = 6\n    else:\n        precision = console_precision\n    return \"{0:.{1}f}\".format(variable, precision)\n\n\n# User Uploaded Images\nIMAGE1 = \"image1.png\"\nIMAGE2 = \"image2.png\"\nIMAGE3 = \"image3.png\"\nIMAGE4 = \"image4.png\"\nIMAGE5 = \"image5.png\"\nIMAGE6 = \"image6.png\"\nIMAGE7 = \"image7.png\"\nIMAGE8 = \"image8.png\"\nIMAGE9 = \"image9.png\"\nIMAGE10 = \"image10.png\"\n\n\n# User Uploaded Sounds\nSOUND1 = \"sound1.mp3\"\nSOUND2 = \"sound2.mp3\"\nSOUND3 = \"sound3.mp3\"\nSOUND4 = \"sound4.mp3\"\nSOUND5 = \"sound5.mp3\"\nSOUND6 = \"sound6.mp3\"\nSOUND7 = \"sound7.mp3\"\nSOUND8 = \"sound8.mp3\"\nSOUND9 = \"sound9.mp3\"\nSOUND10 = \"sound10.mp3\"\n\n\n# Reset console text color\nset_console_text_color(BLUE)\n# Reset the Inertial Sensor heading and rotation\nrobot.inertial.reset_heading()\nrobot.inertial.reset_rotation()\n\n#endregion VEXcode Generated Robot Configuration\n\n\n\"\"\"\n------------------------------------------\n\nProject:      VEX AIM Soccer - 2v2 Competition Template(Python)\nAuthor:       VEX Academy in association with Innovation First International and VEX Robotics\nCreated:      2026/07/24\nDescription:  A competition template for beginners\nNote: Always use \"if is_running:\" before kicker commands. This stops the kicker when the match is paused.\n\n------------------------------------------\n\"\"\"\n\ndef usercode():\n    global is_running\n    while True:\n        if is_running:\n            # Start writing your code here.\n            robot.move_at(0, 5)\n\n            robot_kick(HARD) # HARD / MEDIUM / SOFT\n        \n        wait(5, MSEC)\n    \n\n# ---------------------------------------------------------------------------- #\n#region Main\n# ---------------------------------------------------------------------------- #\nis_running = False\ndef calibrate_inertial():\n    robot.inertial.calibrate()\n    while robot.inertial.is_calibrating():\n        robot.screen.show_emoji(THINKING) \n        wait(50, MSEC)\n    robot.screen.hide_emoji()\n\ndef pause(): \n    global is_running\n    if controller.is_connected():\n        robot.link.send_message(\"STOP\")\n    is_running = False\n\ndef activate():\n    global is_running\n    if controller.is_connected():\n        robot.link.send_message(\"START\")\n    is_running = True\n\ndef robot_kick(force):\n    global is_running\n    if is_running:\n        robot.kicker.kick(force if force in [HARD,MEDIUM,SOFT] else MEDIUM)\n\nrobot.link.handle_message(activate, \"START\")\nrobot.link.handle_message(pause, \"STOP\")\n\ndef main():\n    global is_running\n    calibrate_inertial()\n    controller.button_up.pressed(activate)\n    controller.button_down.pressed(pause)\n    Thread(usercode)\n    while True:\n        if is_running: \n            robot.screen.clear_screen(BLUE)\n        else: \n            robot.stop_all_movement()\n            robot.screen.clear_screen(RED)\n        wait(3, MSEC)\n\nif __name__ == \"__main__\":\n    main()\n#endregion","textLanguage":"python","robotConfig":[],"slot":0,"platform":"AIM","sdkVersion":"20240802.15.00.00","appVersion":"4.67.0","fileFormat":"2.0.0","targetBrainGen":"First","v5SoundsEnabled":false,"aiVisionSettings":{"colors":[],"codes":[],"tags":true,"AIObjects":true,"AIObjectModel":[],"aiModelDropDownValue":""}}