Hi all,
I'm trying to determine if text provided as an argument to a command contains RGB color codes - in a relatively simple way and probably not super reliable, but all I really want to do is check if the text contains the &# characters in that order and if so remove the & characters from the text. I keep getting errors saying either my variable is not a location (it should be text..) or Invalid use of quotes. I've tried a bunch of different ways to test for this and I can't get any to work. This is one example of what I've tried:
This code gives me this error:
Invalid use of quotes ("). If you want to use quotes in "quoted text", double them: "".
Please help
[doublepost=1659728788,1659644670][/doublepost]Just FYI in case anyone comes across this, i sorted it out - I was sure I tried this but apparently not - i changed this line:
to this:
and it's all good; don't know why I couldn't find any mention of that in the documentation, though I can't find a lot of things in it so maybe I'm just dumb haha.
I'm trying to determine if text provided as an argument to a command contains RGB color codes - in a relatively simple way and probably not super reliable, but all I really want to do is check if the text contains the &# characters in that order and if so remove the & characters from the text. I keep getting errors saying either my variable is not a location (it should be text..) or Invalid use of quotes. I've tried a bunch of different ways to test for this and I can't get any to work. This is one example of what I've tried:
Code:
command /customrank <text>:
executable by: players
permission: rainbow.customrank
permission message: &cSorry! You don't have access to that command!
cooldown: 5 days
cooldown message: You last set your custom rank %elapsed time% ago, you need to wait %remaining time% before setting it again.
trigger:
set {newrank} to arg-1
set {amp} to "&#"
if "%{newrank}%" contains "%{amp}%":
replace all "&" in {newrank} with ""
make console execute command "/lp user %player% meta removeprefix 200"
make console execute command "/lp user %player% meta addprefix 200 &7[%{newrank}%&7]"
This code gives me this error:
Invalid use of quotes ("). If you want to use quotes in "quoted text", double them: "".
Please help
[doublepost=1659728788,1659644670][/doublepost]Just FYI in case anyone comes across this, i sorted it out - I was sure I tried this but apparently not - i changed this line:
Code:
set {amp} to "&#"
to this:
Code:
set {amp} to "&##"
and it's all good; don't know why I couldn't find any mention of that in the documentation, though I can't find a lot of things in it so maybe I'm just dumb haha.