Olyno / skent

Manage your files and folder with Skript
GNU General Public License v3.0
11 stars 2 forks source link

Can't use local variables with async effects. #37

Closed Bonnie20402 closed 7 months ago

Bonnie20402 commented 2 years ago

Describe your problem

What's wrong? Local variables won't work propely in any async effects. The output is always < none >. E.g creating a file "%{_x}%.json" where {_x} = "name.json" would create a file named "< none >.json" What is supposed to do? It should allow me to use local variables on async effects. The same thing happens if I create a variable in the start and delete at the end of the code.

Versions

Skript: 2.6.2 (Gio's 1.8 fork) Server: Paper 1.8.9 Skent: 32.0

Code

options:
    mundo_mina:rankup_mina
    mundo_minapvp:rankup_minapvp
    PASTA_DADOS:plugins/BonnieRankup/picaretas

function PickaxeInit(p:player):
    if file path "{@PASTA_DADOS}/%{_p}%.json" is not available:
        async copy file path "plugins/Skript/scripts/rankup/mina/picaretaTemplate.json" to file path "{@PASTA_DADOS}/%{_p}%.json"
        send "&a[PICARETAS] Criamos um ficheiro novo do sistema de picaretas para ti, olha só :) " to {_p}
(..)

It created a file named < none >.json

Error

No error.

Olyno commented 2 years ago

This issue should be fixed with the latest version (Skent 3.2.1). Please reopen this issue if you still have this issue.

Olyno commented 1 year ago

What is your code? @Vulqa?

Vulqa commented 1 year ago
function copyServer(server: string, template: string):
    async copy file path "/root/minecraft/servers_template/%{_template}%" to file path "/root/minecraft/servers/%{_server}%"
    broadcast "&aServeur &f%{_server}% &a(Template '%{_template}%') copié"

command /test <text> <text>:
    trigger:
        copyServer(arg-1, arg-2)

image

Olyno commented 1 year ago

Hi @Vulqa, can you have a look in this version? If everything seems good to you, publish it.

Olyno commented 7 months ago

Closing this issue as no answer. Please reopen it if you still have this problem.