#AutoDescription - i hate manually modifying strings

1 messages · Page 1 of 1 (latest)

frozen yacht
#

Basically a function which colors certain parts of your string automatically without needing to manually do that yourself, (probably) massively increases your productivity.
ex:
X5 -> {X:mult,C:white}X5{}

pretty much finished, though you will probably need to change the code to your own needs since idk, probably inefficient?

#

basically:

#

AutoDescription - i hate manually modifying strings

raw vessel
#

would it work with localization

frozen yacht
#

probably a bit unnecessary honestly

frozen yacht
raw vessel
#

would it work with nesting

frozen yacht
#

im a bit ashamed to say this but i have no clue what nesting means 😭

cedar flint
#

Something inside another thing, so having the inactive color and putting the Xmult box in the middle and then continuing with the inactive color

frozen yacht
#

oh

#

yeah, it can do that

frozen yacht
#

yeah nvm its 3 am

#

i will continue tmr 💀

rancid basin
#

Porting this as a website or tool may be nice for keeping consistent colour text for descriptions

frozen yacht
#

hmm true

frozen yacht
#

so basically, i think this should work, i added a lot of comment in there explaining most of the stuff i did so it should be easy to modify everything inside

#
function removeParts(b,replace)
    local partToRemove = {
        "{C:",
        "{X:",
        "{s:",
    } 

    if type(b) == "string" then    
        local finalStr = b            
        for _,part in pairs(partToRemove) do
            if string.find(finalStr,part) then
                local startPos = string.find(finalStr,part)
                local foundPart = findPart(finalStr,startPos,"}")
                finalStr = finalStr:gsub(foundPart,"")
            end
        end
        finalStr = finalStr:gsub("{}","")

        local startPos = 0
        if replace then
            for g = 1, #finalStr do
                local character = finalStr:sub(g,g)
                if character == "#" then
                    startPos = g
                    break
                end
            end

            finalStr = finalStr:gsub("#"..findPart(finalStr,startPos + 1,"#"),replace)
        end

        return finalStr
    end
end```
#

heres something i made on the side too lol

#

basically the exact opposite

#

im pretty new to this whole string manipulation stuff, so feel free to give feedback as to whats wrong in those

#

thats all tho, i aint working on this no more 😭

frozen yacht