Cannot Compare Strings with RandomSK

  • 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.

Matthew_Cash

Member
Jun 20, 2017
17
1
0
20
Skript Version: Skript 2.1.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.8.8
---


Code (Skript):

set {_distance} to text-arg compared to loop-value


Errors on Reload:

Code (Skript):
  1. Can't understand thisexpression
Console Errors: (if applicable)

Code (Skript):
  1. Error here
Other Useful Info:


Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? No
What other methods have you tried to fix it? Other version of RandomSK
 
It merged your posts because double posting clutters the chat.

Also, you can use Skuared's levenshtein distance expression, which is exactly the same. (Documentation is here)
Thanks for the response, but I am unable to load the plugin
code_language.skript:
21.08 14:11:25 [Server] WARN org.bukkit.plugin.InvalidPluginException: java.io.FileNotFoundException: plugins/skuared-1.0.jar does not exist
21.08 14:11:02 [Server] WARN ... 21 more
21.08 14:11:02 [Server] WARN Caused by: java.io.FileNotFoundException: plugins/skuared-1.0.jar does not exist
 
I need more details, are you sure this is the whole error ? Give me full console log.
code_language.skript:
22.08 13:15:37 [Server] WARN ... 24 more
22.08 13:15:37 [Server] WARN at java.lang.ClassLoader.loadClass(Unknown Source)
22.08 13:15:37 [Server] WARN at java.lang.ClassLoader.loadClass(Unknown Source)
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86)
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101)
22.08 13:15:37 [Server] WARN at java.net.URLClassLoader.findClass(Unknown Source)
22.08 13:15:37 [Server] WARN Caused by: java.lang.ClassNotFoundException: ch.njol.skript.lang.function.JavaFunction
22.08 13:15:37 [Server] WARN ... 20 more
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131)
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64)
22.08 13:15:37 [Server] WARN at java.lang.Class.forName(Unknown Source)
22.08 13:15:37 [Server] WARN at java.lang.Class.forName0(Native Method)
22.08 13:15:37 [Server] WARN Caused by: java.lang.NoClassDefFoundError: ch/njol/skript/lang/function/JavaFunction
22.08 13:15:37 [Server] WARN at java.lang.Thread.run(Unknown Source)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
22.08 13:15:37 [Server] WARN at java.util.concurrent.FutureTask.run(Unknown Source)
22.08 13:15:37 [Server] WARN at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997)
22.08 13:15:37 [Server] WARN at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162)
22.08 13:15:37 [Server] WARN at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641)
22.08 13:15:37 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
22.08 13:15:37 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
22.08 13:15:37 [Server] WARN at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:95)
22.08 13:15:37 [Server] WARN at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114)
22.08 13:15:37 [Server] WARN at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:356)
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329)
22.08 13:15:37 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135)
22.08 13:15:37 [Server] WARN org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: ch/njol/skript/lang/function/JavaFunction
This is all I have
[doublepost=1503422185,1503422139][/doublepost]
I need more details, are you sure this is the whole error ? Give me full console log.
If I try to load it with Plugman, it says not a valid plugin
 
First of all, don't call me lazy. And second, I have done both.
Calm down, he's right. Plugman are for lazy people. Besides, the skript addons hate plug man because they can cause errors.

EDIT: Just add the text-arg in a list variable and the loop-value in a different list variable. Compare both variables by splitting it so you can check individual letters. Add 1 to a number variable if they do not compare.
 
Last edited by a moderator:
I'm not going to spoon-feed you by providing code. But, can you provide what your current code is? Or is it like the one on the docs.
Essentially what I am doing is making a chat filter that will check if the message is to similar to the previous
This is what I have, but I don't really understand what you are saying
code_language.skript:
loop length of message:
    set {_text} to the first loop-value characters in chat message
    set {_text} to the last 1 characters in {_text}
    add {_text} to {chatmessage::*}
    
loop {chatmessage::*}:
 
Essentially what I am doing is making a chat filter that will check if the message is to similar to the previous
This is what I have, but I don't really understand what you are saying
code_language.skript:
loop length of message:
    set {_text} to the first loop-value characters in chat message
    set {_text} to the last 1 characters in {_text}
    add {_text} to {chatmessage::*}
   
loop {chatmessage::*}:
This code doesn't quite make sense to me. You're adding the last character in {_text} to the chat message variable? What strings are you even trying to compare?
 
This code doesn't quite make sense to me. You're adding the last character in {_text} to the chat message variable? What strings are you even trying to compare?
code_language.skript:
on chat:
    loop {chatmessage::*}:
        if loop-value is loop-index charcter in message:
            #same character
    loop length of message:
        set {_text} to the first loop-value characters in chat message
        set {_text} to the last 1 characters in {_text}
        add {_text} to {chatmessage::*}
Like I said, I do not understand what yo usaid, so I would appreciate if you could re-state it.
 
So Skuared still doesn't load ? Try removing it, restarting, placing it again and restarting again. If the same error is here, you have to do the exact same thing but with Skript and all addons you have instead of just Skuared. Also, even though the replacement might seem good, how can it detect that a letter was added at the beginning or inserted ? it can't and will result in crazy false differences.
 
Status
Not open for further replies.