-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nexus-simplified-scripting-converter): ✨ add wait action to the …
…list of supported actions The wait action transforms into a timeout with all following actions inside the internal function
- Loading branch information
Showing
7 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/nexus-simplified-scripting-converter/src/__tests__/examples/test_timeout.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type":"group","name":"timeouttestpackage","enabled":true,"items":[{"type":"function","name":"onInstall","enabled":true,"code":"// Place any code here you'd like to autorun when the package is installed"},{"type":"function","name":"onUninstall","enabled":true,"code":"// Place any code here you'd like to autorun when the package is uninstalled"},{"type":"alias","name":"","enabled":true,"actions":[{"action":"wait","enabled":true,"seconds":2,"milliseconds":36},{"action":"notify","enabled":true,"notice":"Timeout Triggered","notice_fg":"#ff0000","notice_bg":"#000000"}],"text":"test timeout","matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true}],"description":""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/nexus-simplified-scripting-converter/src/__tests__/sample-scripts.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import { Package } from '@keneanung/iron-realms-nexus-typings'; | ||
import { convertPackage } from '..'; | ||
import numpadMovement from './examples/numpad_movement.json'; | ||
import timeout from './examples/test_timeout.json'; | ||
|
||
test('Numpad movement', () => { | ||
const pkg = numpadMovement as Package; | ||
convertPackage(pkg); | ||
|
||
expect(pkg).toMatchSnapshot(); | ||
}); | ||
|
||
test('timeout', () => { | ||
const pkg = timeout as Package; | ||
convertPackage(pkg); | ||
|
||
expect(pkg).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/nexus-simplified-scripting-converter/src/templates/wait.jsr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
setTimeout(() => { |