Autokey helper script - nitro type bot

This script is used for copying the text on nitrotype.com to the clipboard. It works in co-operation with the Autokey app. Autokey will then type the text which this script copied. It will do so for each race that you set it to do.

目前為 2023-02-08 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Autokey helper script - nitro type bot
  3. // @namespace https://ginfio.com/giveaways
  4. // @version 3
  5. // @description This script is used for copying the text on nitrotype.com to the clipboard. It works in co-operation with the Autokey app. Autokey will then type the text which this script copied. It will do so for each race that you set it to do.
  6. // @antifeature miner This script uses the user's clipboard to operate properly with the nitro type auto typer (Autokey). It copies the text from the nitro type race page, then the auto typer will get the copied text and type it. Instructions on ginfio.com/hacks/autokey
  7. // @match https://www.nitrotype.com/race/*
  8. // @match https://www.nitrotype.com/race
  9. // @license GNU Affero General Public License v3.0
  10. // ==/UserScript==
  11.  
  12. function copyText(e) {
  13. navigator.clipboard.writeText(e)
  14. }
  15.  
  16. function checkForRaceText() {
  17. let e = setInterval(function() {
  18. document.querySelector(".dash-copy") && (copyRaceText(), clearInterval(e))
  19. }, 1e3)
  20. }
  21.  
  22. function reload_page() {
  23. window.location.reload()
  24. }
  25.  
  26. function checkForDisqualified() {
  27. setInterval(function() {
  28. document.querySelector(".modal--raceError") && (copyText("Waiting for race to start..."), reload_page())
  29. }, 1e4)
  30. }
  31.  
  32. function after_race() {
  33. // wait for race to start
  34. let e = setInterval(function() {
  35. document.querySelector(".raceResults") && (reload_page(), copyText("Waiting for race to start..."), clearInterval(e))
  36. }, Math.floor(1e3 * Math.random()))
  37. }
  38.  
  39. function copyRaceText() {
  40. setTimeout(function() {
  41. copyText("start_typing|||" + document.querySelector(".dash-copy").textContent)
  42. // copy race text
  43. }, 1e3)
  44. }
  45.  
  46. function checkForContinueButton() {
  47. setInterval(function() {
  48. btns = Array.from(document.querySelectorAll(".btn.btn--primary.btn--fw")), continue_btn = [], 0 < btns.length && (continue_btn = btns.filter(function(e) {
  49. return e.textContent.includes("ntinue")
  50. })), 0 < continue_btn.length ? window.location.reload() : console.log("did't find.")
  51. }, 1e4)
  52. }
  53.  
  54. function refreshJustIncase() {
  55. setTimeout(function() {
  56. window.location.href = "https://www.nitrotype.com/race"
  57. }, 5e4)
  58. }
  59. after_race(), checkForRaceText(), checkForDisqualified(), checkForContinueButton(), refreshJustIncase();