Skip to content
This repository was archived by the owner on Jun 24, 2023. It is now read-only.

Commit ad0c8df

Browse files
committed
🚧 for future reference
1 parent c1e3b09 commit ad0c8df

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Check out [DiamondFire](https://mcdiamondfire.com), its pretty cool.
66
[![gh-actions](https://github.com/UserUNP/sparkscript/actions/workflows/sparkscript.yml/badge.svg)](https://github.com/UserUNP/sparkscript/actions/workflows/sparkscript.yml)
77
[![gh-actions](https://github.com/UserUNP/sparkscript/actions/workflows/codeql.yml/badge.svg)](https://github.com/UserUNP/sparkscript/actions/workflows/codeql.yml)
88
[![npm-sparkscript](https://nodei.co/npm/sparkscript.png)](https://npmjs.org/package/sparkscript)
9-
***Warning***: *No stable version yet..*
9+
***Warning***: *No stable version yet.. everything might flop and/or change*
1010

1111
Example: *for current git build*
1212
```javascript
13-
// import df from "sparkscript";
1413
// import the quick editor
14+
// import df from "sparkscript";
1515
const df = require("sparkscript").default;
1616

1717
const template = df("Test template", (e, s) =>{
@@ -32,6 +32,28 @@ const template = df("Test template", (e, s) =>{
3232
const code = template.export();
3333
console.log(code.compressed);
3434
```
35+
What i want next release: *subject to change*
36+
```javascript
37+
const df = require("sparkscript").default;
38+
39+
const core = df("core", (e, s) => {
40+
s.library = true;
41+
s.lib.default(); // generate the base
42+
s.lib.args = [
43+
s.lib.arg("message", df.TEXT, "message to send"),
44+
s.lib.arg("times", df.NUM, "*insert short description*")
45+
]
46+
47+
e.repeat.multiple(s.lib.get("times"), (loop) => {
48+
loop.player.action("SendMessage", s.lib.get("message"))
49+
});
50+
});
51+
52+
const template = df.assembleLibrary(">> how2df !!1", core, template_1, template_2/* ... etc */)
53+
const code = template.export();
54+
console.log(code.compressed);
55+
```
56+
3557

3658
Key features:
3759
\> Read from template data with `require( )...from( )`.

0 commit comments

Comments
 (0)