IDriveSafely.com auto skip

Bypass the timer on IDriveSafely.com

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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); 

})();