Skip to content

Put example js file in classroom player directory.#264

Merged
walterhiggins merged 1 commit intowalterhiggins:masterfrom
CoderDojoStirling:classroom-example-file
Aug 29, 2015
Merged

Put example js file in classroom player directory.#264
walterhiggins merged 1 commit intowalterhiggins:masterfrom
CoderDojoStirling:classroom-example-file

Conversation

@greghuc
Copy link
Copy Markdown
Contributor

@greghuc greghuc commented Aug 12, 2015

What does this PR do?

This PR augments classroom-mode behaviour. When a new directory is created for a player, an example javascript file is now also created in this directory. The file is called "greet.js" and contains:

//Try running this function from Minecraft with: /js $username.hi( self )
//Remember to use your real username instead of $username!
//So if you had username 'walterh', you would run: /js walterh.hi( self )
exports.hi = function( player ){
    echo( player, 'Hi ' + player.name);
};

This filename and content match the example discussed in the classroom.js comments.

Why make this change?

We used Scriptcraft classroom-mode at CoderDojo Stirling with a bunch of enthusiastic but non-technical kids.

Setup was pretty challenging, as the kids had to wrap their heads round:

  • opening the samba-share of the remote players dir
  • copying a js file from their laptop into the remote player dir
  • opening, editing and saving this remote js file
  • running the js code from the minecraft client

Things went better the second time round, when we ensured there was a js file in-place in their remote player dir (i.e. this PR). So, setup became:

  • opening the samba-share of the remote players dir
  • opening, editing and saving the in-place js file in the remote player dir
  • running the js code from the minecraft client

Have you tested the change?

The change has been tested by hand for these cases:

  • Blew away remote player dir on minecraft server, logged in as new player, and ensured greet.js existed in remote player dir
  • Deleted greet.js from remote player dir, logged in as existing player, and ensured greet.js wasn't recreated.

Many thanks for Scriptcraft - it's awesome!

Cheers

Greg
CoderDojo Stirling

walterhiggins added a commit that referenced this pull request Aug 29, 2015
Put example js file in classroom player directory.
@walterhiggins walterhiggins merged commit e307904 into walterhiggins:master Aug 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants