#1. Script schreiben mit context args check # PLANNED: Use command scripts # Argument Check with excplication if no argument or a false matches argcheck: type: world events: on myarg command: - narrate "Arg size:" - if ! { - narrate "<&e>-----------------------------------------" - narrate "<&e>Please type a valid argument. Valid arguments are:" - narrate "<&e>create <<>filename<>>_p.yml | select <<>filename<>>_p.yml" - narrate "<&e>reset <<>filename<>>_p.yml | size <<>filename<>>_p.yml" - narrate "<&e>show <<>filename<>>_p.yml | show <<>filename<>>_p.yml number to number" - narrate "<&e>write | write NUMBER | write at | write at NUMBER | write prior NUMBER | write prior NUMBER at" - narrate "<&e>remove (NUMBER) | invert NEWNAME_p.yml (override)" - narrate "<&e>wait TIMEINSEC. (prior key)" - narrate "<&e>narrate TEXT Radius (prior NUMBER)( _ converted to spaces)" - narrate "<&e>random NUMBER (prior key) | look (prior NUMBER)" - narrate "<&e>midi NAME VOLUME DURATION (prior NUMBER)" - narrate "<&e>tp NUMBER | tp p<&at>BloodEko | n<&at>3 NUMBER" - narrate "<&e> ------TODO-------" - narrate "<&e>-----------------------------------------" - determine fulfilled } #Main Else , if argument selection is okay. else { - narrate "<&e>Your Argument is: <&4>" - narrate "<&e>Your argument size is: " - inject locally } #It's checking the arg size. If not 2 the queue will get cleared. If 2 the player is getting flagged for using other command later more easy and creating a new script.yml data. create: - narrate "<&e>You just typed the create option for making a new <<>name<&pt>_p.yml file." #Arg Size Check and existing check - if != 2 { - narrate "<&e>You need to type a sub-argument." - narrate "<&e>i.e. /myarg create NAME" - determine fulfilled } - if == 2 { - narrate "<&e> Checking whether a file with this name already exists." - if _p.yml]> { - narrate "<&4> Error : Script with the name _p.yml already exists on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } - flag player argmeta: - narrate "<&e>You are flagged now with argmeta: '' for easier using following commands." - narrate "<&e>Trying to create a world-path script with the name: _p.yml." - yaml create id: - yaml id: set _p.type:task - yaml id: "savefile:/scripts/newpath/_p.yml" - if !_p.yml]> { - narrate "<&4>Unknown error while creating this script!" } else { - narrate "<&2>Script succesfully created!" } - determine fulfilled } # Simple Arg Size checking , File existing cheking and changing the flag value. #TODO: Checking whether the script is a task script. select: - narrate "<&e>You just typed the select option for selecting a existing .yml data" - if == null { - narrate "<&e>This is the first time you are selecting a script." } else { - narrate "<&e>You were currenty selecting the script: " } - if != 2 { - narrate "<&4>You need to type a sub-argument." - narrate "<&4>i.e. /myarg select NAME" - determine fulfilled } - if == 2 { - narrate "<&e> Checking whether a file with this name exists..." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml can not be found." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/_p.yml ID: - flag player argmeta: - narrate "<&2>Succesfully selected a new script: " } } - determine fulfilled save: - narrate "<&e>This command ist currently not activated." reset: - narrate "<&e>You just typed the reset option for resetting a <<>name<>>_p.yml file." #Arg Size Check and existing check - if != 2 { - narrate "<&e>You need to type a sub-argument." - narrate "<&e>i.e. /myarg reset NAME" - determine fulfilled } - if == 2 { - narrate "<&e> Checking whether a file with this name exists." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } - flag player argmeta: - narrate "<&e>You are flagged now with argmeta: '' for easier using following commands." - narrate "<&e>Trying to reset a world-path script with the name: _p.yml." - adjust server delete_file:/scripts/newpath/_p.yml - yaml create id: - yaml id: set _p.type:task - yaml id: "savefile:/scripts/newpath/_p.yml" - if !_p.yml]> { - narrate "<&4>Unknown error while resetting this script!" } else { - narrate "<&2>Script succesfully resetted!" } - determine fulfilled } show: - narrate "<&e>You just typed the show option for showing keys of a <<>name<>>_p.yml file." #Arg Size Check and existing check - if != 1 && != 2 && != 5 { - narrate "<&e>You need to type a sub-argument." - narrate "<&e>i.e. /myarg show NAME" - narrate "<&e>i.e. /myarg show NAME number to number" - determine fulfilled } - if == 1 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Use /select <<>scriptname<>>" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>The list of: has ].read[_p.script].size> entries." - foreach "].read[_p.script]>" { - narrate " " } - narrate "<&2>The list of: has ].read[_p.script].size> entries." - determine fulfilled } } } } - if == 2 { - narrate "<&e> Checking whether a file with this name exists." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>Stopping queue for unwritten scripts." - determine fulfilled } else { - narrate "<&2>The list has ].read[_p.script].size> entries." - foreach "].read[_p.script]>" { - narrate " " } - narrate "<&2>The list has ].read[_p.script].size> entries." - determine fulfilled } } - if == 5 { - if != to { - narrate "<&e>Your Syntax is false." - narrate "<&e>i.e. /myarg show NAME number to number" - determine fulfilled } - narrate "<&e> Checking whether a file with this name exists." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4> The script is not containing the 'script' path." - narrate "<&4> Stopping queue." - determine fulfilled } - if !matches number || !matches number { - narrate "<&4>Script exists on the server but..." - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg show NAME number to number" - determine fulfilled } - if > { - narrate "<&4>Your Syntax is false." - narrate "<&4>The first number can't be bigger than the second." - determine fulfilled } - if > ].read[_p.script].size> { - narrate "<&4>Your list is only ].read[_p.script].size> entries big." - narrate "<&4>Error: You typed a too big number: " - determine fulfilled } - yaml load:/scripts/newpath/_p.yml id: - narrate "Tyring foreach.. " - foreach ].read[_p.script].get[].to[]> { - narrate " " } - determine fulfilled } } size: - narrate "<&e>You just typed the size option for showing the number of keys of a <<>name<>>_p.yml file." - if != 2 { - narrate "<&e>You need to type a sub-argument." - narrate "<&e>i.e. /myarg size NAME" - determine fulfilled } - narrate "<&e> Checking whether a file with this name exists." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - determine fulfilled } - narrate "<&2>The script section of your script is ].read[_p.script].size> entries big." - determine fulfilled # /myarg write | myarg write at | myarg write # TODO myarg write between 1 2 write: - narrate "<&e>You just typed the writing a ~walk LOCATION command in a selected <<>name<>>_p.yml file." - if != 1 && != 2 && != 3 && != 4 && != 5 { - narrate "<&eYou need to type arguments and select a script." - narrate "<&e>i.e. /myarg select NAME" - narrate "<&e>i.e. /myarg write <<>number of the key - optional<>>" - determine fulfilled } - if == 1 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&e>You are currenty selecting the script: " - narrate "<&e>Trying to write a path-point...checking conditions." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - narrate "<&2>Writing new path point at in script: " - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:~walk l@" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } - if == 2 { - if != at && !matches number { - narrate "<&e> You need to type arguments and select a script." - narrate "<&e>i.e. /myarg select NAME" - narrate "<&e>i.e. /myarg write <<>number of the key - optional<>>" - determine fulfilled } - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&e>You are currenty selecting the script: " - narrate "<&e>Trying to write a path-point...checking conditions." - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - if == at { - define cblock - narrate "<&2>Writing new path point at in script: " - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:~walk l@" - yaml id: savefile:/scripts/newpath/_p.yml - showfake m@red_wool player: d:5s - determine fulfilled } # This else is running if a number is typed else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number." - narrate "<&4>The script: is only: ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing a new path in the .key of " - yaml id: set "_p.script[]:~walk l@" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } - if == 3 { - if != at || !matches number { - if != prior || !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&e>i.e. /myarg write at 5" - narrate "<&4>Stopping the queue." - determine fulfilled } # All in here is code for succesfull /myarg write prior NUMBER else { - narrate "<&e>Checking conditions ..." - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing it down ..." - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[~walk l@].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } else { - narrate "<&e>Checking conditions ..." - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number." - narrate "<&4>The script: is only: ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - define cblock - narrate "<&2>Writing a new path in the .key of at: " - yaml id: set "_p.script[]:~walk l@" - yaml id: savefile:/scripts/newpath/_p.yml - showfake m@red_wool player: d:5s - determine fulfilled } } } } } } #Myarg write prior number at - if == 4 { - narrate "<&e>Checking conditions ..." - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if != prior || !matches number || != at { - narrate "<&4>False Syntax for 4 arguments." - narrate "<&4>i.e. /myarg write prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing it down ..." - define cblock - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[~walk l@].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - showfake m@red_wool player: d:5s - determine fulfilled } } } } } } # /myarg remove (NUMBER) remove: #/myarg remove - if == 1 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if 1 > ].read[_p.script].size> { - narrate "<&4>Your script has no entries left." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Succesfully deleted: ].read[_p.script].last> " - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].remove[].read[_p.script].size]>]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } #myarg remove NUMBER - if == 2 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !matches number { - narrate "<&4>False Syntax." - narrate "<&4>i.e. /myarg remove NUMBER" - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4> Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4> Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>Your script has no entries left." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Succesfully deleted: ].read[_p.script].get[]> " - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].remove[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled # TODO editieren die letzte Funktion } } } } } } #/myarg invert NEWNAME override invert: - if != 2 && != 3 { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg invert NEWSCRIPTNAME_p.yml" - narrate "<&4>i.e. /myarg invert NEWSCRIPTNAME_p.yml override" - determine fulfilled } - if == 2 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Type /myarg select NAME" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't invert it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if _p.yml]> { - narrate "<&4>There is already a file with this name." - narrate "<&4>Stopping queue" - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries.YOU CAN'T INVERT IT." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if 2 > ].read[_p.script].size> { - narrate "<&4>Your list is too small for inverting." - narrate "<&4>Your list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Succesfully inverting of: . Created a new script with the name " - define mkey ].read[_p.script].reverse> - yaml create id: - yaml id: set _p.type:task - yaml id: set "_p.script:|:" - yaml id: "savefile:/scripts/newpath/_p.yml" - determine fulfilled } } } } } } #Invert with overriding a script - if == 3 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Type /myarg select NAME" - narrate "<&4>Stopping queue." - determine fulfilled } - if != override { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg invert NEWSCRIPTNAME override" } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't invert it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>There is no script to override." - narrate "<&4>Use normal invert." - narrate "<&4>Stopping queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries.YOU CAN'T INVERT IT." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if 2 > ].read[_p.script].size> { - narrate "<&4>Your list is too small for inverting." - narrate "<&4>Your list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Succesfully inverting of: . Overrided a script with the name _p.yml" - define mkey ].read[_p.script].reverse> - yaml id: set "_p.script:!" - yaml id: set "_p.script:|:" - yaml id: "savefile:/scripts/newpath/_p.yml" - determine fulfilled } } } } } } #/myarg wait TIMEINSECONDS | myarg WAIT TIMEINSECONDS prior KEY wait: - if != 2 && != 4 { - narrate "<&4>Looks like you typed the false Syntax." - narrate "<&4>i.e. /myarg wait TIMEINSECONDS | /myarg wait TIMEINSECONDS prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } - if == 2 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } - if !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg wait TIMEINSECONDS | /myarg wait TIMEINSECONDS prior KEY" - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - narrate "<&2>Writing new wait in script: for seconds." - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:wait d@s" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } #argsize | arguments | is flagged | serverexistingfile | filecontainscript | keysize # myarg WAIT TIMEINSECONDS prior NUMBER - if == 4 { - if !matches number || != prior || !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg wait TIMEINSECONDS prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing a new wait in script at the .key for seconds" - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[wait d@s].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } #/myarg random NUMBER | /myarg random NUMBER prior NUMBER random: - if != 2 && != 4 { - narrate "<&4>Looks like you typed the false Syntax." - narrate "<&4>i.e. /myarg random NUMBER | /myarg random NUMBER prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } - if == 2 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } - if !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg random NUMBER | /myarg random NUMBER prior NUMBER" - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - narrate "<&2>Writing new random in for following commands." - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:random " - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } #argsize | arguments | is flagged | serverexistingfile | filecontainscript | keysize # myarg random NUMBER prior NUMBER - if == 4 { - if !matches number || != prior || !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg random NUMBER prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing a new random in script at the .key for following commands." - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[random ].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } #/myarg look | /myarg look prior NUMBER look: - if != 1 && != 3 { - narrate "<&4>Looks like you typed the false Syntax." - narrate "<&4>i.e. /myarg look | /myarg look prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } - if == 1 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - narrate "<&2>Writing new look in ." - define cblock - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:look l@" - yaml id: savefile:/scripts/newpath/_p.yml - showfake m@red_wool player: d:5s - determine fulfilled } } } #argsize | arguments | is flagged | serverexistingfile | filecontainscript | keysize # myarg look prior NUMBER - if == 3 { - if != prior || !matches number { - narrate "<&4>Your Syntax is false." - narrate "<&4>i.e. /myarg look prior NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Writing a new look in script at the .key ." - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[look l@].at[]>" - define cblock - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - showfake m@red_wool player: d:5s - determine fulfilled } } } } } } #argsize| argsize | arguments | is flagged | serverexistingfile | filecontainscript | keysize #/myarg narrate TEXT Radius | /myarg narrate TEXT Radius prior NUMBER narrate: - if != 3 && != 5 { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg narrate MESSAGE RADIUS " - narrate "<&4> /myarg narrate MESSAGE RADIUS prior NUMBER" - determine fulfilled } - if == 3 { - if !matches number { - narrate "<&4>i.e. /myarg narrate MESSAGE RADIUS " - narrate "<&4> /myarg narrate MESSAGE RADIUS prior NUMBER" - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if > 50 { - narrate "<&4>Error. Please use lower values. The maximum is 50." - narrate "<&4>You wanted to type ." - determine fulfilled } else { - narrate "<&2>Giving the npc a new message:" - narrate "<&2>" - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:narrate <&dq><&dq> targets:<<>npc.location.find.players.within[]<>> format:mnpc" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } - if == 5 { - if !matches number || != p || !matches number { - narrate "<&4>i.e. /myarg narrate MESSAGE RADIUS " - narrate "<&4> /myarg narrate MESSAGE RADIUS prior NUMBER" - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if > 50 { - narrate "<&4>Error. Please use lower values. The maximum is 50." - narrate "<&4>You wanted to type ." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Giving the npc a new message:" - narrate "<&2>" - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[narrate <&dq><&dq> targets:<<>npc.location.find.players.within[]<>> format:mnpc].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } } #/myarg midi NAME VOLUME DURATION | /myarg midi NAME VOLUME DURATION prior NUMBER midi: - if != 4 && != 6 { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg midi NAME RADIUS DURATIONINSEC." - narrate "<&4> /myarg midi MESSAGE RADIUS DURATIONINSEC. prior NUMBER" - determine fulfilled } - if == 4 { - if !matches number || !matches number { - narrate "<&4>i.e. /myarg midi MESSAGE RADIUS " - narrate "<&4> /myarg midi MESSAGE RADIUS prior NUMBER" - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if !.mid]> { - narrate "<&4>Can't find midi with this name." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > 50 { - narrate "<&4>Error. Please use lower values. The maximum is 50." - narrate "<&4>You wanted to type ." - determine fulfilled } else { - narrate "<&2>Defining a new midi named: .mid volume: duration: " - yaml load:/scripts/newpath/_p.yml id: - yaml id: set "_p.script:->:midi <<>npc.location.simple<>> volume:" - yaml id: set "_p.script:->:wait d@s" - yaml id: set "_p.script:->:midi <<>npc.location.simple<>> cancel" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } - if == 6 { - if !matches number || !matches number || != prior || !matches number { - narrate "<&4>i.e. /myarg midi RADIUS DURATIONINSEC. " - narrate "<&4> /myarg midi RADIUS DURATIONNSEC. prior NUMBER" - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - if !.mid]> { - narrate "<&4>Can't find midi with this name." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > 50 { - narrate "<&4>Error. Please use lower values. The maximum radius is 50." - narrate "<&4>You wanted to type ." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>This list is only ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - narrate "<&2>Defining a new midi named: .mid radius: duration: prior the .key" - yaml load:/scripts/newpath/_p.yml id: - define mkey "].read[_p.script].insert[midi <<>npc.location.simple<>> cancel].at[].insert[wait d@s].at[].insert[midi <<>npc.location.simple<>> volume:].at[]>" - yaml id: set _p.script:! - yaml id: set "_p.script:|:" - yaml id: savefile:/scripts/newpath/_p.yml - determine fulfilled } } } } } } } } #/myarg tp NPC/PLAYER KEYNUMBER tp: - if != 3 && != 2 { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg tp NPC/PLAYER NUMBER" - narrate "<&4>i.e. /myarg tp n@3/p@BloodEko NUMBER" - narrate "<&4>i.e. /myarg tp NUMBER" - determine fulfilled } - if == 3 { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>Your list is oly ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !matches player && !matches npc && !matches number { - narrate "<&4> is not matching an npc or an player." - narrate "<&4>Maybe you used false Syntax ?" - narrate "<&4>i.e. /myarg teleport n@3/p@BloodEko NUMBER" - narrate "<&4>i.e. /myarg tp NUMBER" - determine fulfilled } else { - if matches player { - if !].read[_p.script].get[].contains[~walk]> { - narrate "<&4>The line ].read[_p.script].get[]> is not containing '~walk' with a location. " - narrate "<&4>Stopping queue." - determine fulfilled } else { - if ! { - narrate "<&4>The player-name you typed isn't online. Stopping queue." - determine fulfilled } else { - define cblock ].read[_p.script].get[].replace[~walk].with[]> - narrate "<&2>Teleporting to: '].read[_p.script].get[].replace[~walk ].with[]>'" - teleport ].read[_p.script].get[].replace[~walk].with[]> - showfake m@red_wool player: d:5s - determine fulfilled } } } # if context.args.get2 matches npc else { - if !].read[_p.script].get[].contains[~walk]> { - narrate "<&4>The line ].read[_p.script].get[]> is not containing '~walk' with a location. " - narrate "<&4>Stopping queue." - determine fulfilled } #final commmands else { - if ! { - narrate "<&4>There is no npc with the ID: on the server." } else { - define cblock ].read[_p.script].get[].replace[~walk].with[]> - narrate "<&2>Teleporting to: '].read[_p.script].get[].replace[~walk ].with[]>'" - teleport ].read[_p.script].get[].replace[~walk].with[]> - showfake m@red_wool player: d:5s - determine fulfilled } } } } } } } } } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !matches number { - narrate "<&4> is not a number. False Syntax." - narrate "<&4>i.e. /myarg tp NUMBER" - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list." - narrate "<&4>Your list is oly ].read[_p.script].size> entries big." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !].read[_p.script].get[].contains[~walk]> { - narrate "<&4>The line ].read[_p.script].get[]> is not containing '~walk' with a location. " - narrate "<&4>Stopping queue." - determine fulfilled } else { - define cblock ].read[_p.script].get[].replace[~walk].with[]> - narrate "<&2>Teleporting you to: '].read[_p.script].get[].replace[~walk ].with[]>'" - teleport ].read[_p.script].get[].replace[~walk].with[]> - showfake m@red_wool player: d:5s - determine fulfilled } } } } } } #/myarg run NUMBER to NUMBER n@NPCID | run: - if != 5 { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg run NUMBER to NUMBER" - determine fulfilled } - if == 5 { - if !matches number || != to || !matches number || !matches npc { - narrate "<&4>You typed a false Syntax." - narrate "<&4>i.e. /myarg run NUMBER to NUMBER n<&at>NPCID" - determine fulfilled } else { - if == null { - narrate "<&4>You have no script selected." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if !_p.yml]> { - narrate "<&4>Error : Script with the name _p.yml doesn't exist on the server." - narrate "<&4>You can't write a command in it." - narrate "<&4>Stopping the queue." - determine fulfilled } else { - yaml load:/scripts/newpath/_p.yml id: - if !].contains[_p.script]> { - narrate "<&4>Your script is not containing the script path." - narrate "<&4>This script has 0 entries." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > { - narrate "<&4> is bigger than , this can't be ! ERROR." - narrate "<&4>Stopping queue." - determine fulfilled } else { - if > ].read[_p.script].size> || > ].read[_p.script].size> { - narrate "<&4>You typed a too big number for this list: to " - narrate "<&4>The size of this list is : ].read[_p.script].size> " - determine fulfilled } else { - narrate "<&2>Successfully running the commands from to " - foreach ].read[_p.script].get[].to[]> { - if { - narrate "<&2> is now doing a action:" - npc: } else { - narrate "<&b>Normal command is following:" - } } } } } } } } } test: - narrate "<&e>You just typed the show option for showing keys of a <<>name<>>_p.yml file." - yaml load:/scripts/newpath/_p.yml id: - narrate "<&2>Checking succesfully activated." - narrate "1" - narrate "2].contains[]>" - narrate "3].is_list[]>" - narrate "4].list_keys[]>" - narrate "5].list_deep_keys[]>" - narrate "6].read[_p.script].get[1].to[3]>" - narrate "" - narrate "xxxxxxxxx" - determine fulfilled whyy: #- foreach ].read[_p.script].get[].to[]> { # - narrate "" # } - foreach li@1|2|3 mnpc: type: format format: "[<&2><&f>]: "