IDriveSafely.com auto skip

Bypass the timer on IDriveSafely.com

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         IDriveSafely.com auto skip
// @namespace    auto clicker 
// @version      1.0
// @description  Bypass the timer on IDriveSafely.com
// @author       John Dow
// @match        https://app.idrivesafely.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
                console.log("started");


    let videoPlayed = false;  // Flag to track if the video has been played
    let continueLearningButton=false;

    // Function to handle the button clicks
    function clickButtons() {
        console.log("running");

        // Check for the "continue Learning Button" button and click it once
        if (!continueLearningButton) {
            var mainContinueButton = document.querySelector('[data-test="continueLearningButton"]');
            if (mainContinueButton) {
                console.log("main continue button pressed");
                mainContinueButton.click();
                continueLearningButton = true;  // Set flag to true after clicking
            }
        }
        // Check for the "Play Video" button and click it once
        if (!videoPlayed) {
            var playVideoButton = document.querySelector('[title="Play Video"]');
            if (playVideoButton) {
                console.log("video played");
                playVideoButton.click();
                videoPlayed = true;  // Set flag to true after clicking
            }
        }

        // Auto-click the right arrow every 5 seconds
        var arrowButton = document.querySelector('#arrow-next');
        if (arrowButton) {
            arrowButton.click();
            videoPlayed = false;  // Reset the flag after clicking the arrow button
            continueLearningButton=false;
        }
    }

    // Run the function every 5 seconds
    setInterval(clickButtons, 5000); 

})();