LimitScript

focus

As of 10.12.2022. See ბოლო ვერსია.

  1. // ==UserScript==
  2. // @name LimitScript
  3. // @namespace http://github.com/LightLordYT
  4. // @version 1.2.2
  5. // @description focus
  6. // @author LightLord
  7. // @match https://crazygames.com/*
  8. // @match https://poki.com/*
  9. // @match https://*.io/
  10. // @match https://*.one/
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. //put urls u want to block in //@match
  16.  
  17. (function(window, document) {
  18. let initObject = {
  19. handleRes: (name) => {
  20. function res(){
  21. let response = prompt('pswrd?')
  22. if(response == 'focusboy'){
  23. localStorage.setItem("Light's_tracker", 0)
  24. alert('refresh the page')
  25. }else{
  26. alert('wrong boy')
  27. }
  28. }
  29. document.body.innerHTML = `<h1 style='color: black; font-weight: semi-bold; text-align: center;'>You have exceeded the time limit of playing: ${name} </h1>`
  30. document.addEventListener('keydown', (e) => {
  31. //bind whatever key you want
  32. e.key == 'Control' ? res() : ''
  33. })
  34. },
  35. init: () => {
  36. let date = new Date()
  37. let old_date = localStorage.getItem("Light's_date")
  38. if(old_date !== date){
  39. localStorage.setItem("Light's_tracker", 0)
  40. }
  41. localStorage.setItem("Light's_date", date)
  42. let isTracker = localStorage.getItem("Light's_tracker") ? true : false
  43. isTracker ? '' : localStorage.setItem("Light's_tracker", 0)
  44. },
  45. update: setInterval(() => {
  46. let handler = initObject.handleRes.bind(initObject)
  47. let name = window.location.href
  48. let tracker = localStorage.getItem("Light's_tracker")
  49. tracker++
  50. tracker > 720 ? handler(name) : ''
  51. localStorage.setItem("Light's_tracker", tracker)
  52. }, 5000)
  53. }
  54. window.onLoad = () => {
  55. let currentObject = initObject
  56. currentObject.init()
  57. currentObject.update()
  58. }
  59.  
  60. })(window, document);