Thursday 16 April 2015

Book and Quill interlude

Too long I have been away from the world of Minecraft.  Always I intended to return, but the distractions of the real are many and not easily ignored.
Here I want to record the basics of how to acquire a Book and Quill, the basic of any magicians power.  For most inhabitants this will be trivial but for the untried Noob it might come handy as indeed it would have done for me on my return after my long absence.

The quickest path to acquire a book and quill foolows these steps:

  • Enter the world in Creative mode
  • Press 'e' to see your inventory.
  • Click on the compass icon to enter search mode
  • Type in 'book and quill' and the only item remaining in the display grid should be the 'Book and Quill'
  • Drag the 'Book and Quill' down into your inventory slots
  • Press 'ESC' to return to the game



When not in Creative mode you can craft a 'Book and Quill' from a 'Book' an 'Ink Sac' and a 'Feather'.  The details of this process and further details on how to craft a book and obtain 'Ink Sacs' and 'Feather' are best gained from the all powerful Oracle.

Having recorded this trivia to facilitate future absences and stray Noobs, I now hope to progress to start exercising my powers in the world

DigiMage

Tuesday 16 April 2013

The flow of power


Progress is at last significant.  I have been devoting myself to my studies, ignoring my duties, leaving those who depend on me to fend for themselves.  My studies have lost me both friends and future career prospects, but it has been worth it!  I am finally at the stage where I can bring the power of ScriptCraft to bear on the scripts in a Book and Quill object.


My beloved daughter, who helps me with my experiments in spite of her mothers objections, has created a Book and Quill object for me (I will get her to summarize how it was done in a future entry in this tome) and I managed to write the script "2+2" in it.  I have included an illustration of my success below.  This may seem like an insignificant formula, but by using ScriptCraft to transform this formula into the value 4, I have demonstrated the fundamental principles of the magic.  Thus, the power I have been seeking for all this time is within my grasp.

 










Now, for my coup de grace.  The incantation I found to work, after hours of pouring over ancient tutorials and aplication programming interfaces, was:

  /js eval(self.inventory.getItem(7).getItemMeta().getPage(1)+"")

This incantation, when entered into the Minecraft client, finds the players inventory (self.inventory) and gets the ItemStack for the 7th inventory slot.  I use this number because, as you can see in the illustration above, my book is in slot number 7 if you start counting from 0.  The getItemMeta() call gets the BookMeta object.  On that object, it then calls the getPage() method, passing the parameter 1, to get the first page.
That method is supposed to return a String that can be passed directly to the eval() method, but for some reason that does not work.  I managed to make it work by adding an empty String, i.e., the +"" part of the incantation, presumably forcing ScriptCraft to recognize that the previous expression is actually a String.

As you can see in the illustration below, this incantation has converted the formula in my book to the value 4.0!












The prospects of such power make me dizzy.  Next, I will try out some more advanced spells and hopefully be able to change the world, but I must now leave before the consequences of my absence removes me further from my studies of magic.  I shall return as soon as I have an opportunity.

Yours triumphantly,
 DigiMage

Saturday 13 April 2013

Books of magic

My research is leading me closer to my goal though my nights are now without sleep and my sustenance consists of such scraps of edible material as I can find throughout my abode.

I have found that, currently, magic is available only outside our world of Minecraft and complex spells must be brought into this world from an external file using the prompt as explained by the venerable Walter Higgins.  To allow magical scripts to persist in our world I will try to use a Book & Quill. With this I should be able to record and store the required scripts.

The next problem will be to bring the power of ScriptCraft to scripts stored in the Book & Quill objects.  My studies of ancient and deep ScriptCraft has led me to its ancestor JavaScript and the power word eval. This arcane incantation will apply the power of JavaScript to any string of letters. Now, if I can only make use of this knowledge in the world of Minecraft, I will have a way of casting the spells recorded in the Book and Quill objects.  Dear reader, please pray that this avenue will finally lead me to my goal.

Tiredness now overtakes me. I feel it's pull and I will have to give in before I can continue my studies. I hope to be able to return to this manual and report success before long.

From a place drifting between the world of Minecraft and the infinite dimension of the Internet,
Yours faithfully,
DigiMage



Friday 12 April 2013

The study of magic in Minecraft

In this tome I will record such experiences as I encounter in my study of magic.  Magic through the power of the ScriptCraft language in the world of Minecraft.

I hope to be able to create powerful Minecraft spells using this language and more than that, if successful, I hope to document here how you, dear reader, can become a magician like myself by learning to program.

For now, I'll seek the solitude required to emerge myself in the dark arts...

Yours obediently,
DigiMage