Similarity for my skript

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

FluffyFlu_

Member
Jan 4, 2020
3
0
1
21
Hi!
I'm creating Chat Bot in Skript.
People are not perfect and sometimes can misspell... And I want to my bot get prepared for this. :emoji_grinning: But I don't know how to do it.
For example what I want:
Bot know word "hello"
I wanted to write "hello" but I wrote "heloo"
Bot don't know "heloo", but it's similar to "hello", so bot will resond for "hello", even it's not same, but it's similar!

How can I do similarity for my skript?
If you need my skript, I can paste it here. :emoji_grinning:
 
Hi,
writing everything is too dificult. Bot has over 300 lines of codes of quotes. :emoji_grinning:

Code:
command /bc [<text>]:
  aliases: /cb, /chatbot
#  permission: chatbot.use
#  permission message: &7 [&esejr&cChatBot&7] ZidLe > Jsem pouze pro sponzory. :/
  trigger:
    if arg-1 is not set:
      send " &bTip! &fPoužívá se ve formátu &7/cb něco"
      stop
    else if arg-1 is "reload":
      if player has permission "nemas permici":
        make console execute command "sk reload chatbot"
        set {reloader.czcb} to player
    else if arg-1 is "Jak se jmenuješ?":
      send "{@jmpr} {@jmeno}&7, čte se to &eŽidle"
    else if arg-1 is "ok":
      send "{@jmpr} :ok_hand:"
    else if arg-1 contain "meme" or "memes" or "mem":
      send "{@jmpr} promiň, to ti nemohu poslat..."
      send "{@jmpr} ale mrkni na reddit /r/memes!"
    else if arg-1 is "něco":
      send "{@jmpr} -,- NĚCO JINÝHO!"
    else if arg-1 contain "Kdo jsi" or "Kdo si":
      send "{@jmpr} &cChatBot voe."
    else if arg-1 contain "Dobře" or "Výborně" or "Ujde" or "super":
      send "{@jmpr} To je dobře! :D"
      send "{@jmpr} Já se mám taky dobře! :D"
    else if arg-1 contain "Špatně" or "Blbě" or "Nic moc" or "Nicmoc":
      send "{@jmpr} Tak to je mi líto :/ s tím nic neudělám. :("
[doublepost=1578174487,1578171236][/doublepost]Hi,
writing everything is too dificult. Bot has over 300 lines of codes.

Code:
command /bc [<text>]:
  aliases: /cb, /chatbot
#  permission: chatbot.use
#  permission message: &7 [&esejr&cChatBot&7] ZidLe > Jsem pouze pro sponzory. :/
  trigger:
    if arg-1 is not set:
      send " &bTip! &fPoužívá se ve formátu &7/cb něco"
      stop
    else if arg-1 is "reload":
      if player has permission "nemas permici":
        make console execute command "sk reload chatbot"
        set {reloader.czcb} to player
    else if arg-1 is "Jak se jmenuješ?":
      send "{@jmpr} {@jmeno}&7, čte se to &eŽidle"
    else if arg-1 is "ok":
      send "{@jmpr} :ok_hand:"
    else if arg-1 contain "meme" or "memes" or "mem":
      send "{@jmpr} promiň, to ti nemohu poslat..."
      send "{@jmpr} ale mrkni na reddit /r/memes!"
    else if arg-1 is "něco":
      send "{@jmpr} -,- NĚCO JINÝHO!"
    else if arg-1 contain "Kdo jsi" or "Kdo si":
      send "{@jmpr} &cChatBot voe."
    else if arg-1 contain "Dobře" or "Výborně" or "Ujde" or "super":
      send "{@jmpr} To je dobře! :D"
      send "{@jmpr} Já se mám taky dobře! :D"
    else if arg-1 contain "Špatně" or "Blbě" or "Nic moc" or "Nicmoc":
      send "{@jmpr} Tak to je mi líto :/ s tím nic neudělám. :("
 
First of all, If I'm not mistaken, you need an options file for an {@statement}.

For example:

Code:
options:
    perms: admin
    permsmessge: &c&lNo permission.
   
command /testing:
    permission: {@perms}
    permission message: {@permsmessage}
    trigger:
        send "&c&lYAY THE PERMS ACTUALLY WORK!" to the player

Good luck,

- TheCringleYT
 
Hi!
I'm creating Chat Bot in Skript.
People are not perfect and sometimes can misspell... And I want to my bot get prepared for this. :emoji_grinning: But I don't know how to do it.
For example what I want:
Bot know word "hello"
I wanted to write "hello" but I wrote "heloo"
Bot don't know "heloo", but it's similar to "hello", so bot will resond for "hello", even it's not same, but it's similar!

How can I do similarity for my skript?
If you need my skript, I can paste it here. :emoji_grinning:
You can use the Levenshtein distance (Skuared has support for it)
 
Status
Not open for further replies.