Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

issue with the "gmnote" tag?

hi guys, I was trying to make a script that will send a message to the players when someone got close to a chest. The contents of the message was supposed to be the contents of the GM notes, but when it reads the GM notes, it wont use non-alphanumeric digits. EG: a space turns into %20, a comma turns into %2C. Is this an error, or am I maybe doing something wrong? Here is what I have for code: on("change:graphic", function(obj){ sendChat("GM Notes", obj.get("gmnotes")) })
The behavior you are encountering is not unusual. This just means that when the gmnotes section is read, it's converting some characters into their HTML/URL codes, as explained here . The reason for this, however, is beyond my initial thoughts. I would try either: 1) using the /direct command in the sendChat to see if that stops the encoding and sends it in a more human readable fashion. 2) if (1) doesn't work, going through and reconverting the text based on the HTML character codes found here after a quick google search. best of luck :)
There's currently a bug where "notes" and "gmnotes" fields aren't functioning properly. It's on my to-do list to get it fixed. It's been broken since Rugged Reroll came out a few weeks ago.
Ok, thank you bith for your answer! i will wait for the next update and try again.
I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",")
1391070595
Alex L.
Pro
Sheet Author
Matt said: I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",") You could just do a string replace it would be far more efficient.
Matt said: I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",") Thanks Matt, that worked perfectly! Alex L. said: Matt said: I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",") You could just do a string replace it would be far more efficient. Alex, I tried a string.replace line, but it only replaced the first occurance of it.
1391152853
Alex L.
Pro
Sheet Author
Stephane G. said: Matt said: I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",") Thanks Matt, that worked perfectly! Alex L. said: Matt said: I read a comma-delimited string from my GM Notes field, and use the following bit of code to 'correct' the commas, should work for spaces as well? obj.get("gmnotes").split("\%2C").join(",") You could just do a string replace it would be far more efficient. Alex, I tried a string.replace line, but it only replaced the first occurance of it. obj.get("gmnotes").replace(/\%2C/g,",");
Thanks. I had the same issues with replace, which is why i resorted to split/join. Appreciate the info.