This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var teleport = require('teleport'), | |
arrowsport = {}, | |
handler; | |
function onArrowHit( event ) { | |
var projectile = event.projectile, | |
shooter = projectile.owner, | |
cmArrow = Packages.net.canarymod.api.entity.Arrow, | |
cmPlayer = Packages.net.canarymod.api.entity.living.humanoid.Player, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sounds = require('sounds'); | |
function howl(event){ | |
sounds.wolfHowl(event.block); | |
} | |
events.blockDestroy(howl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Drone = require('drone'); | |
var blocks = require('blocks'); | |
function skyscraper( floors ) { | |
var i = 0; | |
if ( typeof floors == 'undefined' ) { | |
floors = 10; | |
} | |
this.chkpt('skyscraper'); | |
for ( i = 0; i < floors; i++ ) { | |
this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global require, events */ | |
var blocks = require('blocks'), | |
sounds = require('sounds'); | |
function bounceOn___(event){ | |
var player = event.player; | |
var bounce = 0.75; | |
var location = player.location; | |
// need to convert coordinates to integers | |
var x = Math.floor(location.x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global require, events */ | |
var blocks = require('blocks'), | |
sounds = require('sounds'); | |
var bouncers = {}; | |
function bounceOn___(event){ | |
var player = event.player; | |
var id = player.ID; | |
var bounce = bouncers[id] || 0.75; // get bounciness (default 0.75) | |
var location = player.location; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mqtt = require('sc-mqtt'), | |
slash = require('slash'), | |
client = mqtt.client('tcp://localhost:1883','sc-ard-light'), | |
preDawn = 22000, | |
JavaString = java.lang.String; | |
client.connect(); | |
client.subscribe('arduino-light'); | |
var max = 0; | |
function updateTime(topic, message){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bounceOnSponge(event){ | |
var player = event.player; | |
var location = player.location; | |
// need to convert coordinates to integers | |
var x = Math.floor(location.x); | |
var y = Math.floor(location.y - 1 ); // what's underfoot? | |
var z = Math.floor(location.z); | |
var block = location.world.getBlockAt(x, y, z); | |
if (block.typeId === blocks.sponge){ | |
player.motionY = 2; // springs player high into air |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/*global require, events, server, Packages*/ | |
var slash = require('slash'); | |
slash([ | |
'groupmod permission add visitors canary.world.build', | |
'groupmod permission add visitors scriptcraft.evaluate' | |
],server); | |
/* | |
WARNING: The following code makes all players ops. | |
Only use this for local servers . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scriptcraft/plugins/tutorial-world.js | |
/*global echo, require, isOp,setTimeout, persist */ | |
var Drone = require('drone'), | |
utils = require('utils'), | |
_ = require('underscore'), | |
firework = require('fireworks').firework, | |
blocks = require('blocks'); | |
/* | |
construct an array of colored blocks to make a | |
mario-cart-like rainbow road |