osrs-tools 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +106 -30
  2. package/package.json +90 -75
  3. package/src/index.ts +6 -433
  4. package/src/model/Requirement.ts +173 -0
  5. package/src/model/account/OsrsAccount.ts +82 -0
  6. package/src/model/quest/Quest.ts +44 -0
  7. package/src/model/quest/QuestTool.ts +96 -0
  8. package/src/model/slayer/Assignment.ts +40 -0
  9. package/src/model/slayer/SlayerMaster.ts +137 -0
  10. package/src/model/slayer/SlayerReward.ts +39 -0
  11. package/src/model/slayer/Task.ts +168 -0
  12. package/src/resources/QuestData.json +754 -0
  13. package/src/{data/Diaries → resources/quest}/diaries.json +3 -3
  14. package/src/{data/quest/questData.ts → resources/quest/questData.js} +169 -223
  15. package/src/{data/quest/questDataArray.json → resources/quest/questData.json} +950 -1833
  16. package/src/resources/quest/questDataArray.js +5489 -0
  17. package/src/{data/quest/questData.json → resources/quest/questDataArray.json} +642 -643
  18. package/src/{data/quest/miniquestQuestArray.json → resources/quest/subquestArray.js} +2 -2
  19. package/src/{data/quest/subQuestArray.json → resources/quest/subquestArray.json} +1 -1
  20. package/src/{data → resources}/quest/testObj.json +148 -148
  21. package/src/{data → resources}/quest/testarray.json +149 -149
  22. package/src/resources/quests/CooksAssistant.json +34 -0
  23. package/src/resources/slayer/Masters.ts +180 -0
  24. package/src/resources/slayer/SlayerData.ts +45 -0
  25. package/src/resources/slayer/SlayerExtends.ts +218 -0
  26. package/src/resources/slayer/SlayerUnlock.ts +194 -0
  27. package/src/resources/slayer/slayer.json +3581 -0
  28. package/src/resources/slayer/slayerBuys.ts +38 -0
  29. package/src/resources/slayer/slayerData.json +4431 -0
  30. package/src/resources/slayer/tasks/ChaelderTasks.ts +235 -0
  31. package/src/resources/slayer/tasks/DuradelTasks.ts +75 -0
  32. package/src/resources/slayer/tasks/KonarTasks.ts +6 -0
  33. package/src/resources/slayer/tasks/MazchnaTasks.ts +5 -0
  34. package/src/resources/slayer/tasks/NieveTasks.ts +235 -0
  35. package/src/resources/slayer/tasks/ReadTasks.ts +55 -0
  36. package/src/resources/slayer/tasks/SpriaTasks.ts +344 -0
  37. package/src/resources/slayer/tasks/Tureal.ts +436 -0
  38. package/src/resources/slayer/tasks/VannakaTasks.ts +236 -0
  39. package/src/resources/slayer/tasks/json/Chaeldar.json +348 -0
  40. package/src/resources/slayer/tasks/json/Duradel.json +541 -0
  41. package/src/resources/slayer/tasks/json/Krystilia.json +2 -0
  42. package/src/resources/slayer/tasks/json/Mazchna.json +379 -0
  43. package/src/resources/slayer/tasks/json/Neive.json +320 -0
  44. package/src/resources/slayer/tasks/json/Spria.json +345 -0
  45. package/src/resources/slayer/tasks/json/Tureal.json +341 -0
  46. package/src/resources/slayer/tasks/json/Vannaka.json +547 -0
  47. package/src/cli.js +0 -9
  48. package/src/data/farming/fruitTrees.json +0 -165
  49. package/src/data/farming/locations.json +0 -78
  50. package/src/data/farming/patches.json +0 -102
  51. package/src/data/farming/seeds.json +0 -170
  52. package/src/data/farming/teleports.json +0 -301
  53. package/src/data/farming/treePatches.json +0 -3
  54. package/src/data/farming/trees.json +0 -103
  55. package/src/data/quest/miniquestQuestArray.ts +0 -8
  56. package/src/data/quest/questDataArray.ts +0 -4134
  57. package/src/data/quest/subQuestArray.ts +0 -60
  58. package/src/tests/QuestTest.js +0 -71
  59. package/src/tests/getAllQuestSeries.ts +0 -6
  60. package/src/tests/test Quest Array.ts +0 -9
  61. package/src/tests/test Requirements.ts +0 -56
  62. package/src/tests/test.ts +0 -402
  63. package/src/tests/test3.js +0 -370
  64. package/src/tests/testQuestCompletion.js +0 -367
  65. package/src/tests/testSeed.js +0 -8
  66. package/src/utils/AchievementDiary.ts +0 -18
  67. package/src/utils/Farming/FarmingTool.ts +0 -110
  68. package/src/utils/Farming/Seed.js +0 -42
  69. package/src/utils/Farming/TreeSeed.js +0 -21
  70. package/src/utils/OsrsAccount.ts +0 -280
  71. package/src/utils/Quest.ts +0 -99
  72. package/src/utils/QuestTool.ts +0 -437
  73. package/src/utils/Requirement.ts +0 -63
  74. package/src/utils/Skill.ts +0 -11
  75. /package/src/{data/Diaries → resources/quest}/diariesArray.json +0 -0
  76. /package/src/{data → resources/quest}/exp.json +0 -0
package/README.md CHANGED
@@ -1,42 +1,118 @@
1
- ## Old School Runescape Quest Tool
1
+ # Old School RuneScape Quest Tool
2
2
 
3
- A [Node Package](https://www.npmjs.com/package/osrs-quest-tool) to provide data for all current old school runescape quests. Creating tools to help junior software developers build things they are passionate about. Work in progress and issues should be reported to cerniglj1@hawkmail.newpaltz.edu or jamesmcerniglia@gmail.com or reported under the [issues tab on gituhb](https://github.com/cerniglj1/osrs-quest-tool/issues).
3
+ [![NPM Version][npm-image]][npm-url] [![Downloads][downloads-image]][downloads-url] [![GitHub Issues][issues-img]][new-issue]
4
+ [![types](https://img.shields.io/npm/types/osrs-tools.svg?style=flat-square)](https://github.com/jamescer/osrs-tools/blob/master/src/types.ts)
5
+
6
+ The **Old School RuneScape Quest Tool** is a Node.js package designed to provide comprehensive data for all current Old School RuneScape (OSRS) quests, slayer tasks, and related game mechanics. This tool is ideal for developers looking to integrate OSRS data into their projects, whether for personal use, game guides, or community tools.
7
+
8
+ ## Features
9
+
10
+ - Access detailed quest data, including requirements, rewards, and steps.
11
+ - Retrieve slayer task information, including task weights, requirements, and locations.
12
+ - Explore slayer master data, including assigned tasks, combat level requirements, and rewards.
13
+ - Built-in support for tracking quest and slayer progress.
14
+ - Easy-to-use API for developers of all skill levels.
4
15
 
5
16
  ## Installation
6
17
 
7
- ```js
8
- npm i osrs-quest-tool
18
+ Install the package via npm:
19
+
20
+ ```bash
21
+ npm install osrs-tools --save
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ Here’s how to use the tool in your project:
27
+
28
+ ### Importing the Module
29
+
30
+ ```javascript
31
+ import { QuestTool, questArray, questObject } from 'osrs-tools';
32
+ ```
33
+
34
+ ### Working with Quests
35
+
36
+ ```javascript
37
+ // Instantiate the QuestTool class
38
+ const tool = new QuestTool();
39
+
40
+ // Get quest data as an array
41
+ const questArrayData = questArray();
42
+
43
+ // Get quest data as an object
44
+ const questObjectData = questObject();
45
+
46
+ // Output the quest data
47
+ console.log(questArrayData);
48
+ console.log(questObjectData);
9
49
  ```
10
50
 
11
- | Syntax | Description | Type |
12
- | ----------------- | ---------------------------------------------------------------- | ----------------- |
13
- | `new QuestTool()` | constructor for QuestTool class. | Class Constructor |
14
- | `questObject()` | function that returns an object of quest array keys. | Function () |
15
- | `questArray()` | function that returns an array of alphabetically ordered quests. | Function () |
16
- | `questObject` | an object of quest array keys. | Object { } |
17
- | `questArray` | an array of alphabetically ordered quests. | Array [ ] |
18
-
19
- ---
20
-
21
- ### Example Javascript
22
-
23
- ```js
24
- import { QuestTool, questArray, questObject } from "osrs-quest-tool";
25
- var tool = new QuestTool();
26
- this.questArray = questArray();
27
- this.questData = questObject();
28
- console.log(this.questData);
29
- console.log(this.questArray);
51
+ ### Working with Slayer Masters and Tasks
52
+
53
+ ```javascript
54
+ import { Turael, Duradel } from 'osrs-tools';
55
+
56
+ // Access Turael's tasks
57
+ console.log(Turael.getTasks());
58
+
59
+ // Get a random task from Duradel
60
+ const randomTask = Duradel.getRandomTask();
61
+ console.log(randomTask);
62
+ ```
63
+
64
+ ### Slayer Rewards and Unlocks
65
+
66
+ ```javascript
67
+ import { SlayerUnlocks, SlayerBuys } from 'osrs-tools';
68
+
69
+ // List all available Slayer unlocks
70
+ console.log(SlayerUnlocks);
71
+
72
+ // List all items available for purchase with Slayer points
73
+ console.log(SlayerBuys);
30
74
  ```
31
75
 
32
- ---
76
+ ## API Reference
77
+
78
+ ### Quest API
79
+
80
+ | Method | Description | Type |
81
+ | ----------------- | ----------------------------------------------------------------------- | ----------------- |
82
+ | `new QuestTool()` | Constructor for the `QuestTool` class. | Class Constructor |
83
+ | `questObject()` | Function that returns an object with quest data (keys are quest names). | Function |
84
+ | `questArray()` | Function that returns an array of quests, ordered alphabetically. | Function |
85
+
86
+ ### Slayer API
87
+
88
+ | Class/Method | Description |
89
+ | -------------------- | ------------------------------------------------------------------------- |
90
+ | `SlayerMaster` | Represents a Slayer Master, including tasks, location, and requirements. |
91
+ | `getTasks()` | Returns a list of tasks assigned by the Slayer Master. |
92
+ | `getRandomTask()` | Returns a random task based on task weights. |
93
+ | `SlayerUnlocks` | Predefined list of Slayer unlocks with costs and descriptions. |
94
+ | `SlayerBuys` | Predefined list of items available for purchase with Slayer points. |
95
+
96
+ ## To-Do
97
+
98
+ - Implement a recursive function for determining quest completion.
99
+ - Develop a quest completion tracking array.
100
+ - Refactor `questArray()` and `questObject()` to return objects instead of functions.
101
+ - Continue work on the **Recipe for Disaster** quest.
102
+ - Fix and validate all Slayer data.
103
+
104
+ ## Contributing
33
105
 
34
- ## Notes
106
+ Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/jamescer/osrs-tools).
35
107
 
36
- Recipe for disaster is a work in progress!
108
+ ## Credits
37
109
 
38
- ## TODO
110
+ - **Author**: [James Cerniglia](mailto:jamesmcerniglia@gmail.com)
111
+ - **Repository**: [GitHub - osrs-tools](https://github.com/jamescer/osrs-tools)
39
112
 
40
- - Implement recursive function for determining quest completion
41
- - Implement quest completion array
42
- - Implement questArray and questObject objects instead of functions
113
+ [npm-image]: https://img.shields.io/npm/v/osrs-tools.svg
114
+ [npm-url]: https://www.npmjs.com/package/osrs-tools
115
+ [downloads-image]: https://img.shields.io/npm/dm/osrs-tools.svg
116
+ [downloads-url]: https://npmcharts.com/compare/osrs-tools?minimal=true
117
+ [issues-img]: https://img.shields.io/github/issues/jamescer/osrs-tools.svg
118
+ [new-issue]: https://github.com/jamescer/osrs-tools/issues/new/choose
package/package.json CHANGED
@@ -1,80 +1,95 @@
1
1
  {
2
- "name": "osrs-tools",
3
- "description": "A typescript package to provide the json for all current old school runescape quests. Creating tools to help junior software developers create things they are passionate about. Work in progress and issues should be reported to jamescer@hawkmail.newpaltz.edu or jamesmcerniglia@gmail.com",
4
- "version": "0.1.1",
5
- "main": "./src/index.ts",
6
- "notes": [],
7
- "test": "node src/test.ts",
8
- "scripts": {
9
- "start": "node src/test.js",
10
- "test": "node src/test3.js",
11
- "test2": "node src/index.js",
12
- "test1": "mocha test.js"
2
+ "name": "osrs-tools",
3
+ "description": "A JavaScript package to provide JSON data for all current Old School RuneScape quests. This package aims to help junior software developers create tools related to Old School RuneScape. It's a work in progress, and issues should be reported to jamescer@hawkmail.newpaltz.edu or jamesmcerniglia@gmail.com.",
4
+ "version": "0.2.0",
5
+ "license": "MIT",
6
+ "main": "index.js",
7
+ "engines": {
8
+ "node": ">=14.0.0"
9
+ },
10
+ "scripts": {
11
+ "test": "jest --coverage",
12
+ "scrapeQuestList": "ts-node tools/ScrapeQuestData.ts",
13
+ "scrapeSlayerData": "ts-node tools/ScrapeSlayerData.ts",
14
+ "getAccountData": "ts-node tools/GetAccountData.ts",
15
+ "getQuestDetails": "ts-node tools/GetQuestDetails.ts",
16
+ "build": "tsc -p .",
17
+ "dev": "tsc --watch -p .",
18
+ "test:mocha": "mocha ./src/lib/tests/unit/Quest.test.js --timeout 30000 --exit",
19
+ "prepublishOnly": "npm test",
20
+ "postpublish": "git push && git push --tags",
21
+ "preversion": "gulp version && npm test",
22
+ "version": "npm run build && git add dist && git add package.json"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/core": "^7.25.7",
26
+ "@babel/preset-env": "^7.25.7",
27
+ "@babel/preset-typescript": "^7.25.7",
28
+ "@types/chai": "^5.0.1",
29
+ "@types/jest": "^26.0.24",
30
+ "jest": "^29.7.0",
31
+ "mocha": "^11.1.0",
32
+ "ts-jest": "^29.2.6",
33
+ "ts-node": "^10.9.2",
34
+ "typescript": "^4.9.5"
35
+ },
36
+ "dependencies": {
37
+ "axios": "^1.7.7",
38
+ "babel": "^6.23.0",
39
+ "cheerio": "^1.0.0",
40
+ "jest-circus": "^29.7.0",
41
+ "node-fetch": "^3.3.2",
42
+ "travis": "^0.1.1"
43
+ },
44
+ "publishConfig": {
45
+ "registryBackup": "https://npm.pkg.github.com/jamescer"
46
+ },
47
+ "files": [
48
+ "src/**"
49
+ ],
50
+ "bin": {
51
+ "osrs-tools": "lib/cli.js"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/jamescer/osrs-tools.git"
56
+ },
57
+ "keywords": [
58
+ "RuneScape",
59
+ "OSRS",
60
+ "Old School RuneScape",
61
+ "OSRS tools",
62
+ "OSRS quest",
63
+ "OSRS quest API",
64
+ "Quest Tool",
65
+ "Old School RuneScape Tools",
66
+ "Old School RuneScape Data"
67
+ ],
68
+ "contributors": [
69
+ "James Cerniglia (https://github.com/jamescer)"
70
+ ],
71
+ "author": "James Cerniglia",
72
+ "bugs": {
73
+ "url": "https://github.com/jamescer/osrs-tools/issues",
74
+ "email": "jamesmcerniglia@gmail.com"
75
+ },
76
+ "homepage": "https://github.com/jamescer/osrs-tools#readme",
77
+ "funding": [
78
+ {
79
+ "type": "GitHub",
80
+ "url": "https://github.com/jamescer"
13
81
  },
14
- "publishConfig": {
15
- "registryBackup": "https://npm.pkg.github.com/jamescer"
82
+ {
83
+ "type": "Patreon",
84
+ "url": "https://patreon.com/big_squeezer?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink"
16
85
  },
17
- "files": [
18
- "src/**"
19
- ],
20
- "bin": {
21
- "osrs-tools": "src/cli.js"
86
+ {
87
+ "type": "Ko-fi",
88
+ "url": "https://ko-fi.com/jamescer"
22
89
  },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/jamescer/osrs-tools.git"
26
- },
27
- "keywords": [
28
- "runescape",
29
- "osrs",
30
- "old school runescape",
31
- "osrs tools",
32
- "osrs quest",
33
- "osrs quest api",
34
- "osrs-quest-api",
35
- "osrs quest tool",
36
- "osrs-quest-tool",
37
- "osrs-quest-api",
38
- "OSRS QuestTool",
39
- "Quest Tool osrs"
40
- ],
41
- "author": "James Cerniglia <jamesmcerniglia@gmail.com>",
42
- "license": "ISC",
43
- "bugs": {
44
- "url": "https://github.com/jamescer/osrs-quest-tool/issues",
45
- "email": "jamesmcerniglia@gmail.com"
46
- },
47
- "homepage": "https://github.com/jamescer/osrs-quest-tool#readme",
48
- "dependencies": {
49
- "babel": "^6.23.0",
50
- "chai": "^4.3.4",
51
- "mocha": "^7.2.0",
52
- "osrs-json-hiscores": "^2.6.0",
53
- "travis": "^0.1.1"
54
- },
55
- "funding": [
56
- {
57
- "type": "GitHub",
58
- "url": "https://github.com/jamescer"
59
- },
60
- {
61
- "type": "Patreon",
62
- "url": "https://www.patreon.com/"
63
- },
64
- {
65
- "type": "PayPal",
66
- "url": "https://paypal.me/"
67
- },
68
- {
69
- "type": "Ko-fi",
70
- "url": "https://ko-fi.com/"
71
- },
72
- {
73
- "type": "Venmo",
74
- "url": "https://venmo.com/"
75
- }
76
- ],
77
- "devDependencies": {
78
- "coveralls": "^3.1.1"
90
+ {
91
+ "type": "Venmo",
92
+ "url": "https://venmo.com/jamescer"
79
93
  }
80
- }
94
+ ]
95
+ }