The ruby
command is handy, but often you’ll want to run code that’s too involved to write comfortably in a single line of text. For that, we have the tinker
command. The tinker
command lets you enter some code in a mini code editor on the web portal and then execute it in the game.
To change the tinker code:
tinker
to execute the code.Let’s make the tinker code say hello to us. Edit the tinker code as described above and make the handle
method look like this:
def handle
client.emit "Hello, #{enactor.name}!"
end
After saving, go back to your MUSH client (logged in with your coder character) and type tinker
. You should see: “Hello, Headwiz!” (or whatever your character’s name is.)
We’re going to continue using the tinker command for the remaining exercises in this tutorial. There’s a more in-depth Tinkering Tutorial if you want to learn more about tinkering when you’ve finished with the Quickstart.
{}
or missing end
statements.