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

How do I actually USE scripts with the API?

Hi all, I've just recently got access to the API, thinking it would make running games easier. However, I haven't found any instructions on just how to use it. the Help stuff talks about programming scripts but not about how to actually start them up in a game. For example, I found a Pathfinder Character sheet script here on the forums which seemed to pass the consensus as good. So I copied it to the API console thing. But how do I use it in the actual campaign? Is there a command word I need to type? How do I attach it to a particular character/player? Any help would be appreciated.
1387890303
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
[SCRIPT] Pathfinder Character Sheet Generator v3 Is it that one? the lead post provides: "To assign a specific class to a character, use !skill charname chartype, !skill Llharian bard," But you can also look through the code: on("ready", function() { on("add:character" , function(char) { bigmike.processAttribs(char); bigmike.processSkills(char, 'all'); bigmike.processAttack (char); }); on("chat:message", function(msg) { var chatCmd = bigmike.parseCommand(msg); if (typeof chatCmd === 'undefined') { return; } sendChat('System', 'Setting class ' + chatCmd.charType + ' for ' + chatCmd.charName); var characters = findObjs({ _type: "character", archived: false, name: chatCmd.charName }, {caseInsensitive: true}); _.each(characters, function(character) { log("Name: " + character.get("name")); log("Bio: " + character.get("bio")); log("GM-Notes: " + character.get("gmnotes")); log("Archived: " + character.get("archived")); log("In player journals: " + character.get("inplayerjournals")); log("Controlled By: " + character.get("controlledby")); bigmike.processSkills(character, chatCmd.charType); }); }); }); You looking for the "on" stuff.... on("ready" .... When things load up do this stuff on("add:character".... When a character is added do this stuff. on("chat:message" .... When chat is sent do this stuff.
Yes that's the Character sheet script I was wanting to use. So to use a script I have to type '!something'? And stuff that says 'on:something' is done automatically ?
1387900193
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
If you add a new character sheet... it should auto populate.... And to assign a specific class you would write "!skill Llharian bard" (where Llharian is the charcater name and bard is the class) in the normal chat pane where you would do dice rolls and such.
1387902132
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Also invite me to your campign sometime and we can look at it in action.
This is good stuff, Stephen. When I ran a Neverwinter Night server, I taught a bunch of people the Aurora Scripting, over a series of months. That plus that one guy's script tool, made it pretty cool, and a lot of work, but fun.