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

[Script] NoteLog v0.1.2 -- Updated with inline roll expansion and multiline message adding!

1476643152

Edited 1476643216
The Aaron
Pro
API Scripter
NoteLog v0.1.2 This is an update on a previous small script I created. &nbsp;The update includes adding multiline text to the Log handout and expanding inline rolls. Commands: !note-log &lt;text&gt; Creates the Log handout in the journal if it doesn't exist already Adds the &lt;text&gt; to the end of the journal, prefaced with • . !note-text [{{] Some longer text [}}] Creates the Log handout in the journal if it doesn't exist already Adds the &lt;text&gt; to the end of the journal, preserving line breaks if you surrounded it in {{ }} . If you rename the Log handout, a new one will be created the next time you run !note-log . That makes it easy to archive prior notes. Additionally, you can freely edit the Log document if you want to add in notes between log events. Examples: Write a line of text to the log, prefaced by a bullet character (•): !note-log Went to save the queen from the castle, but found out she was really in another castle. Write the same line without the bullet: !note-text Went to save the queen from the castle, but found out she was really in another castle. Write a line of text to the log with a calculation, prefaced by a bullet character (•): !note-log Recovered [[1d6]] red gems worth 50gp each. Write multiple lines to the file: !note-text {{Today was a fine day for hunting. All told, we found: [[1d6]] rabbits [[2d6]] squirrels [[1d2]] deer Tomorrow promises to be even better! }} ( Note: that the above will have a trailing line break, leaving a blank line between it and the next note. &nbsp;If it ended in "even better!}}", it would not have the trailing line break and the next note would begin immediately on the next line.) GIT:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/No" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/No</a>... Support my work on If you use my scripts, want to contribute, and have the spare bucks to do so , go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free! Disclaimer: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
OOooooo very nice... do other people have access to this or just the GM?
1476650520
The Aaron
Pro
API Scripter
Only the GM in the current version, but I'm down for expanding it. What do you have in mind?
1476652095
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Very nice, if there was a way to keep the sandbox running between sessions, or have it start when players entered, this would be a great way for my group to write their own session logs (which we're doing now by having them email them to me, and then I post them on the table). This may be beyond the scope of what you want (in which case I'll probably steal your code to repurpose ;) ), but would you feel like adding the functionality to create the log as a text object on the vtt?
Great script, I'm sure to use this!
1476658333
The Aaron
Pro
API Scripter
Scott, how would you see that working?
1476666346

Edited 1476666925
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I started thinking about it and I think it might be better as a separate script. The way I can see doing it is you'd have a command to set the selected text object as the script's target which would then be saved in the state (since the whole point is to change the text of the text object, and there isn't a "name" property for text objects). When you set a text object as the target, you also can pass width/height parameters to lock it into a certain size. I need to play around with the text objects some, but I'm hoping that they support text wrapping if you set a size for them (it's not possible to do this through the default Roll20 interface). Possible features to add to the above (potentially also for journal entries): Font Specification Size Style bold/italics/strike headers/code/quote | Arial, patrick hand etc Color Highlighting(for journals) Create text object of given size centered on selected token/other object I think that's it. Like I said, might be better as a separate script just from the extra filtering for ID's and different text styles available in the two instances (actual fonts in text objects vs. header/normal/quote/code in journals) P.S. Possible syntax: !maptext[font: Arial &nbsp;size:12 color:#000000 width:140 height:140 generate ] Most of the above should be pretty self-explanatory, font size is in standard X-pt font, color is hex, width and height are in pixels, adding the generate keyword to the details would cause it to create a new text object centered on the selected object on the VTT (may or may not set the new text object as the script's stored text-target).
1476672817
The Aaron
Pro
API Scripter
I think I might add markdown support if there is interest. &nbsp;Also specifying the name of a handout to append to, and giving players the ability to log to granted handouts.
So this just stores information in a "note" logged into the API? Something you can call up again later?&nbsp; Interesting... Edit: Ah wait no, it automatically updates a Handout ? Mmm okay.
The Aaron said: Only the GM in the current version, but I'm down for expanding it. What do you have in mind? Some of my players like to keep a log of their experiences... so perhaps have @CharacterLog where each character has their own log. When they want to add something they can put it here. Would also be good if you use it with Call of Cthulu or something to keep track of everything for each character as like an Investigator log book.
Pord said: The Aaron said: Only the GM in the current version, but I'm down for expanding it. What do you have in mind? Some of my players like to keep a log of their experiences... so perhaps have @CharacterLog where each character has their own log. When they want to add something they can put it here. Would also be good if you use it with Call of Cthulu or something to keep track of everything for each character as like an Investigator log book. +1 for this!&nbsp; Did your previous version allow players to access it?&nbsp; Seems I remember using it and having a macro that all players could use and collaboratively add to the party Log.&nbsp; But it would be nice to be able to use this to add to individual logs as well.
1476699235
The Aaron
Pro
API Scripter
The previous version was also GM only. It's easily changed though, so perhaps you'd removed that restriction. I'll see what I can do about expanding this.&nbsp;
1476700206
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Slightly near topic.... Quotables. Sometimes I see a chat message that is too funny or important to let go... EVER. "!quote [target Aaron's token]" Gives me a clickable list of your last 3 chats... so I can save things like: The Aaron said: "Stephen, I was really wrong about that. I am truly sorry." The Aaron&nbsp;said: "Stephen, thank you for helping me with my script." The Aaron&nbsp;said: "Stephen,&nbsp;we would have died in the dungeon if not for you!" I click the one I want to save in my notes.
1476701399
The Aaron
Pro
API Scripter
Should it also generate quotations that would NEVER HAPPEN. =D That's a pretty good idea. &nbsp;
Stephen S. said: Slightly near topic.... Quotables. Sometimes I see a chat message that is too funny or important to let go... EVER. "!quote [target Aaron's token]" Gives me a clickable list of your last 3 chats... so I can save things like: The Aaron said: "Stephen, I was really wrong about that. I am truly sorry." The Aaron&nbsp;said: "Stephen, thank you for helping me with my script." The Aaron&nbsp;said: "Stephen,&nbsp;we would have died in the dungeon if not for you!" I click the one I want to save in my notes. Oh my god... This was the best...
Stephen S. said: Slightly near topic.... Quotables. Sometimes I see a chat message that is too funny or important to let go... EVER. "!quote [target Aaron's token]" Gives me a clickable list of your last 3 chats... so I can save things like: The Aaron said: "Stephen, I was really wrong about that. I am truly sorry." The Aaron&nbsp;said: "Stephen, thank you for helping me with my script." The Aaron&nbsp;said: "Stephen,&nbsp;we would have died in the dungeon if not for you!" I click the one I want to save in my notes. Hmmm, so I could compile all those whispers to the GM in one handy note?
The Aaron said: The previous version was also GM only. It's easily changed though, so perhaps you'd removed that restriction. I'll see what I can do about expanding this.&nbsp; I could see myself doing this.&nbsp; I've learned just enough in the past couple years to really mess things up.&nbsp; :)
1476729056
The Aaron
Pro
API Scripter
Ha!
Stephen S. said: Slightly near topic.... Quotables. Sometimes I see a chat message that is too funny or important to let go... EVER. "!quote [target Aaron's token]" Gives me a clickable list of your last 3 chats... so I can save things like: The Aaron said: "Stephen, I was really wrong about that. I am truly sorry." The Aaron&nbsp;said: "Stephen, thank you for helping me with my script." The Aaron&nbsp;said: "Stephen,&nbsp;we would have died in the dungeon if not for you!" I click the one I want to save in my notes. I would LOVE this! Honestly. By the way, The Aaron, the script throws a `SyntaxError: Unexpected token )` when I try to save it. Trying to find out which other script it's interfering with.
1476732504
The Aaron
Pro
API Scripter
Hmmm... good luck. =/ &nbsp; &nbsp; You can try adding ; to the beginning and end of each of your scripts. &nbsp;Concatenation order seems to be unpredictable so adding and removing a script can completely change where a problem happens.
Yeah, I know... unfortunately. I'm trying to disable other scripts to find the culprit. Doesn't seem to do the trick, though.&nbsp;
1476734170
The Aaron
Pro
API Scripter
But disabling this one does?
Yes, as soon as I disable this one, the sandbox starts up just fine.
Ok, fixed it. It seems that it was some whitespace issue. When I c&p the raw code from github directly, then it throws an error. If I c&p it into a texteditor window and then c&p it into roll20, then it works just fine.&nbsp; Odd.
1476736308

Edited 1476736328
The Aaron
Pro
API Scripter
Ah. &nbsp;I bet it was expanding the '&amp;bullet;' to something like '•' and that was for some reason causing an issue. &nbsp;I've had that problem in the past with copying the raw file. &nbsp;usually I write it as '&'+'bullet;' for exactly that reason.
Ah, could be. Next time I should just go for cloned repo directly, but I was too lazy to dig through my folders...&nbsp;
1476740708

Edited 1476740808
Gold
Forum Champion
I might try adding this to my monster-death macro (clicked to put the red-X status, and a bleeding FX, when the players kill a monster), so that it would automatically keep a long-running list in a Handout of every monster/enemy that is defeated. This should work with the macro code that shows the selected| monster's name , right?
1476742264
The Aaron
Pro
API Scripter
yup. &nbsp;That gets expanded on the client side.
Hey, if I add a way to specify the currently targeted handout by name and it's not crappily written will you accept the pull request or should I just fork it?
1476843760
The Aaron
Pro
API Scripter
I'm happy to accept pull requests, though I'm fairly likely to rewrite rather than merge.&nbsp;