|
| 1 | +function styledLog(message, style) { |
| 2 | + console.log(`%c${message}`, style); |
| 3 | +} |
| 4 | + |
| 5 | +function runTopLogs() { |
| 6 | + console.log('%cdiscord.gg/interstellar', 'font-weight: bold; font-size: 39px; color: red; text-shadow: 3px 3px 0 rgb(217,31,38), 6px 6px 0 rgb(226,91,14), 9px 9px 0 rgb(245,221,8), 12px 12px 0 rgb(5,148,68), 15px 15px 0 rgb(2,135,206), 18px 18px 0 rgb(4,77,145), 21px 21px 0 rgb(42,21,113); margin-bottom: 12px; padding: 5%;'); |
| 7 | + console.log('%cCredits to @xbubbo and @xderpman on Discord.', 'font-weight: bold; font-size: 20px; color: blue;'); |
| 8 | + console.log('%cYou can use this code with proper credits.', 'font-weight: bold; font-size: 20px; color: purple;'); |
| 9 | +} |
| 10 | + |
| 11 | +var adjustmentCompleted = false; |
| 12 | +var attempts = 0; |
| 13 | + |
| 14 | +function adjustElements() { |
| 15 | + if (adjustmentCompleted) { |
| 16 | + console.log('%cNow.GG Adjustment already completed. Stopping script.', 'font-size: 30px; color: green;'); |
| 17 | + return true; |
| 18 | + } |
| 19 | + |
| 20 | + var iframe = top.document.getElementById('iframeId'); |
| 21 | + |
| 22 | + if (iframe) { |
| 23 | + var innerDoc = iframe.contentWindow.document; |
| 24 | + |
| 25 | + var roblox = innerDoc.getElementById('js-game-video'); |
| 26 | + var controlBar = innerDoc.getElementById('ng-control-bar'); |
| 27 | + |
| 28 | + if (roblox && controlBar) { |
| 29 | + roblox.style.top = '295px'; |
| 30 | + controlBar.style.top = '90%'; |
| 31 | + console.log('%cSuccessfully adjusted Now.GG.', 'font-size: 30px; color: green;'); |
| 32 | + |
| 33 | + adjustmentCompleted = true; |
| 34 | + |
| 35 | + return true; |
| 36 | + } else { |
| 37 | + console.log('%cFailed to find elements (roblox or controlBar).', 'font-size: 15px; color: red;'); |
| 38 | + return false; |
| 39 | + } |
| 40 | + } else { |
| 41 | + console.log('%cFailed to find iframe with the specified ID.', 'font-size: 15px; color: red;'); |
| 42 | + return false; |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +function checkAndAdjust() { |
| 47 | + var intervalId = setInterval(function () { |
| 48 | + runTopLogs(); |
| 49 | + attempts++; |
| 50 | + if (adjustElements()) { |
| 51 | + clearInterval(intervalId); |
| 52 | + } else if (attempts >= 5) { |
| 53 | + console.log('%cNow.GG Script ran 5 times without finding elements. Stopping script.', 'font-size: 15px; color: red;'); |
| 54 | + clearInterval(intervalId); |
| 55 | + } |
| 56 | + }, 7000); |
| 57 | +} |
| 58 | + |
| 59 | +checkAndAdjust(); |
| 60 | +console.log('%cNow.GG Adjustment script started. Checking every 7 seconds.', 'font-size: 15px; color: blue;'); |
0 commit comments