Giter Site home page Giter Site logo

der20's Introduction

der20

Roll20 API Scripts with shared library code in TypeScript

User Info

Installation

For each plugin you want to use, go to https://github.com/derammo/der20/releases and download EITHER

  • der20_library.js (unless you already have it from another plugin) AND the specific plugin you want to use, such as der20_rewards_plugin.js

OR

  • the complete self-contained script, such as der20_rewards_complete.js, which will be a much larger file than the corresponding plugin

Install all *.js files as separate scripts in the Roll20 API Console. Only install one copy of der20_library.js. The order of scripts does not matter, but plugins will fail to start until the library is installed.

The command reference for all plugins is at https://derammo.github.io/der20

Developer Info

This is a framework for making many Roll20 scripts from a common code base in TypeScript. TypeScript source files compile down to a monolithic JavaScript file for each Roll20 script. The monolithic files that are self-contained contain a tiny AMD loader so they can load into an anonymous scope in Roll20.

The same sources are also compiled into an additional format, with all the library sources under src/der20 compiled into one Roll20 API Script called der20_library.js and each plugin under src/plugins/* compiled into a small Roll20 API Script named der20_*_plugin.js that requires der20_library.js to also be installed into the Roll20 API script host. Either format can be used and contains the same code, with the library+plugin format being far more readable in terms of the compiled code.

All Roll20 scripts are found in dist/* after building. To add a new plugin, add the name to the PLUGINS variable in Makefile, and place sources under src/plugins/NAME/*.ts . The configuration file src/plugins/NAME/tsconfig.json will be generated by make.

Executable scripts without the Roll20 wrapping are found in build/* after building. These can include scripts (EXECUTABLES variable in Makefile) that run locally. For an example, see src/executables/parser_test/*

Outside Roll20, code can be referenced from testing executables and run under Node.js for local debugging. This project will not duplicate the effort of "Mock20" and so there is no local emulation of Roll20 functions. Instead, functionality is written in a generic way so it only becomes dependent on Roll20 for final presentation of dialogs etc.

Currently, local testing of individual dialogs can be done in a browser. See test/show.html for an example.

Please contact derammo for creating a release. The tools required are included in the Makefile, but please don't do it :)

Requirements: Node.js, npm, GNU Make

Installation: 'make'

der20's People

Contributors

derammo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

palikhov

der20's Issues

implement command abbreviations

typing '!rewards def m foo u bar t 2' should display '!rewards define module foo unlock bar tier 2' and execute that command. This can be done by expanding the 'rest' variable in 'context' every time the parser matches an abbreviated token. We have to consider keyword meta data, but we can safely expand rest with a regular expression substitution, since none of it has been parsed yet, by definition.

[anonymous] error: Cannot read property 'isNpc' of undefined on: !anonymous set

TypeError: Cannot read property 'isNpc' of undefined
at SetCommand.handleToken (der20_anonymous.js:1136:27)
at SetCommand.parse (der20_anonymous.js:555:31)
at Function.parse (der20_anonymous.js:670:38)
at Function.parse (der20_anonymous.js:700:46)
at Plugin.dispatchCommand (der20_anonymous.js:1986:59)
at Task.work.scheduleWork [as work] (der20_anonymous.js:2021:34)
at PromiseQueue.run (der20_anonymous.js:1451:41)
at PromiseQueue.schedule (der20_anonymous.js:1433:22)
at PromiseQueue.scheduleWork (der20_anonymous.js:1412:18)
at message (der20_anonymous.js:2020:35)
command executed: !anonymous set

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.