Closed Misio12320 closed 3 years ago
Your code is wrong. There is 3 problems in your code:
file path "/plugins/Gods/"
gives you only 1 directory or file path, not more. So your set {_name:*}
is totally wrong. If you want to get all files and directory paths, then there is an expression to do that.insert
will be in a random order.none
values.Fixed a bit;
trigger:
set {name::*} to all files of directory path "plugins/Gods/"
loop {name::*}:
wait 1 real second
broadcast {name::*}
replace every "_" in {name::*} with "."
insert " ""custom.%{name::*}%"": {" at line {Line1} of file path "sounds/sounds.json"
insert " ""sounds"": [" at line {Line2} of file path "sounds/sounds.json"
insert " ""custom/%{name::*}%""" at line {Line3} of file path "sounds/sounds.json"
insert " ]" at line {Line4} of file path "sounds/sounds.json"
insert " }," at line {Line5} of file path "sounds/sounds.json"
add 5 to {Line1}, {Line2}, {Line3}, {Line4} and {Line5
}
but now its this: ( may I will wait for the async fix.)
"custom/plugins/Gods/Alert_Notify_Kill_5.oga, plugins/Gods/Notify_YouSlainEnemy.oga, plugins/Gods/Notify_Kill_Deicide.oga, plugins/Gods/Alert_Notify_Kill_4.oga, plugins/Gods/Alert_Notify_Kill_3.oga, plugins/Gods/Narrator_Callouts_FirstBlood.oga, plugins/Gods/Notify_Minions_Spawned.oga and plugins/Gods/Alert_Notify_Kill_2.oga"
I'm closing this issue because I'm not gonna teach how to learn Skript and how use addon syntaxes. A string is not a list, so custom.%{name::*}%
not gonna work, and getting all files doesn't mean getting their names, so all files of directory path "plugins/Gods/"
will give you a list of path, not a list of name.
You already opened 2 issues about the same project, so have a look inside this issue and the code you did or I gave you there (#20)
Hi. Could anyone of developers help me with the code? I see missing expression with files. in the docs of Skent is only [the] (file|dir[ectory]) name of %path% which means only 1 file not all files and I want to make a Skript insert a text from name of file and add it into another file. My code:
It should insert the name of file into sounds.json. The correct one should look like this:
not like this:
help. This server is running Purpur version git-Purpur-1047 (MC: 1.16.5) Skript version 2.5.3, Skent version 3.0.0, skUtilities version 0.9.2