Skip to content

Instantly share code, notes, and snippets.

@TyrantRex
Last active December 13, 2022 11:53
Show Gist options
  • Save TyrantRex/639e70bb76aff31c251d25c617a387ce to your computer and use it in GitHub Desktop.
Save TyrantRex/639e70bb76aff31c251d25c617a387ce to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name ALMS
// @namespace http://127.0.0.1/
// @version 1.0
// @description Helps you speed DLC2 courses, should work with others as well but I haven't tested.
// @author TyrantRex
// @match *://www.lms.army.mil/gatekeeper/*
// @match *://www.lms.army.mil/production/*
// ==/UserScript==
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Directions:
* 1. Start the course
* 2. Press TAB to speed up videos and audio
* 3. You should see text up top with the right answers when you get to it.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
(function() {
const newDiv = document.createElement('div');
newDiv.innerHTML = '';
newDiv.style.top = '50px';
newDiv.style.left = '50px';
newDiv.style.zIndex = 100000;
newDiv.style.position = 'absolute';
function Skip() {
if (document.querySelector('audio')) document.querySelector('audio').playbackRate=16
if (document.querySelector('video')) document.querySelector('video').playbackRate=16
}
function Click() {
if (document.querySelector('[id="page-no"]')) document.querySelector('[id="page-no"]').click()
if (document.querySelector('[id="next-btn"]')) document.querySelector('[id="next-btn"]').click()
if (document.querySelector('[title="Continue"]')) document.querySelector('[title="Continue"]').click()
if (document.querySelector('[title="Close"]')) document.querySelector('[title="Close"]').click()
if (document.getElementsByClassName('link')) document.getElementsByClassName('link').click()
if (document.getElementsByClassName('popup-trigger')) document.getElementsByClassName('popup-trigger').click()
}
function ShowBestAnswer() {
if (document.getElementsByClassName('cheat')) {
let lesson = document.getElementsByClassName('cheat')[0].innerText.trim(),
info = eval('StoryboardData.' + lesson + '.options');
for(let x = 0; x < info.length; x++) {
if(info[x].grade.grade == 'Best') {
newDiv.innerHTML = '<p style="color: white; font-size: 30px; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color: black;">The best answer is: \"' + info[x].text + '\"</p>';
}
}
} else {
console.log('This course isn\'t supported. Code was made for DLC 2')
}
}
async function RunExploit() {
for (let x=0; x<2500; x++) {
Skip()
Click()
ShowBestAnswer()
await new Promise(resolve => setTimeout(() => resolve(), 250))
}
}
document.addEventListener('keydown', e => {
if (e.code === 'Tab') RunExploit()
})
document.body.appendChild(newDiv);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment