{"id":17233726,"url":"https://github.com/j7mbo/cookie-clicker-automator","last_synced_at":"2026-02-26T03:04:55.212Z","repository":{"id":68009268,"uuid":"51660035","full_name":"J7mbo/cookie-clicker-automator","owner":"J7mbo","description":"I have no idea why I've just done this.","archived":false,"fork":false,"pushed_at":"2016-02-13T18:52:34.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T05:46:39.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/J7mbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-13T18:47:42.000Z","updated_at":"2016-02-13T18:47:42.000Z","dependencies_parsed_at":"2023-05-01T17:16:42.553Z","dependency_job_id":null,"html_url":"https://github.com/J7mbo/cookie-clicker-automator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/J7mbo/cookie-clicker-automator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J7mbo%2Fcookie-clicker-automator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J7mbo%2Fcookie-clicker-automator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J7mbo%2Fcookie-clicker-automator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J7mbo%2Fcookie-clicker-automator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J7mbo","download_url":"https://codeload.github.com/J7mbo/cookie-clicker-automator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J7mbo%2Fcookie-clicker-automator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T05:26:07.651Z","updated_at":"2026-02-26T03:04:55.184Z","avatar_url":"https://github.com/J7mbo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# cookie-clicker-automator\nI have no idea why I've just done this. A friend said \"wouldn't it be awesome if we could automate the [new cookie clicker](http://orteil.dashnet.org/cookieclicker/)\", cue me wasting an hour on a Saturday evening building this that does the following:\n\n- Automatically click the cookie every 1 millisecond\n- Automatically purchase the lowest costing purchase every 2 seconds\n\nPaste the following in your JavaScript console:\n\n    function doPurchaseClick() \n    {\n    \tvar numCookies = parseFloat(document.querySelector('#cookies.title').innerHTML.match(/[0-9]+,[0-9]+|[0-9]+ cookies|[0-9]+.[0-9]+ million/g)[0].replace('cookies', '').replace('million', ''))\n    \tvar isMillion = (document.querySelector('#cookies.title').innerHTML.match(/[0-9]+ million/g) != false);\n    \n    \t/** 1.4 million needs to be come 1400000 (remove full stop, add 5 \"0\"s then parse to float **/\n    \tif (isMillion != false) {\n    \t\tnumCookies = parseInt(numCookies + \"00000\");\n    \t}\n    \t\n    \t/** All the enabled purchases **/\n    \tvar enabledPurchases = document.querySelectorAll('.product.unlocked.enabled');\n    \t\n    \t/** Store all the purchase costs in an array **/\n    \tvar costs = [];\n    \t\n    \tfor (var i = 0; i \u003c enabledPurchases.length; i++) {\n    \t\tvar cost = parseFloat(document.querySelectorAll('.product.unlocked.enabled \u003e div.content \u003e span.price')[i].innerHTML.replace(/,/, ''))\n    \t\tcosts.push(cost);\n    \t}\n    \t\n    \t/** Get the lowest cost purchase key so we know which of the enabled purchases is the one to buy **/\n    \tvar lowestCost = Math.min.apply(Math, costs);\n    \t\n    \tvar lowestPurchaseKey = 0;\n    \t\n    \tfor (var x = 0; x \u003c costs.length; x++) {\n    \t\tif (costs[x] == lowestCost) {\n    \t\t\tlowestPurchaseKey = x;\n    \t\t}\n    \t}\n    \t\n    \tvar purchaseToClick = enabledPurchases[lowestPurchaseKey];\n    \t\n    \tif (purchaseToClick) {\n    \t\tpurchaseToClick.click();\n    \t}\n    }\n    \n    function doCookieClick() {\n    \tdocument.querySelector('div#bigCookie').click();\n    }\n  \nThen, to run the code, paste these lines in your console:\n  \n      /** To run the loops **/\n      var cookieClickLoop = setInterval(doCookieClick, 1);\n      var purchaseClickLoop = setInterval(doPurchaseClick, 1000);\n  \nTo stop the loops, paste these lines in your console:\n\n      /** To stop the loops **/\n      clearInterval(cookieClickLoop);\n      clearInterval(purchaseClickLoop);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj7mbo%2Fcookie-clicker-automator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj7mbo%2Fcookie-clicker-automator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj7mbo%2Fcookie-clicker-automator/lists"}