Solved Skript-mirror

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Scholler

Active Member
Aug 6, 2018
130
9
0
24
Hello, I have a problem with skript-mirror v 0.19.1

Import (and soo much other stuff) not working.

For example:
code_language.skript:
on script load:
    import "java.lang.System"
    import "java.lang.Runtime"
Error:
Can't understand this condition/effect: import "java.lang.System"
Can't understand this condition/effect: import "java.lang.Runtime"

I just wanted to try this addon but it's not working:c
 
Hello, I have a problem with skript-mirror v 0.19.1

Import (and soo much other stuff) not working.

For example:
code_language.skript:
on script load:
    import "java.lang.System"
    import "java.lang.Runtime"
Error:
Can't understand this condition/effect: import "java.lang.System"
Can't understand this condition/effect: import "java.lang.Runtime"

I just wanted to try this addon but it's not working:c
With newer versions this is not how you import stuff
code_language.skript:
import:
    ... classes

code_language.skript:
import:
    org.bukkit.entity.Player
is an example
 
Thank you :emoji_slight_smile:
Can you tell me what's wrong with this? I wanted to try this, its a script to shut down a computer (It's not mine, just saw this somewhere)
code_language.skript:
set {_os} to {System}.getProperty("os.name")
        if {_os} contains "windows":
            set {_command} to "shutdown -s"
        else:
            set {_command} to "shutdown"
        {Runtime}.getRuntime().exec({_command});

this is the error:
Can't understand this condition/effect: {Runtime}.getRuntime().exec({_command});

I want to learn because... As you can see, I'm a noob at this java programming..

And sorry for my bad english
 
Thank you :emoji_slight_smile:
Can you tell me what's wrong with this? I wanted to try this, its a script to shut down a computer (It's not mine, just saw this somewhere)
code_language.skript:
set {_os} to {System}.getProperty("os.name")
        if {_os} contains "windows":
            set {_command} to "shutdown -s"
        else:
            set {_command} to "shutdown"
        {Runtime}.getRuntime().exec({_command});

this is the error:
Can't understand this condition/effect: {Runtime}.getRuntime().exec({_command});

I want to learn because... As you can see, I'm a noob at this java programming..

And sorry for my bad english
Uh. you didn't set {Runtime}..?
Use `as` to import stuff: eg.
code_language.skript:
import:
    java.lang.System as TheSystem
so you can use
code_language.skript:
TheSystem.getStuff().doStuff()
 
Uh. you didn't set {Runtime}..?
Use `as` to import stuff: eg.
code_language.skript:
import:
    java.lang.System as TheSystem
so you can use
code_language.skript:
TheSystem.getStuff().doStuff()

code_language.skript:
import:
    java.lang.System as System
    java.lang.Runtime as Runtime
code_language.skript:
        set {_os} to {System}.getProperty("os.name")
        if {_os} contains "windows":
            set {_command} to "shutdown -s"
        else:
            set {_command} to "shutdown"
        Runtime.getRuntime().exec({_command});

ugh not working.. Never mind, I don't really need this:emoji_grinning:
 
code_language.skript:
import:
    java.lang.System as System
    java.lang.Runtime as Runtime
code_language.skript:
        set {_os} to {System}.getProperty("os.name")
        if {_os} contains "windows":
            set {_command} to "shutdown -s"
        else:
            set {_command} to "shutdown"
        Runtime.getRuntime().exec({_command});

ugh not working.. Never mind, I don't really need this:emoji_grinning:
You're still using {System} not System. You didnt set {System} var...
 
Status
Not open for further replies.