This repository has been archived on 2021-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
scriptcraft/src/main/javascript/plugins/signs/examples.js

33 lines
887 B
JavaScript

var signs = require('./menu');
//
// Usage:
//
// In game, create a sign , target it and type ...
//
// /js var signExamples = require('./signs/examples');
// /js signExamples.testMenu()
//
exports.testMenu = signs
.menu("Dinner",
["Lamb","Pork","Chicken","Duck","Beef"],
function(event){
event.player.sendMessage("You chose " + event.text);
});
//
// This is an example sign that displays a menu of times of day
// interacting with the sign will change the time of day accordingly.
//
// In game, create a sign , target it and type ...
//
// /js var signExamples = require('./signs/examples');
// /js signExamples.timeOfDay()
//
exports.timeOfDay = signs
.menu("Time",
["Dawn","Midday","Dusk","Midnight"],
function(event){
event.player.location.world.setTime( event.number * 6000 );
});