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

[Help] Wanting to learn JS in order to make my own desired scripts

This stuff is really interesting to me, and I'd really like to learn but I don't really have the cash to pay for these online tutorials/courses and I don't even know where to start. I've taken a class on java before (yes, I know it's not the same thing) so I get some of the basics, but everywhere I can find online just teaches the same basics I know and then requires absurd payments to learn the rest. The biggest issue I have is that I'm mostly a learn by watching sort of person, so reading a big block of text explaining something doesn't do much for me. Any sort of guidance anyone can offer is welcome; links to tutorials and what not are very appreciated as well. Thanks for taking the time to read/reply.
1507520533
The Aaron
Pro
API Scripter
In a recent post, this was my advice to getting started: The Aaron said: It really doesn't matter what you choose to do first, it's all about learning. The API runs on top of Node.js, so if you're looking for more in the way of tutorials, reading about the way Node modules work is probably helpful (the whole "event driven" thing). However, I don't think you need to go overboard there. Javascript isn't as complicated as it seems and 3 hours is long enough to learn the basics of the language, enough to write some API Scripts. I would start by writing the following: • A script that parrots back whatever you pass it: This will give you the chance to learn about API commands and the chat:message event, which is probably the most used event. !say polly want a cracker? polly want a cracker? Then play with the formatting a bit. Make it whisper it to the person that ran the command. Add some header text like "The parrot says" to it. • A script that whispers to the GM how far a token moved. This will give you a chance to learn about change:graphic events, probably the other most used event. Start with just the x,y pixel distance, then add the name of the token, convert to the units of the current page, add the name of the character it represents, if any. If you want to get REALLY fancy, read the lastmove and calculate the actual distance based on the path. • A script that tells you if your roll is higher, lower or the same as your last roll This will give you the chance to get into persisting data and understanding the inlinerolls syntax, which is a bit complicated. !roll [[1d20]] 18 (no prior rolls) 7 (lower) 9 (higher) 9 (same) 20 (higher) Once you've run through those, you'll probably have a pretty good feeling for the parts of the API.
1507520787
The Aaron
Pro
API Scripter
Here's that above discussion: <a href="https://app.roll20.net/forum/post/5061355/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/5061355/slug%7D</a> Here's a thread where this was asked that has some great links for learning Javascript:&nbsp;&nbsp; <a href="https://app.roll20.net/forum/post/5283017/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/5283017/slug%7D</a>
1507561775
The Aaron
Pro
API Scripter
Another good discussion:&nbsp; <a href="https://app.roll20.net/forum/post/5402285/help-jus" rel="nofollow">https://app.roll20.net/forum/post/5402285/help-jus</a>...