@lostcityrs/runescript 0.9.2 → 0.9.3
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.
- package/LICENSE +1 -1
- package/LICENSE.neptune +21 -0
- package/README.md +60 -2
- package/dist/runescript.d.ts +15 -1
- package/dist/runescript.js +14 -29
- package/package.json +1 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023-2026 Lost City
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/LICENSE.neptune
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2021-present Joshua Filby and other contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
<h1>RuneScriptTS</h1>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This is a **RuneScript Compiler**, written in TypeScript. Our focus is to preserve RS2 history as accurately and authentically as we can.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Installation and Usage
|
|
8
|
+
|
|
9
|
+
`npm i @lostcityrs/runescript`
|
|
10
|
+
(or yarn, bun, pnpm...)
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { CompileServerScript } from '@lostcityrs/runescript';
|
|
14
|
+
|
|
15
|
+
CompileServerScript();
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The compiler expects a couple things to be in place.
|
|
19
|
+
|
|
20
|
+
1. A source folder that contains `.rs2` scripts.
|
|
21
|
+
2. ".sym" files containing ID->name maps in tsv-format (tab-separated values):
|
|
22
|
+
```tsv
|
|
23
|
+
0 p11_full
|
|
24
|
+
1 p12_full
|
|
25
|
+
2 b12_full
|
|
26
|
+
3 q8_full
|
|
27
|
+
```
|
|
28
|
+
There must be a sym file for every config type you reference in your scripts.
|
|
29
|
+
|
|
30
|
+
By default it will read scripts from `../content/scripts` and symbols from `./data/symbols`.
|
|
31
|
+
After it runs, compiled output will be placed in `./data/pack/server`.
|
|
32
|
+
If that doesn't work for your use case, there is a config object you can pass to CompileServerScript. There is a .d.ts file included that describes the structure.
|
|
33
|
+
|
|
34
|
+
See [LostCityRS/Server](https://github.com/LostCityRS/Server) for a working example of everything if you aren't using that already.
|
|
35
|
+
|
|
36
|
+
### Building RuneScriptTS
|
|
37
|
+
|
|
38
|
+
After cloning:
|
|
39
|
+
```sh
|
|
40
|
+
bun i
|
|
41
|
+
bun run antlr
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Testing:
|
|
45
|
+
You can test changes without publishing by copying `dist/runescript.js` into your consumer's node_modules folder
|
|
46
|
+
```sh
|
|
47
|
+
bun run build
|
|
48
|
+
cp dist/runescript.* ../node_modules/@lostcityrs/runescript/dist/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### History
|
|
52
|
+
|
|
53
|
+
Originally a fork of [Neptune](https://github.com/neptune-ps/neptune)'s script compiler.
|
|
54
|
+
Our initial compiler fork (2023-2026) focused instead on making a complete server script compiler, along with a script runtime and world simulation:
|
|
55
|
+
https://github.com/LostCityRS/RuneScriptKt
|
|
56
|
+
https://github.com/LostCityRS/Engine-TS
|
|
57
|
+
|
|
58
|
+
As of February 2026 we have transitioned from the "legacy" Kotlin codebase to this TypeScript codebase (clean port).
|
|
59
|
+
Consumers should use this. It is production-ready and produces compatible output along with some bug fixes.
|
|
60
|
+
|
|
61
|
+
### Credits
|
|
62
|
+
|
|
63
|
+
Polar: For your years of work on Neptune and many days brainstorming together.
|
|
64
|
+
Flenarn: For your effort porting so much Kotlin code to TypeScript. There were only a few lines to fix afterwards - great job.
|
|
65
|
+
Contributions in RuneScriptKt: Henke96 [PR #1](https://github.com/LostCityRS/RuneScriptKt/pull/1) and Bea5 [PR #2](https://github.com/LostCityRS/RuneScriptKt/pull/1).
|
package/dist/runescript.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export declare function CompileServerScript(config?: {
|
|
5
|
+
sourcePaths?: string[];
|
|
6
|
+
symbolPaths?: string[];
|
|
7
|
+
excludePaths?: string[];
|
|
8
|
+
checkPointers?: boolean;
|
|
9
|
+
writer?: {
|
|
10
|
+
jag?: {
|
|
11
|
+
output: string;
|
|
12
|
+
};
|
|
13
|
+
js5?: {
|
|
14
|
+
output: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}): void;
|