Solved Help with some characters can't replaced.

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

blackid512

Member
May 8, 2017
23
0
1
23
Can someone help me with color format isn't replaced

Method 1: #looping
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        add "&a" to {_color::*}
        add "&b" to {_color::*}
        add "&c" to {_color::*}
        add "&d" to {_color::*}
        add "&e" to {_color::*}
        add "&f" to {_color::*}
        add "&r" to {_color::*}
        add "&0" to {_color::*}
        add "&1" to {_color::*}
        add "&2" to {_color::*}
        add "&3" to {_color::*}
        add "&4" to {_color::*}
        add "&5" to {_color::*}
        add "&6" to {_color::*}
        add "&7" to {_color::*}
        add "&8" to {_color::*}
        add "&9" to {_color::*}
        loop {_color::*}:
            replace all "%loop-value%" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

Method 2: #Manual set (double "&&")
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        replace all "&&a" in {_name} with ""
        replace all "&&b" in {_name} with ""
        replace all "&&c" in {_name} with ""
        replace all "&&d" in {_name} with ""
        replace all "&&e" in {_name} with ""
        replace all "&&f" in {_name} with ""
        replace all "&&r" in {_name} with ""
        replace all "&&0" in {_name} with ""
        replace all "&&1" in {_name} with ""
        replace all "&&2" in {_name} with ""
        replace all "&&3" in {_name} with ""
        replace all "&&4" in {_name} with ""
        replace all "&&5" in {_name} with ""
        replace all "&&6" in {_name} with ""
        replace all "&&7" in {_name} with ""
        replace all "&&8" in {_name} with ""
        replace all "&&9" in {_name} with ""

            set {_l} to length of {_name}
            set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

Method 3: #Manual (Single "&")
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        replace all "&a" in {_name} with ""
        replace all "&b" in {_name} with ""
        replace all "&c" in {_name} with ""
        replace all "&d" in {_name} with ""
        replace all "&e" in {_name} with ""
        replace all "&f" in {_name} with ""
        replace all "&r" in {_name} with ""
        replace all "&0" in {_name} with ""
        replace all "&1" in {_name} with ""
        replace all "&2" in {_name} with ""
        replace all "&3" in {_name} with ""
        replace all "&4" in {_name} with ""
        replace all "&5" in {_name} with ""
        replace all "&6" in {_name} with ""
        replace all "&7" in {_name} with ""
        replace all "&8" in {_name} with ""
        replace all "&9" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

All the method above isn't working.
I still have one more method, but I don't know the syntax.
Like this: set {_var} to first character after "&"
Can somebody help me?
 
Wait, i'm testing a method
Okay thx, it already fixed by myself.
The method is like this, by replacing all the loop-value to uncolored loop-value, I used double "&&" and double character.
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        add "&&aa" to {_color::*}
        add "&&bb" to {_color::*}
        add "&&cc" to {_color::*}
        add "&&dd" to {_color::*}
        add "&&ee" to {_color::*}
        add "&&ff" to {_color::*}
        add "&&rr" to {_color::*}
        add "&&00" to {_color::*}
        add "&&11" to {_color::*}
        add "&&22" to {_color::*}
        add "&&33" to {_color::*}
        add "&&44" to {_color::*}
        add "&&55" to {_color::*}
        add "&&66" to {_color::*}
        add "&&77" to {_color::*}
        add "&&88" to {_color::*}
        add "&&99" to {_color::*}
        loop {_color::*}:
            set {_color} to "%uncolored loop-value%"
            #send "%{_color}%"
            replace all "%uncolored loop-value%" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop
[doublepost=1587939834,1587939733][/doublepost]
Wait, i'm testing a method

Bro, I forget where's the place to close threads?
 
Okay thx, it already fixed by myself.
The method is like this, by replacing all the loop-value to uncolored loop-value, I used double "&&" and double character.
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        add "&&aa" to {_color::*}
        add "&&bb" to {_color::*}
        add "&&cc" to {_color::*}
        add "&&dd" to {_color::*}
        add "&&ee" to {_color::*}
        add "&&ff" to {_color::*}
        add "&&rr" to {_color::*}
        add "&&00" to {_color::*}
        add "&&11" to {_color::*}
        add "&&22" to {_color::*}
        add "&&33" to {_color::*}
        add "&&44" to {_color::*}
        add "&&55" to {_color::*}
        add "&&66" to {_color::*}
        add "&&77" to {_color::*}
        add "&&88" to {_color::*}
        add "&&99" to {_color::*}
        loop {_color::*}:
            set {_color} to "%uncolored loop-value%"
            #send "%{_color}%"
            replace all "%uncolored loop-value%" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop
[doublepost=1587939834,1587939733][/doublepost]

Bro, I forget where's the place to close threads?
You can't close threads but to mark it as solved click edit thread and Click "(No Prefix)" you'll see Solved click it and click Save Thread
 
Can someone help me with color format isn't replaced

Method 1: #looping
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        add "&a" to {_color::*}
        add "&b" to {_color::*}
        add "&c" to {_color::*}
        add "&d" to {_color::*}
        add "&e" to {_color::*}
        add "&f" to {_color::*}
        add "&r" to {_color::*}
        add "&0" to {_color::*}
        add "&1" to {_color::*}
        add "&2" to {_color::*}
        add "&3" to {_color::*}
        add "&4" to {_color::*}
        add "&5" to {_color::*}
        add "&6" to {_color::*}
        add "&7" to {_color::*}
        add "&8" to {_color::*}
        add "&9" to {_color::*}
        loop {_color::*}:
            replace all "%loop-value%" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

Method 2: #Manual set (double "&&")
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        replace all "&&a" in {_name} with ""
        replace all "&&b" in {_name} with ""
        replace all "&&c" in {_name} with ""
        replace all "&&d" in {_name} with ""
        replace all "&&e" in {_name} with ""
        replace all "&&f" in {_name} with ""
        replace all "&&r" in {_name} with ""
        replace all "&&0" in {_name} with ""
        replace all "&&1" in {_name} with ""
        replace all "&&2" in {_name} with ""
        replace all "&&3" in {_name} with ""
        replace all "&&4" in {_name} with ""
        replace all "&&5" in {_name} with ""
        replace all "&&6" in {_name} with ""
        replace all "&&7" in {_name} with ""
        replace all "&&8" in {_name} with ""
        replace all "&&9" in {_name} with ""

            set {_l} to length of {_name}
            set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

Method 3: #Manual (Single "&")
code_language.skript:
command /acac [<text>]:
    trigger:
        if arg is not set:
            set {_arg} to "null"
            set {_name} to "null"
        if arg is set:
            set {_arg} to "%arg%"
            set {_name} to "%arg%"
        replace all "&a" in {_name} with ""
        replace all "&b" in {_name} with ""
        replace all "&c" in {_name} with ""
        replace all "&d" in {_name} with ""
        replace all "&e" in {_name} with ""
        replace all "&f" in {_name} with ""
        replace all "&r" in {_name} with ""
        replace all "&0" in {_name} with ""
        replace all "&1" in {_name} with ""
        replace all "&2" in {_name} with ""
        replace all "&3" in {_name} with ""
        replace all "&4" in {_name} with ""
        replace all "&5" in {_name} with ""
        replace all "&6" in {_name} with ""
        replace all "&7" in {_name} with ""
        replace all "&8" in {_name} with ""
        replace all "&9" in {_name} with ""
        set {_l} to length of {_name}
        set {_l} to {_l} parsed as integer
        send "&bArgument: &a%{_arg}% => %length of {_arg}%"
        send "&bVar: &a%{_name}% => %{_l}%"
        send "&bHashed Argument: &a%hashed {_arg}%"
        send "&bHashed Var: &a%hashed {_name}%"
        stop

All the method above isn't working.
I still have one more method, but I don't know the syntax.
Like this: set {_var} to first character after "&"
Can somebody help me?

add "&a", "&b", "&c", "&d", "&f", "&r", "&0", "&1", "&2", "&r", "&4", "&5", "&6", "&7", "&8" and "&9" to {_color::*}


replace every "" with "" in {_name}
 
Status
Not open for further replies.