Skocz do zawartości
  • 0

Funkcje.


ZiomuuSss

Pytanie

Witam. Dzisiaj zauważyłem, że funkcje całkowicie nie działają :c

Kod wywoływania funkcji:

 

command /test:
    trigger:
        function "exp" {player, 3 and 7};
        stop

Część kodu tworzenia funkcji:

 

Method "exp" {gracz, minexp and maxexp}:    set {_pl} to arg{1};
    set {_player} to {_pl} parsed as player
    set {_minxp} to arg{2};
    set {_maxxp} to arg{3};
    send "czesc" to {_player}
    stop

Błąd:

 

[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! [skript] Severe Error:
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[19:17:33] [server thread/ERROR]: #!#! If you're a server admin however please go to http://dev.bukkit.org/server-mods/skript/tickets/
[19:17:33] [server thread/ERROR]: #!#! and check whether this error has already been reported.
[19:17:33] [server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it,
[19:17:33] [server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[19:17:33] [server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[19:17:33] [server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! Stack trace:
[19:17:33] [server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: UnparsedLiterals must be converted before use
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.invalidAccessException(UnparsedLiteral.java:275)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.getAll(UnparsedLiteral.java:285)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.ExpressionList.getAll(ExpressionList.java:117)
[19:17:33] [server thread/ERROR]: #!#!     at net.dzikoysk.wildskript.collections.functions.elements.EffFunction.execute(EffFunction.java:17)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:50)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:63)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:91)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand$1.call(ScriptCommand.java:220)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand$1.call(ScriptCommand.java:1)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.util.Task.callSync(Task.java:139)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:193)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:260)
[19:17:33] [server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:155)
[19:17:33] [server thread/ERROR]: #!#!     at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
[19:17:33] [server thread/ERROR]: #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[19:17:33] [server thread/ERROR]: #!#!     at java.lang.reflect.Method.invoke(Method.java:483)
[19:17:33] [server thread/ERROR]: #!#!     at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
[19:17:33] [server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[19:17:33] [server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[19:17:33] [server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1131)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:974)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:45)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(PacketPlayInChat.java:1)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13)
[19:17:33] [server thread/ERROR]: #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[19:17:33] [server thread/ERROR]: #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:712)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651)
[19:17:33] [server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554)
[19:17:33] [server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! Version Information:
[19:17:33] [server thread/ERROR]: #!#!   Skript: 2.1.2
[19:17:33] [server thread/ERROR]: #!#!   Bukkit: 1.8.3-R0.1-SNAPSHOT
[19:17:33] [server thread/ERROR]: #!#!   Minecraft: 1.8.3
[19:17:33] [server thread/ERROR]: #!#!   Java: 1.8.0_25
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! Running CraftBukkit: false
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! Current node: null
[19:17:33] [server thread/ERROR]: #!#! Current item: net.dzikoysk.wildskript.collections.functions.elements.EffFunction
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! Thread: Server thread
[19:17:33] [server thread/ERROR]: #!#! 
[19:17:33] [server thread/ERROR]: #!#! End of Error.
[19:17:33] [server thread/ERROR]: #!#! 

Przy wywoływaniu komendy pisze "An internal error while attempting to perform this command", no i powyższy błąd w konsoli. Proszę o pomoc :(
PS. Proszę moderatorów o NIE PRZENOSZENIE tematu do zakładki WildSkript bo tam kompletnie nikt nie zagląda xd.
Odnośnik do komentarza
https://skript.pl/temat/7607-funkcje/
Udostępnij na innych stronach

10 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Lol, a jednak to nie funkcje z SkQuery tylko z Skript 2.2

Function test(p: Player):    send "Testowa wiadomosc" to {_p}command /test:    trigger:        test(player)

http://skript.pl/short/Funkcje/

Edytowane przez Shooterowy
Odnośnik do komentarza
https://skript.pl/temat/7607-funkcje/#findComment-60358
Udostępnij na innych stronach

  • 0

Emm, a wie ktoś może jak naprawić te funkcje z WS albo je zastąpić? Bo na co mi funkcje z Skripta 2.2 skoro tam cała reszta nie działa zd

 

Co na przykład nie działa?

Edytowane przez Shooterowy
Odnośnik do komentarza
https://skript.pl/temat/7607-funkcje/#findComment-60427
Udostępnij na innych stronach

  • 0

Function exp(gracz: Player, minexp: Integer, maxexp: Integer):
send "%{_gracz}%" to {_gracz}
send "%{_minexp}%" to {_gracz}
send "%{_maxexp}%" to {_gracz}
send "Czesc" to {_gracz}
stop
command /test:
trigger:
exp(player, 3, 7)
stop
Funkcje definiujesz przed kodem, który chcesz wykonać.
 
Function exp(gracz: Player):
 
gracz - nazwa zmiennej tymczasowej, w kodzie: {_gracz}
Player - typ zmiennej gracz

Edytowane przez Shooterowy
Odnośnik do komentarza
https://skript.pl/temat/7607-funkcje/#findComment-60428
Udostępnij na innych stronach

  • 0

Funkcje działają, ale nic oprócz tego. Np. Przy kodzie który w Skripcie 2.1.2 działał wywala dziwne błędy, nie można zmienić maksymalnego życia gracza/moba (A w starszej wersji się da, bez problemów!), nie da się dodać nic do ekwipunku gracza (bo "wyrażenie jest nieprawidłowe" ogólnie to co chwile ma jakiś problem, nie chcę tego nowego skripta skoro tam dodali funkcje a usunęli wszystko inne. Będę zamiast funkcji używał komendy, bo ten nowy skript to jakaś parodia. Szkoda że się nie da wywołać "ukrytych komend". No nic, temat raczej do zamknięcia.

Odnośnik do komentarza
https://skript.pl/temat/7607-funkcje/#findComment-60727
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ę...