{"id":25940706,"url":"https://github.com/2003scape/rsc-config","last_synced_at":"2025-03-04T05:18:35.910Z","repository":{"id":56525320,"uuid":"228645923","full_name":"2003scape/rsc-config","owner":"2003scape","description":"⚙️ (de)serialize runescape classic definitions","archived":false,"fork":false,"pushed_at":"2022-11-14T23:30:24.000Z","size":205,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T11:47:54.360Z","etag":null,"topics":["bzip2","config","data","game-object","item","jag","jagex","npc","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":"2019-12-17T15:28:30.000Z","updated_at":"2023-04-27T02:26:54.000Z","dependencies_parsed_at":"2023-01-21T16:45:19.058Z","dependency_job_id":null,"html_url":"https://github.com/2003scape/rsc-config","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-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2003scape%2Frsc-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2003scape","download_url":"https://codeload.github.com/2003scape/rsc-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241379768,"owners_count":19953601,"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":["bzip2","config","data","game-object","item","jag","jagex","npc","rsc","runescape"],"created_at":"2025-03-04T05:18:35.406Z","updated_at":"2025-03-04T05:18:35.900Z","avatar_url":"https://github.com/2003scape.png","language":"JavaScript","readme":"# rsc-config\n(de)serialize runescape classic config files. parse `config` archive files into\narrays of objects and re-encode + re-compress them back to the original format.\n\n## install\n\n    $ npm install @2003scape/rsc-config # -g for CLI program\n\n## cli usage\n```\nrsc-config \u003ccommand\u003e\n\nCommands:\n  rsc-config dump-json \u003carchive\u003e            dump JSON files of each config\n                                            section\n  rsc-config pack-json \u003carchive\u003e \u003cfiles..\u003e  encode and compress JSON files into\n                                            config archive\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n```\n\n## example\n```javascript\nimport fs from 'fs/promises';\nimport { Config } from './src/index.js';\n\nconst config = new Config();\nawait config.init();\nconfig.loadArchive(await fs.readFile('./config85.jag'));\n\nconfig.items = config.items.map(item =\u003e {\n    // Iron Mace -\u003e ecaM norI\n    item.name = item.name.split('').reverse().join('');\n    return item;\n});\n\nconfig.npcs = config.npcs.map(npc =\u003e {\n    npc.width = Math.floor(npc.width * 4/3);\n    npc.height = Math.floor(npc.height * 4/3);\n    return npc;\n});\n\nconfig.animations = config.animations.map(animation =\u003e {\n    if (animation.colour) {\n        animation.colour = '#ff00ff';\n    }\n\n    return animation;\n});\n\nawait fs.writeFile('./config86.jag', config.toArchive());\n```\n\n## api\n### config.items\narray of deserialized inventory items (swords, coins, food, etc.). these are\ncalled \"objects\" in jagex documentation.\n\n```javascript\n[\n    {\n        name: 'item name',\n        description: 'text displayed when examined',\n        command: 'Bury', // item action: Bury, Eat, etc.\n        sprite: 123, // item sprite index\n        price: 12345, // base price for alchemy and shops\n        stackable: false, // for multiple items in one slot (arrows, coins)\n        special: false, // destroy on drop ? (only beads of death has this)\n        equip: [\n            '2-handed', // requires right-hand and left-hand\n            'cape',\n            'chest', // amulets\n            'feet', // boots\n            'hands', // gloves\n            'legs', // skirts, platelegs, etc.\n            'body', // leather body, chainmail\n            'head', // medium helmet\n            'right-hand', // weapons\n            'left-hand', // shield\n            'replace-legs', // replace character leg sprite (platelegs)\n            'replace-body', // replace character body sprite (platemail)\n            'replace-head' // replace character head sprite (large helmet)\n        ] || null,\n        colour: 'rgb(255, 0, 255)' || '#ff00ff' || null, // colourize grey\n        untradeable: false,\n        members: false\n    }\n]\n```\n\n### config.npcs\narray of deserialized NPCs (non-player-characters; monsters).\n\n```javascript\n[\n    {\n        name: 'npc name',\n        description: 'text displayed when examined',\n        command: '', // pickpocket, ....\n        attack: 12, // 1-99\n        strength: 23,\n        hits: 34,\n        defense: 56,\n        // https://classic.runescape.wiki/w/Aggressiveness\n        // the client treats \u003e 3 as 3\n        hostility: null || 'retreats' || 'combative' || 'aggressive',\n        // each animation maps to an index of config.animations\n        animations: [\n            null, // id of head animation\n            null, // id of body animation\n            null, // id of leg animation\n            null, // id of hand animation\n            null, // id of hand animation\n            null, // id of overlay head animation\n            null, // id of overlay body animation\n            null, // id of overlay legs animation\n            null, // id of gloves animation\n            null, // id of feet animation\n            null, // id of chest animation (necklaces)\n            null // id cape animation\n        ],\n        hairColour: 'rgb(255, 0, 255)' || '#ff00ff' || null,\n        topColour:  'rgb(255, 0, 255)' || '#ff00ff' || null,\n        bottomColour: 'rgb(255, 0, 255)' || '#ff00ff' || null,\n        skinColour: 'rgb(255, 0, 255)' || '#ff00ff' || null,\n        width: 123,\n        height: 456,\n        walkModel: 6,\n        combatModel: 6,\n        combatAnimation: 5\n    }\n]\n```\n\n### config.textures\narray of deserialized textures. these are used for walls, overlay tiles, roofs\nand objects.\n\n```javascript\n[\n    {\n        name: 'wall', // main texture image name\n        subName: 'door' // overlay texture image name\n    }\n]\n```\n\n### config.animations\narray of deserialized animations. these are used for NPCs, players and wieldable\nitems.\n\n```javascript\n[\n    {\n        name: 'entity jag sprite collection', // sword, necklace, cape, etc.\n        colour: 'rgb(255, 0, 255)' || '#ff00ff' || null, // colourize grey\n        genderModel: 0,\n        hasA: true,\n        hasF: false\n    }\n]\n```\n\n### config.objects\narray of deserialized game objects (tree, altar, furnace, etc.). these are\ncalled \"locations\" in jagex documentation.\n\n```javascript\n[\n    {\n        name: 'object name',\n        description: 'text displayed when examined',\n        commands: [\n            'WalkTo', // Mine, open, etc.\n            'Examine' // Prospect\n        ],\n        // this is where the client learns which models to fetch from models\n        // archive\n        model: {\n            name: 'model jag model name', // rocks1, shopsign, deadtree1, etc.\n            id: 12 // index of the model in collection\n        },\n        width: 1, // extra tiles to occupy for collision detection\n        height: 1,\n        type: 'unblocked' || 'blocked' || 'closed-door' || 'open-door',\n        itemHeight: 123 // height from ground of items on top of this object\n    },\n]\n```\n\n### config.wallObjects\narray of deserialized wall objects (doors, walls) and are called \"boundaries\"\nin jagex documentation. unlike game objects, they don't take up entire tiles if\nthey're blocking so they're useful for collision detection. their locations are\nin the [landscape archives](https://github.com/2003scape/rsc-lanscape).\n\n```javascript\n[\n    {\n        name: 'wall name', // displayed when command[0] != WalkTo\n        description: 'text displayed when examined', // commands[0] != WalkTo\n        commands: [\n            'WalkTo', // Open, Push, etc.\n            'Examine' // Pick Lock, Close, etc.\n        ],\n        height: 192, // 275 for high walls\n        colourFront: 'rgb(255, 0, 255)' || '#ff00ff' || null,\n        textureFront: 2, // texture ID - requires null colourFront\n        colourBack: 'rgb(255, 0, 255)' || '#ff00ff' || null,\n        textureBack: 2, // texture ID - requires null colourBack\n        blocked: true, // does wall block collisions?\n        invisible: false\n    }\n]\n```\n\n### config.roofs\narray of deserialized roofs. their locations are in the landscape archives.\n\n```javascript\n[\n    {\n        height: 64, // 64-90\n        texture: 6 // corresponds to config.textures\n    }\n]\n```\n\n### config.tiles\narray of deserialized tile overlays. their locations are in the landscape\narchives.\n\n```javascript\n[\n    {\n        colour: 'rgb(255, 0, 255)' || null,\n        texture: 12 || null, // corresponds to config.textures\n        type: 'ground' || 'floor' || 'liquid' || 'bridge' || 'hole',\n        blocked: false // does tile block collisions?\n    }\n]\n```\n\n### config.projectileSprite\ndecoded projectile sprite index.\n\n### config.spells\narray of deserialized magic spells.\n\n```javascript\n[\n    {\n        name: 'spell name', // displayed in client spell book\n        description: 'spell description',\n        level: 1, // 1-99\n        // self are usually teleports, offensive are against NPCs and players,\n        // inventory is used for alchemy and enchanment, object for obelisks\n        type: 'self' || 'offensive' || 'inventory' || 'object',\n        runes: [\n            {\n                id: 33, // corresponds to config.items\n                amount: 1 // if elemental, staffs will give infinite amount\n            }\n        ]\n    }\n]\n```\n\n### config.prayers\narray of deserialized prayers.\n\n```javascript\n[\n    {\n        name: 'prayer name', // displayed in client spell book (prayer tab)\n        description: 'prayer description',\n        level: 12,\n        drain: 34\n    }\n]\n```\n\n### config = new Config()\ncreate new config (de)serializer instance.\n\n### async config.init()\ninitialize the bzip wasm.\n\n### config.loadArchive(buffer)\nload a config jag archive buffer.\n\n### config.toArchive()\nreturn a config jag archive.\n\n### SECTIONS\nan array of config sections.\n\n```javascript\n[\n    'items', 'npcs', 'textures', 'animations', 'objects', 'wallObjects',\n    'roofs', 'tiles', 'spells', 'prayers', 'models'\n]\n```\n\n## license\nCopyright 2022  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-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2003scape%2Frsc-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2003scape%2Frsc-config/lists"}