Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <block>
- <head>
- <title>math.add</title>
- <inputs>
- int first, int second, int more ...
- </inputs>
- <outputs>
- int total
- </outputs>
- </head>
- <display>
- Add up the provided integers
- </display>
- <action>
- <script type="text/javascript" interface="BlueprinterModularJS">
- add = function() {
- this.db = {
- inputs: ["int first","int second"],
- outputs: {"int total":"adder"},
- },
- this.adder = function() {
- this.total = 0;
- for ( var i in this.db.__inputs ) {
- this.total += this.db.inputs(i);
- }
- this.db.outputs[0] = this.total;
- this.db.log( "Executed: " + this.total );
- return this.total;
- }
- }
- </script>
- </action>
- </block>
Advertisement
Add Comment
Please, Sign In to add comment