Skocz do zawartości
  • 0

Nie działa zapisywanie wartości pliku do zmiennej.


bludis

Pytanie

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
Spoiler

[15:01:51 ERROR]: Cannot load plugins\Bfalsetrue\bfalsetrue.yml
org.bukkit.configuration.InvalidConfigurationException: while scanning a simple key
 in 'string', line 3, column 1:
    'Przyklad: komenda pex user {PLA ...
    ^
could not find expected ':'
 in 'string', line 4, column 1:
    'Zmienna: {PLAYER} - zastepuje p ...
    ^

        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:162) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:130) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:179) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:42) ~[WildSkript.jar:?]
        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:1) ~[WildSkript.jar:?]
        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.effects.EffChange.execute(EffChange.java:268) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:52) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.Trigger.execute(Trigger.java:55) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.events.EvtScript.register(EvtScript.java:61) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:636) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:1) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:655) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.lambda$1(ScriptLoader.java:339) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:351) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.lambda$0(ScriptLoader.java:281) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:311) [Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.Skript$2.run(Skript.java:410) [Skript%202.2%20dev31c.jar:?]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_171]
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key
 in 'string', line 3, column 1:
    'Przyklad: komenda pex user {PLA ...
    ^
could not find expected ':'
 in 'string', line 4, column 1:
    'Zmienna: {PLAYER} - zastepuje p ...
    ^

        at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:465) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:291) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:557) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:147) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:224) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:154) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:122) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:505) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:424) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:54) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        ... 27 more
[15:01:51 WARN]: java.lang.NullPointerException
[15:01:51 WARN]:        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:44)
[15:01:51 WARN]:        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:1)
[15:01:51 WARN]:        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[15:01:51 WARN]:        at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[15:01:51 WARN]:        at ch.njol.skript.lang.Effect.run(Effect.java:52)
[15:01:51 WARN]:        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[15:01:51 WARN]:        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[15:01:51 WARN]:        at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[15:01:51 WARN]:        at ch.njol.skript.events.EvtScript.register(EvtScript.java:61)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:636)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:1)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:655)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.lambda$1(ScriptLoader.java:339)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:351)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.lambda$0(ScriptLoader.java:281)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:311)
[15:01:51 WARN]:        at ch.njol.skript.Skript$2.run(Skript.java:410)
[15:01:51 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71)
[15:01:51 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[15:01:51 WARN]:        at java.lang.Thread.run(Unknown Source)
[15:01:51 ERROR]: Cannot load plugins\Bfalsetrue\bfalsetrue.yml
org.bukkit.configuration.InvalidConfigurationException: while scanning a simple key
 in 'string', line 3, column 1:
    'Przyklad: komenda pex user {PLA ...
    ^
could not find expected ':'
 in 'string', line 4, column 1:
    'Zmienna: {PLAYER} - zastepuje p ...
    ^

        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:162) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:130) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:179) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:42) ~[WildSkript.jar:?]
        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:1) ~[WildSkript.jar:?]
        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.effects.EffChange.execute(EffChange.java:268) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:52) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.lang.Trigger.execute(Trigger.java:55) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.events.EvtScript.register(EvtScript.java:61) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:636) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:1) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:655) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.lambda$1(ScriptLoader.java:339) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:351) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.lambda$0(ScriptLoader.java:281) ~[Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:311) [Skript%202.2%20dev31c.jar:?]
        at ch.njol.skript.Skript$2.run(Skript.java:410) [Skript%202.2%20dev31c.jar:?]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576) [spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_171]
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key
 in 'string', line 3, column 1:
    'Przyklad: komenda pex user {PLA ...
    ^
could not find expected ':'
 in 'string', line 4, column 1:
    'Zmienna: {PLAYER} - zastepuje p ...
    ^

        at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:465) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:291) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:557) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:147) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:224) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:154) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:122) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:505) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:424) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:54) ~[spigot-1.12.jar:git-Spigot-596221b-9a1fc1e]
        ... 27 more
[15:01:51 WARN]: java.lang.NullPointerException
[15:01:51 WARN]:        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:44)
[15:01:51 WARN]:        at net.dzikoysk.wildskript.expressions.files.ExprYamlSingleValue.get(ExprYamlSingleValue.java:1)
[15:01:51 WARN]:        at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[15:01:51 WARN]:        at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[15:01:51 WARN]:        at ch.njol.skript.lang.Effect.run(Effect.java:52)
[15:01:51 WARN]:        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[15:01:51 WARN]:        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[15:01:51 WARN]:        at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[15:01:51 WARN]:        at ch.njol.skript.events.EvtScript.register(EvtScript.java:61)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:636)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader$3.call(ScriptLoader.java:1)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:655)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.lambda$1(ScriptLoader.java:339)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:351)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.lambda$0(ScriptLoader.java:281)
[15:01:51 WARN]:        at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:311)
[15:01:51 WARN]:        at ch.njol.skript.Skript$2.run(Skript.java:410)
[15:01:51 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71)
[15:01:51 WARN]:        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[15:01:51 WARN]:        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[15:01:51 WARN]:        at java.lang.Thread.run(Unknown Source)

 

Nie wywala błędów? ?

1. Nie używaj wf w yml. (No chyba, że do komentarza.)

2. 

Cytat

set {stan::true::false} to single value "test" get of "plugins/Bfalsetrue/bfalsetrue.yml"

Nawet nie ma takiego klucza test

Zrób yml z wildskript lub skquery (te drugie bardziej polecam) 

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Przerobiłem yamla na SkQuery.

Teraz zapisuje do zmiennej, aczkolwiek nie umie jej rozczytać. Mianowicie,  gdy wpisze "true" w configu, cały czas po wpisaniu komendy wyskakuje, że zmienna jest na "brak".

Kod: 

 

Config:

Cytat

stan: true
komenda: bc siema

 

@knugi

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Bo w przypadku:

if {stan::true::false} is "true": #lub is "false"

trzeba jeszcze dać:

set {_x} to "%{stan::true::false}%" parsed as boolean

i wtedy dopiero:

if {_x} is "true": #lub is "false"

 

Edytowane przez Rejszpat
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Hy, hy hy :P

Dzieje się tak ponieważ ustawiasz tą zmienną tylko RAZ

on script load:
	if yaml value "stan" from file "../../YT/config.yml" is not set: #Pliku nie ma, tworze go
		set yaml value "stan" from file "../../YT/config.yml" to "brak" #Dodaje value
		set yaml value "komenda" from file "../../YT/config.yml" to "brak" #Dodaje value
		set {komenda::true::false} to yaml value "komenda" from file "../../YT/config.yml" #Ustawiam zmienna na brak
		set {stan::true::false} to yaml value "stan" from file "../../YT/config.yml" #Ustawiam zmienna na brak
		#Stop

Usuń po jednym tabie przy ustawianiu zmiennych:

on script load:
	if yaml value "stan" from file "../../YT/config.yml" is not set:
		set yaml value "stan" from file "../../YT/config.yml" to "brak"
		set yaml value "komenda" from file "../../YT/config.yml" to "brak"
		send "&aPomyslnie stworzono pliki konfiguracyjne&7!" to all ops and console
		send "&7&l[ &2&lb&4&lFALSE&2&lTRUE&7&l ]" to all ops and console
	set {komenda::true::false} to yaml value "komenda" from file "../../YT/config.yml"
	set {stan::true::false} to yaml value "stan" from file "../../YT/config.yml"

 

Drugra sprawa to taka, że to zapisuje jako boolean, a nie text.

wieć nie będzie wykonywać komendy:

command /truefalse [<text>]:
	trigger:
		broadcast "%{stan::true::false}%" #<- wyświetla true
		if {stan::true::false} is "true": #<- ten warunek nie przechodzi, ponieważ booleana porównujesz do stringa.
  		#Możesz to zrobić np tak: if "%{stan::true::false}%" is "true": lub if {stan::true::false} is true:
			if {komenda::true::false} is set:
				replace all "{PLAYER}" with "%player%" in {komenda::true::false}
				send "&aKomenda dziala pomyslnie, poniewaz w configu zostalo zaznaczone &2&lTRUE"
				send "&aConsola wlasnie przygotowuje dla Ciebie komende podana w configu!"
				execute console command "%{komenda::true::false}%"
				send "&aKomenda zostala wykonana"
				stop

 

 

I co do tego ustwiania tylko raz... Zauważyłem, że jeszcze masz w komendzie

set {komenda::true::false} to yaml value "komenda" from file "../../YT/config.yml"
set {stan::true::false} to yaml value "stan" from file "../../YT/config.yml"

Raczej bym wolał to zamienić np na:

set {_komenda} to yaml value...

set {_stan} to yaml value..

i jeżeli tak robisz to w ogóle po co jest zmienna {komenda::...} i {stan::} jeżeli przy komendzie pobierasz cały czas z yml? 

#FuckLogic

Edytowane przez knugi
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
12 minut temu, Rejszpat napisał:

Bo w przypadku:


if {stan::true::false} is "true": #lub is "false"

trzeba jeszcze dać:


set {_x} to "%{stan::true::false}%" parsed as boolean

i wtedy dopiero:


if {_x} is "true": #lub is "false"

 

Co? :facepalm:

Tylko, że w tym przypadku {stan::true::false} jest booleanem.

Zapisujesz {_x} jako boolean i dalej go porównujesz do Stringa. Jakim prawem to ma działać? :/ 

#FuckLogicV2

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
29 minut temu, Rejszpat napisał:

Mi to działa :nokappa: 

To pokaż swoje outputy na tym kodzie:

command /testtruefalse <boolean>:
	trigger:
		send "TestTrueFalse: %arg%"
		send "Boolean -> String"
		set {stan::true::false} to arg
		if {stan::true::false} is "true":
			send "Warunek 1 dziala."
		if {stan::true::false} is "false":
			send "Warunek 2 dziala."
		set {_x} to "%{stan::true::false}%" parsed as boolean
		if {_x} is "true":
			send "Warunek x1 dziala."
		if {_x} is "false":
			send "Warunek x2 dziala."
		send "boolean -> boolean"
		if {stan::true::false} is true:
			send "BWarunek 1 dziala."
		if {stan::true::false} is false:
			send "BWarunek 2 dziala."
		set {_x} to "%{stan::true::false}%" parsed as boolean
		if {_x} is true:
			send "BWarunek x1 dziala."
		if {_x} is false:
			send "BWarunek x2 dziala."

 

Bo moje są takie:

[17:09:59 INFO]: [Skript] Reloading util.sk...
[17:09:59 INFO]: [Skript] Successfully reloaded util.sk.
>testtruefalse true
[17:10:04 INFO]: TestTrueFalse: true
[17:10:04 INFO]: Boolean -> String
[17:10:04 INFO]: boolean -> boolean
[17:10:04 INFO]: BWarunek 1 dziala.
[17:10:04 INFO]: BWarunek x1 dziala.
[17:10:04 INFO]: Unknown command. Type "/help" for help.
>testtruefalse false
[17:10:11 INFO]: TestTrueFalse: false
[17:10:11 INFO]: Boolean -> String
[17:10:11 INFO]: boolean -> boolean
[17:10:11 INFO]: BWarunek 2 dziala.
[17:10:11 INFO]: BWarunek x2 dziala.
[17:10:11 INFO]: Unknown command. Type "/help" for help.
>

 

Odnośnik do komentarza
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...