Limit

focus

As of 2022-12-10. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  1. // ==UserScript==
  2. // @name Limit
  3. // @namespace http://github.com/LightLordYT
  4. // @version 1.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. //change 720 to however long you want. it goes every 5 seconds meaning 12 loops per minute 5 minutes is 60 loops 720 is an hour
  51. tracker > 720 ? handler(name) : ''
  52. localStorage.setItem("Light's_tracker", tracker)
  53. }, 5000)
  54. }
  55. window.onLoad = () => {
  56. let currentObject = initObject
  57. currentObject.init()
  58. currentObject.update()
  59. }
  60.  
  61. })(window, document);