{"id":25940716,"url":"https://github.com/2003scape/rsc-captcha","last_synced_at":"2025-03-04T05:18:38.094Z","repository":{"id":57093503,"uuid":"300301695","full_name":"2003scape/rsc-captcha","owner":"2003scape","description":"🤖 generate runescape classic sleep screen words","archived":false,"fork":false,"pushed_at":"2021-07-01T19:11:04.000Z","size":288,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T16:07:14.976Z","etag":null,"topics":["canvas","captcha","captcha-image","fatigue","fonts","generating-captchas","jagex","rsc","runescape"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2003scape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T14:07:06.000Z","updated_at":"2023-09-13T05:25:47.000Z","dependencies_parsed_at":"2022-08-22T20:40:40.917Z","dependency_job_id":null,"html_url":"https://github.com/2003scape/rsc-captcha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-captcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-captcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-captcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-captcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2003scape","download_url":"https://codeload.github.com/2003scape/rsc-captcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787664,"owners_count":20020136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["canvas","captcha","captcha-image","fatigue","fonts","generating-captchas","jagex","rsc","runescape"],"created_at":"2025-03-04T05:18:37.557Z","updated_at":"2025-03-04T05:18:38.088Z","avatar_url":"https://github.com/2003scape.png","language":"JavaScript","readme":"# rsc-captcha\ngenerate runescape classic sleep screen words. players would enter the generated\nword during the [fatigue](https://classic.runescape.wiki/w/Fatigue) system to\ncontinue gaining experience.\n\n![](./captchas.gif?raw=true)\n\n## install\n\n    $ npm install @2003scape/rsc-captcha\n\n## example\n```javascript\nconst Captcha = require('./src/index');\nconst captcha = new Captcha();\nconst fs = require('fs');\n\n(async () =\u003e {\n    await captcha.loadFonts();\n\n    for (let i = 0; i \u003c 10; i += 1) {\n        const { word, image } = captcha.generate();\n\n        if (process.browser) {\n            document.body.appendChild(new Text(word));\n            document.body.appendChild(image);\n            document.body.appendChild(document.createElement('br'));\n        } else {\n            fs.writeFileSync(`${word}.png`, image.toBuffer());\n        }\n    }\n})();\n```\n\n## api\n### Captcha.toByteArray(canvas)\nconvert any canvas into a game client-compatible RLE byte array.\n\n### captcha = new Captcha(words?)\ncreate a new captcha generator instance. words is an array of words to randomly\nselect from (defaults to en-uk with lengths between 4-9).\n\n### async captcha.loadFonts()\nload the main font image (`font.png`). run before generating captchas.\n\n### captcha.generate()\ngenerate a word and captcha associated with it. returns:\n\n```javascript\n{\n    image: Canvas,\n    word: String\n}\n```\n\n### captcha.getWord()\npick a random word from the dictionary.\n\n### captcha.generateImage(word)\ncreate a Canvas with specified word.\n\n## license\nCopyright 2020  2003Scape Team\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see http://www.gnu.org/licenses/.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2003scape%2Frsc-captcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2003scape%2Frsc-captcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2003scape%2Frsc-captcha/lists"}