Jump to content
  • 1

gg.copyText() not copying spaces ..?


Question

Posted

I recently made a script that would take some data from RAM and make it readable. It uses gg.copyText() function to copy that data in the following chunk:
 

            printRes = tostring(getTune1[1].value + 1) .. "/" .. tostring(getTune2[1].value + 1) .. "/" .. tostring(getTune3[1].value + 1) ..
                        "/" .. tostring(getTune4[1].value + 1) .. "\n" .. strPart1 .. "-" .. tostring(getPartTune1[1].value) ..
                        " " .. strPart2 .. "-" .. tostring(getPartTune2[1].value) .. " " .. strPart3 .. "-" ..
                        tostring(getPartTune3[1].value) .. "\nBy :flag_" .. strFlag .. ":" .. strName .. "\nusing " ..
                        strVehicle .. "\nIn " .. strMap .. "\non 20" .. strDate .. "\nWith a time of: " ..
                        tostring(getTime[1].value) .. " seconds\n\n"

            collectTune = gg.alert(printRes, "Continue", "Copy the tune")
            if collectTune == 1 then
                return 0
            else
                gg.copyText(printRes)
            end

now I did assume that it was an issue with me assigning it to a variable and then copying the variable but that didn't seem to be the problem as it still didn't copy the spaces. Attached is what I got displayed in the gg.alert() function which seems to be completely fine and have all the spaces needed. Following text is what I received to my clipboard after pressing "Copy the tune" button in the alert function:

20/20/10/20
winter_tyres-15start_boost-10nitro-4
By:flag_fi:RS3113
usingsuperbike
Indark_roads_cup_03_04
on2024_2_february
Withatimeof:9.55695629119873seconds

I couldn't find any explanation anywhere.

image_2024-02-16_225053680.png

3 answers to this question

Recommended Posts

  • 0
Posted
On 2/17/2024 at 1:27 AM, MonkeySAN said:

try this..

...
gg.copyText(printRes,false)

 

Worked well, didn't know this was a thing. Thanks!

  • 0
Posted
On 2/16/2024 at 10:52 PM, Wembbu said:

I recently made a script that would take some data from RAM and make it readable. It uses gg.copyText() function to copy that data in the following chunk:
 

            printRes = tostring(getTune1[1].value + 1) .. "/" .. tostring(getTune2[1].value + 1) .. "/" .. tostring(getTune3[1].value + 1) ..
                        "/" .. tostring(getTune4[1].value + 1) .. "\n" .. strPart1 .. "-" .. tostring(getPartTune1[1].value) ..
                        " " .. strPart2 .. "-" .. tostring(getPartTune2[1].value) .. " " .. strPart3 .. "-" ..
                        tostring(getPartTune3[1].value) .. "\nBy :flag_" .. strFlag .. ":" .. strName .. "\nusing " ..
                        strVehicle .. "\nIn " .. strMap .. "\non 20" .. strDate .. "\nWith a time of: " ..
                        tostring(getTime[1].value) .. " seconds\n\n"

            collectTune = gg.alert(printRes, "Continue", "Copy the tune")
            if collectTune == 1 then
                return 0
            else
                gg.copyText(printRes)
            end

now I did assume that it was an issue with me assigning it to a variable and then copying the variable but that didn't seem to be the problem as it still didn't copy the spaces. Attached is what I got displayed in the gg.alert() function which seems to be completely fine and have all the spaces needed. Following text is what I received to my clipboard after pressing "Copy the tune" button in the alert function:

20/20/10/20
winter_tyres-15start_boost-10nitro-4
By:flag_fi:RS3113
usingsuperbike
Indark_roads_cup_03_04
on2024_2_february
Withatimeof:9.55695629119873seconds

I couldn't find any explanation anywhere.

image_2024-02-16_225053680.png

I was running around in circles and then I searched and found this ☠️

 

On 2/17/2024 at 1:27 AM, MonkeySAN said:

try this..

...
gg.copyText(printRes,false)

 

Thx a lot 🍀

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.