#remove formatting from a string/text
1 messages · Page 1 of 1 (latest)
they should?
it doesnt
does it unformat "�" or "§#000000", or can it convert "�" to "§x§0§0§0§0§0§0"
because it wont remove the formatting from the first two
and i cant figure out, nor think there is a way to convert luckperms/essentials formatting to the default
i dont want to have to loop through the string and replace/place things manually, as that would be too difficult
use <##FFFFFF> and I think it will work
ok, i know that will, but players using /nick arent using that type of code, they use &#RRGGBB
i need a way to either convert &#RRGGBB to <#RRGGBB>, or just replace all instances of &#RRGGBB with ""
skript only supports <#RRGGBB> format for hex codes in text
unfortunately
Yeah the chat format
Probably beacuse of adventure api
If i remember correctly (not sure) it only supports
Chat format too
apparently the "send" effect supports the format §#RRGGBB, but nowhere else in skript
every other plugin i know of, uses the &#RRGGBB format
Have you thought of maybe splitting after #
yes, but it would split everything. so it would be "&#" and "RRGGBBTEXT"
its difficult because the RRGGBB can all be different things, and so can the input text
Hm
so its going to be extremely difficult to just simply replace the format with a new one
Is it like one time send?
where u cant actually save it
Temporary
Like just "<#FFFFFF> hello"
im executing when a player uses a command, making a blacklist for the string argument
i just need to remove all the color codes, and have the text by itself, no colors
so "&#RRGGBBTEXT" would need to become just "TEXT"
so i can scan the final text for the words
You use essentialsxchat? Or you made your own chat
It sounds like you made your own
and yes, that technically could work, but, if players seperate letters with colors, i cannot find wordsanymore
Beacuse i dont think players can send colors just like this
i cant find "TEXT" in &#RRGGBBTE&#RRGGBBXT
its for setting a custom luckperms prefix
im trying to detect if the luckperms prefix contains any slurs or staff titles
You could try and get 6 first values after #? But that could result in weird things if rgb was typed differently
Aka incorrectly for example
So as yoy said RRGGBB can be anything
i would need to get rid of all "&" and find 6 values after #, remove them, then remove "#"
just regex find and replace &#XXXXXX
i dont care about people typing it impropperly, because their nick would just be the messed up thing, since essentials woud just use the improperly formatted text anyways
how do i make it so it doesnt matter what the 6 numbers/letters are
I also need to detect IF the six numbers and letters are even a part of the hex code, because someone could just type “&# words”and it would remove all of it, and its not even formatted, because of the space
regexes. a bit wonky to learn at first though
&#[0-9A-Fa-f]{6} smth like this?
Just not sure how you could implement it in skript
reflect
Yeah probably, thought there was regex in skript
i think skbee text components also do a thing but its overcomplicated
replace [(all|every)|[the] first] %strings% with %string% in %strings% [with case sensitivity]
(replace [with|using] regex|regex replace) %strings% in %strings% with %string%
(replace [with|using] regex|regex replace) %strings% with %string% in %strings%
replace [all|every] %itemtypes% in %inventories% with %itemtype%
replace [all|every] %itemtypes% with %itemtype% in %inventories%``` saw that but idk how that regex works then
or in base skript, theres matches to check for a pattern, and there's replace as well
Ah
You mind helping me with it?
x8ight seems better at it than me
I need to replace occurrences of “&#xxxxxx” in a string variable
you can play around on regex101.com. I think there's some snippets in #skript-snippets as well that might detect colour codes
should be something like &#([\dA-Fa-f]){6} replaced with <##$1>
-# you can do a find & replace across ALL FILES in VS code. Just make sure you look at the preview to make SURE its correct otherwise you screw up dozens of files.
-# dont ask me how I know...
i just need it to execute on a command
ill keep this, im busy with smt else rn, so ill test it later
would this be in quotes
yes