NDScript is a ForgeScript extra for Project NationDex 2026. It provides a small DSL for administrators and developers to perform runtime operations on NationDex data using a clean scripting syntax.
Inspired by DexScript, NDScript integrates with NationDex through ForgeDB (nationsData) and the standard PND26 extra loader.
- Build this package:
npm install
npm run build- Register it in the NationDex bot (
src/config/extra.ts):
export const extras: NationDexExtra[] = [
{
name: 'NDScript',
location: 'file:../ndscript',
path: 'dist',
enabled: true,
},
];For a published package, use a GitHub or npm location instead of file:.
- Install and start the bot:
npm run extras
npm run dev/ndscript script:<lines>
Requires Manage Server permission. Output is ephemeral.
ndscript UPDATE > COUNTRY > India > RARITY > 0.2
Alias: nds
UPDATE > COUNTRY > India > RARITY > 0.2
CREATE > COUNTRY > Atlantis
DELETE > COUNTRY > France
VIEW > COUNTRY > Germany
LET rare = 0.2
UPDATE > COUNTRY > India > RARITY > $rare
IF true
UPDATE > COUNTRY > India > RARITY > 0.2
ENDIF
FILTER > COUNTRY > RARITY > 0.2
SAVE event1 = UPDATE > COUNTRY > India > RARITY > 0.2
RUN event1
| NDScript model | NationDex target |
|---|---|
COUNTRY / NATION |
Entries in nationsData.nations |
| Property aliases | RARITY, CLASS, NAME, ATTACK, HEALTH, etc. |
Saved scripts persist in the ndscript global variable.
src/
├── lib/ NDScript parser and NationDex data layer
├── functions/ ForgeScript bridge ($runNDScript)
├── commands/prefix/ Prefix command
└── slash/ndscript/ Slash command
dist/ Compiled extra (loaded by PND26)
variables.json Default ForgeDB keys for saved scriptsnpm run build
npm run typecheck
npm run checkMIT License