################################################################################ # # # Configurations # # # # These are the default configurations. They will be used to build the user # # level config files on first run. Each parent node defines the file type and # # the child nodes that follow are the configurations for that config file type.# # # #______________________________________________________________________________# # # #__________DO_NOT_EDIT_THIS_FILE___EVERYTHING_IS_CONFIGURABLE_IN_GAME__________# # # #______________________________________________________________________________# 'ConfigFileGeneratorTest_Configurations': type: task debug: false # Where you save this script file scriptPath: 'scripts/Network/Utilities/ConfigFileGeneratorTest.yml' # ------ Single Value Test Config ------ # singleValues: keyA: 1 keyB: 0.1 keyC: -1 keyD: NaN keyE: This is a StRiNg! # ------ Single Lists ------ # singleLists: listA: - 1 - 0.1 - -1 - NaN - This is a StRiNg! listB: - 2 - 0.2 - -2 - nAn - This is a sTrInG! # ------ Recursive Lists ------ # recursiveLists: list1: list1A: list1A1: key1A1A: 1 list1A1A: - 1 - 2 list1A2: list1A2A: key1A2A1: 1 list1A2A1: - 1 - 2 list2: list2A: key2A1: 1 list2A1: - 1 - 2 ################################################################################ # # Config File Generator Test Helper # # # This script tells the s@ConfigFileGenerator which files to generate based # on the configs above. # 'ConfigFileGeneratorTestHelper': type: task debug: true script: - ^define readID 'ConfigFileGeneratorTest' - ^define basePath '_Configurations' - ^define scriptPath '.constant[scriptPath] || null>' - ^if { - announce "<&4><&n> <&4>is not a valid readID." - inject s@FinishCommand } - ^yaml 'load:' 'id:]' - ^define keylist '].list_keys[].exclude[type|debug|scriptPath]>' - ^foreach { - define node - if ! || { - if ! { - announce "<&5>Generating default %node%.yml file..." to_console } - announce "<&5>Generating default %node%.yml file..." to_flagged:admin - announce "" to_flagged:admin - define writePath '%node%' - define writeID '%readID%_%node%' - yaml create 'id:%writeID%' - run s@ConfigFileGeneratorTest def:|||||| instantly - if ! { - yaml 'savefile:%readID%/%node%.yml' 'id:%writeID%' - announce "<&e>%node%.yml <&6>Save Complete!" to_console - announce "<&e>%node%.yml <&6>Save Complete!" to_flagged:admin - announce "" to_flagged:admin - yaml unload 'id:%writeID%' } else { - announce "<&6>%node%.yml Dryrun Complete!" to_flagged:admin - announce "" to_flagged:admin - yaml unload 'id:%writeID%' } } else { - if ! { - announce "<&a>%node%.yml already exists!" to_console } - announce "<&a>%node%.yml already exists!" to_flagged:admin } } - ^if ! { - announce "<&3> has Completed!" to_console } - ^announce "<&3> has Completed!" to_flagged:admin ################################################################################ # # Configuration File Generator # # # This script generates default config files based on the definitions passed to # it. It should be flexible enough to handle any script. # # - run s@ConfigFileGenerator def:%readID%|%writeID%|%basePath%|%writePath%|%dryrun%|%verbose%|%forcewrite% instantly # 'ConfigFileGeneratorTest': type: task debug: true definitions: readID|writeID|basePath|writePath|dryrun|verbose|forcewrite script: - ^define keylist '].list_keys[.]>' - ^if != null { - inject s@ConfigFileGeneratorTest p:foreachKeylist instantly } else { - define entry '].read[.]>' - define entryList '].read[.].as_list>' - if ! { - announce "<&a>Next Path<&co> <&b>." to_console } - if || { - announce "<&a>Next Path<&co> <&b>." to_flagged:admin } - if { - inject s@ConfigFileGeneratorTest p:foreachEntrylist instantly } else { - inject s@ConfigFileGeneratorTest p:singleEntry instantly } } foreachKeylist: - foreach { - define key '' - define oldWritePath '' - define writePath '%writePath%.%key%' - run s@ConfigFileGeneratorTest def:|||||| instantly - define writePath '%oldWritePath%' } foreachEntrylist: - yaml 'write:%writePath%' 'id:%writeID%' - foreach { - if ! { - announce "<&9>%writePath%<&co> <&2>%value%" to_console - yaml set :->: 'id:' } - if || { - announce "<&9>%writePath%<&co> <&2>%value%" to_flagged:admin } } - if || { - announce "<&3>*-----*" to_flagged:admin - announce "" to_flagged:admin } singleEntry: - if { - announce "<&c>%writePath%<&co> <&e>%entry%" to_console - yaml 'write:' 'value:' 'id:' } - if || { - announce "<&c>%writePath%<&co> <&e>%entry%" to_flagged:admin - announce "<&4>*-----*" to_flagged:admin - announce "" to_flagged:admin } ################################################################################ # # Configuration File Generator Command # # 'ConfigFileGeneratorTestCommand': type: world debug: false events: on cfgtest command: - if ! queue stop - define dryrun ']:true || false>' - define verbose ']:true || false>' - define forcewrite ']:true || false>' - if { - define file ]> } - if { - define readID ]> - narrate "%readID%" } else { - narrate "<&4>You must specify the readID!" } - narrate "<&b>dryrun<&co> <&a>%dryrun%" - narrate "<&b>verbose<&co> <&a>%verbose%" - narrate "<&b>forcewrite<&co> <&a>%forcewrite%" - inject s@ConfigFileGeneratorTestHelper - inject s@FinishCommand ################################################################################ # # Command Testing # # 'TestCommandHandler': type: world debug: false events: on cmdtest command: - if ! queue stop - define dryrun ']:true || false>' - define verbose ']:true || false>' - define forcewrite ']:true || false>' - if { - define a ]> - narrate "<&b>a<&co> <&a>%a%" } - if { - define b ]> - narrate "<&b>b<&co> <&a>%b%" } - if { - define c ]> - narrate "<&b>c<&co> <&a>%c%" } - narrate "<&b>dryrun<&co> <&a>%dryrun%" - narrate "<&b>verbose<&co> <&a>%verbose%" - inject s@FinishCommand ################################################################################ # # Clear Chat Command # # 'ClearChatCommand': type: world debug: false events: on clearchat command: - if ! queue stop - repeat 100 { - narrate "" } - inject s@FinishCommand