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/cottage.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2012-12-27 13:55:05 +01:00
//
// need to use the drone module to create buildings easily
// it can be done using calls to putBlock(), putSign(), getPlayerPos() and getMousePos()
// but it's easier to use the Drone class
// $SCRIPT_DIR is a special javascript variable whose value is the directory where the
// current script resides.
// $SCRIPT is a special javascript variable whose value is the full name of the current script.
2012-12-27 13:55:05 +01:00
//
load($SCRIPT_DIR + "/drone.js"); // assumes cottage.js and drone.js are in same directory
2012-12-27 13:55:05 +01:00
//
// usage:
// [1] to build a cottage at the player's current location or the cross-hairs location...
//
// /js cottage();
//
// [2] to build a cottage using an existing drone...
//
// /js cottage(drone);
//
2012-12-27 14:11:26 +01:00
var cottage = function(drone)
{
2012-12-27 14:22:01 +01:00
if (typeof drone == "undefined"){
drone = new Drone();
}
drone.chkpt('cottage')
.box0(48,7,2,6) // 4 walls
2012-12-27 14:22:01 +01:00
.right(3).door() // door front and center
.up(1).left(2).box(102) // windows to left and right
.right(4).box(102)
.left(5).up().prism0(53,7,6);
2012-12-27 14:22:01 +01:00
//
// put up a sign near door.
//
drone.down().right(4).sign(["Home","Sweet","Home"],68);
2012-12-27 14:23:35 +01:00
return drone.move('cottage');
2012-12-27 13:55:05 +01:00
};
print ("loaded " + $SCRIPT);