NES

Once upon a time I came across Chris McVeigh’s awesome LEGO creations. I was curious to know how high the pure material cost of his NES was. Chris is nice enough to share the building instructions of his masterpieces, complete with the breakdown of parts numbers. Awesome! So, taking the NES instructions, I obviously wrote a little script that selects all the parts automagically on the LEGO Pick a Brick shop.

(function() {
    var a = [
        {id:407026,qty:5},{id:4558954,qty:2},{id:300426,qty:2},
        {id:306926,qty:2},{id:306826,qty:5},{id:4560182,qty:3},
        {id:302326,qty:8},{id:371026,qty:2},{id:302226,qty:4},
        {id:302126,qty:5},{id:4278359,qty:4},{id:265326,qty:2},
        {id:6074033,qty:2},{id:368026,qty:2},{id:486526,qty:3},
        {id:4560179,qty:3},{id:371021,qty:1},{id:306221,qty:8},
        {id:614121,qty:9},{id:4560181,qty:1},{id:614124,qty:1},
        {id:4558955,qty:3},{id:4211085,qty:1},{id:4210875,qty:1},
        {id:4210635,qty:6},{id:4211053,qty:2},{id:4560184,qty:2},
        {id:4211095,qty:2},{id:4211063,qty:1},{id:4211119,qty:4},
        {id:4543086,qty:8},{id:4211056,qty:3},{id:4210998,qty:3},
        {id:4210678,qty:2},{id:4211094,qty:4},{id:4211043,qty:2},
        {id:4211002,qty:4},{id:4211114,qty:2},{id:4210631,qty:4},
        {id:4211000,qty:9},{id:6004990,qty:14},{id:4211388,qty:3},
        {id:4211392,qty:3},{id:4211549,qty:8},{id:4211413,qty:2},
        {id:4560183,qty:7},{id:6014617,qty:1},{id:4211398,qty:1},
        {id:4515369,qty:2},{id:4211568,qty:8},{id:4211445,qty:2},
        {id:4211438,qty:1},{id:4535738,qty:2},{id:4211397,qty:8},
        {id:4211395,qty:1},{id:4211452,qty:3},{id:4211837,qty:1},
        {id:4211515,qty:6},{id:4619636,qty:6},{id:614101,qty:1}],
    b = function() {
        window.frames[0].addBrick(a[i].id,a[i].qty);
        i++;
        if(i<a.length) {
            setTimeout(b,2000);
        }
    },
    i=0;
    setTimeout(b,2000);
})();

It’s very simple because it relies on the website’s shopping cart’s addBrick function. This means that if LEGO changes its site, the script won’t work anymore. But that’s not very important I guess. Note that you can re-use the script for anything you want by changing the parts list. Here’s how you can run it:

Copy’n’paste the script into the JavaScript console and hit Enter

We end up with a total of $32.05. Chris sells his for $58.50. It seems more or less fair to me if you take into account that he has to handle your order, which is dumb and easy but takes time. He also deserves some royalties, I’m sure he spent hours creating the piece, setting up the building instructions and product page.

Happy building!