Rotsiser Mho

[Software] Brick Wizard: A tool for saving money on LEGO parts at BL

Recommended Posts

Hi everyone! Over the past 18 months I have been working on Brick Wizard: an app for OS X/Windows that helps save money on BrickLink orders by determining the least expensive combination of stores for a given parts/wanted list. It's inspired by the awesome MATLAB scripts written by atxdad but it's much, much faster and easier to use :).

Please comment on the Trello board if you'd like to suggest a feature or if you run into any problems! You can also track our progress there.

Brick Wizard

Brick Wizard consolidates BrickLink orders by taking a BrickStore inventory file and determining the least expensive combination of BrickLink stores that contain all LEGO parts in the inventory in the desired quantities. For example, if you wish to find the least expensive combination of stores from which to buy 100 red 2x2 bricks and 200 1x4 blue plates you would use BrickStore to add those parts to an inventory file and open it in Brick Wizard. The Wizard can then search BrickLink and find a combination of stores that have all 300 pieces at the lowest available price. The idea is to save money on large orders!

While a few other apps exist that perform a similar function, Brick Wizard has a C++11 back end that is many times faster than existing apps. In addition, it is the only app of its kind with a native UI on both Mac OS X and Windows. In the future, I hope to expand Brick Wizard and add features that LEGO fans have been clamoring for.

Please note that this is beta software and there may be bugs and there are certainly missing features. Bugs can be reported and features can be voted on at the Brick Wizard Trello board.

Using the Results

Once Brick Wizard has worked its magic, you will see a list of combinations and stores. The cost of each combination is displayed as well as buttons to create BrickLink wanted list XML. You will first need to create an empty wanted list in BrickLink for each store. Give it a name you can remember. Note the ID of the wanted list. For each store, click Create Wanted List... and enter the wanted list number given by BrickLink. Click Copy (or press Enter). Next, go to the BrickLink wanted list upload page. Paste the XML copied from Brick Wizard and click Verify Items. Next, click Upload File. Next, go to each store's page (Brick Wizard provides a link) and click Show All Items this store has on my Wanted List on the left side of the page. Select the wanted list you created before from the In: dropdown; click Go!. For each item, enter the quantity from the wanted list. Now you can click Add Selected Items to Shopping Cart. Finally, you can checkout!

BrickWizardResults.png

I hope you find this useful! Thanks for checking it out!

Edited by Superkalle

Share this post


Link to post
Share on other sites

Hmm, what sort of trouble? Would you mind emailing me the wanted list so I can look into it? brick.wizard [at] thebrickwizard.com. Thanks for trying it out!

Edited by Rotsiser Mho

Share this post


Link to post
Share on other sites

Hi and welcome to Eurobricks and the digital forum.

You could edit your first message and add some information, feture list and screenshots to introduce your software, and make this topic as reference for questions and issues.

Thanks for sharing your work.

Share this post


Link to post
Share on other sites

Thanks for the feedback. I've added a few more details and a screenshot. Please let me know if you have any other suggestions!

Edited by Rotsiser Mho

Share this post


Link to post
Share on other sites

Thanks, much better now!

About the software:

  • I read that Brick Wizard uses BrickStore and now BrickStock files. What about using bricklink XML to import lists?
  • It is limited to US stores, that is very... limiting! Do you think about a global support too?
  • I see from a screenshot above that you can decide how many shops to use for the order. Often users simply want to buy from less shops as possible, so what about an option to choose "less shops as possible with a reasonable total price"?

Share this post


Link to post
Share on other sites
  • I read that Brick Wizard uses BrickStore and now BrickStock files. What about using bricklink XML to import lists?

Hmm, how is BrickLink wanted list XML generally created? I looked around BrickLink and didn't see a way to export a wanted list in XML format. Could you give me an example of how you'd like this to work?

  • It is limited to US stores, that is very... limiting! Do you think about a global support too?

Absolutely! If you'd like to see support for other countries please vote for this feature on our Trello board!

  • I see from a screenshot above that you can decide how many shops to use for the order. Often users simply want to buy from less shops as possible, so what about an option to choose "less shops as possible with a reasonable total price"?

That's a tricky one. Each additional shop increases the time to find a solution exponentially. Also, it's difficult to define a reasonable price. Perhaps by default it could look for 3 or less shops sorted by total price and I can add a button to "try adding a shop to the combination" as it will take much longer to find a solution and generally you want fewer stores anyway as you said.

Thanks for your input! Please comment on the Trello board if you'd like any of these features added or if you run into any problems!

Share this post


Link to post
Share on other sites
Hmm, how is BrickLink wanted list XML generally created? I looked around BrickLink and didn't see a way to export a wanted list in XML format. Could you give me an example of how you'd like this to work?

There are various way to generate the Bricklink XML, unfortunately no one of them is officially provided by Bricklink.

Generate the Bricklink XML is very useful because often I need to send my wanted lists to some friend when he decided to place an order, so he can order for me these bricks available from the shop he choose for his purchase.

My favourite methods are:

- use this script: it works very fine, but I've some difficulties with the last releases of firefox.

- use this page: that allow me to easily create a list from a text file where I wrote space separated quantity, colour and brick-id. Example: "4 Black 3005" or "6 Light_Bluish_Gray 30162" (names of the colours are the same as bricklink and case sensitive and need undercore if composed by more words).

Edited by Calabar

Share this post


Link to post
Share on other sites

0.1.3 is now available. Highlights include drastically reduced memory usage (less than 100 MB, even for large numbers of combinations) and 2-6 times faster performance. A high-end computer (3GHz quad core) can process over a billion combinations in under 10 minutes.

0.1.3 Beta for OS X

0.1.3 Beta for Windows

There are various way to generate the Bricklink XML, unfortunately no one of them is officially provided by Bricklink.

Generate the Bricklink XML is very useful because often I need to send my wanted lists to some friend when he decided to place an order, so he can order for me these bricks available from the shop he choose for his purchase.

My favourite methods are:

- use this script: it works very fine, but I've some difficulties with the last releases of firefox.

- use this page: that allow me to easily create a list from a text file where I wrote space separated quantity, colour and brick-id. Example: "4 Black 3005" or "6 Light_Bluish_Gray 30162" (names of the colours are the same as bricklink and case sensitive and need undercore if composed by more words).

Thanks for filling me in. I've got support for BrickLink XML planned for the next release. You can track the progress on the Trello board.

Share this post


Link to post
Share on other sites

you are right,0.1.2 is out with support for BrickStock files along with some minor bug fixes.13.gif

Edited by hellhizhaos

Share this post


Link to post
Share on other sites

Brick Wizard 0.1.4 Beta has been released with international support!

New Features

  • Added support for all countries and currencies supported by BrickLink!
    • Stores are now filtered by the selected country to ship to
    • Prices are displayed in the selected currency

    [*]Preferences are automatically saved

    [*]Added support for importing BrickLink wanted list XML

    [*]Number of threads defaults to one less than the maximum to avoid inadvertently locking up the system

Bug Fixes

  • The number of stores per combination is now limited to the total quantity of items instead of the number of item entries. This allows for searching for large quantities of a single part.
  • Report more errors instead of simply crashing

0.1.4 Beta for OS X

0.1.4 Beta for Windows

Share this post


Link to post
Share on other sites

I'm now testing this program. I've never used it (I've always used Brickficiency), but who knows... Maybe it's faster :wink:

I do wonder, I'm using a quite a big parts list now, but BrickWizard knows after 1 second it can't find a solution? How does it know that so quick? Even with a 7 store combination selected.

Obviously it doesn't calculate any solution, it just knows it can't find a solution, but how?

EDIT: I've removed a very rare part and now it does calculate solutions. Why doesn't it calculate solutions with the rare part and just tells me there aren't any solutions?

Btw, it looks very fast now. Nice! And I like the estimated time remaining, althoug it is estimated :wink:

Share this post


Link to post
Share on other sites

Thanks for testing it out! Please note, someone discovered a bug in the country filtering algorithm and unfortunately it's still only sourcing parts from stores in the US. I am working on a fix.

Brick Wizard knows a solution can't be found if a given part is not available in any store. I suspect that's what happened with the inventory you tried using. It looks for such parts first because it would otherwise be very time-consuming to search only to find there are no solutions!

Share this post


Link to post
Share on other sites

Ah, that exlpains it. The rare part is available, just on in a store in the US.

It's quite useless for me if it's only calculating for stores in the US. I hope you can fix it quickly :grin:

Is it also possible to select only certain countries?

Share this post


Link to post
Share on other sites

Ah, that exlpains it. The rare part is available, just on in a store in the US.

It's quite useless for me if it's only calculating for stores in the US. I hope you can fix it quickly :grin:

Is it also possible to select only certain countries?

You are correct, there is a bug that is causing Brick Wizard to only look at stores in the US. Sorry about that! I am working on a fix and the ability to select a region/regions to consider.

Edited by Rotsiser Mho

Share this post


Link to post
Share on other sites

Brick Wizard 0.1.5 Beta is out with greatly improved international support! I hope this works for everyone. Please let me know if you spot any issues!

New Features

  • Added support for selecting regions to ship from
    • Stores are now filtered by the selected regions
    • Country in which store is located is displayed next to the store link

Bug Fixes

  • No longer limited to stores in the US!

0.1.5 Beta for OS X

0.1.5 Beta for Windows

Share this post


Link to post
Share on other sites

How would I limit my results to only stores in the USA and not Canada?

Update: 0.1.3 seems to be US-only, which is what I want. Perhaps for the next version, just have individual country checkboxes for from and to.

Edited by badbob001

Share this post


Link to post
Share on other sites

I don't know how you did it, but this app is many many many times faster than anything else out there (at least for up to 4 stores). The results are very slightly more expensive, so perhaps this is due to a calculation shortcut or just a different method.

Share this post


Link to post
Share on other sites

How would I limit my results to only stores in the USA and not Canada?

Update: 0.1.3 seems to be US-only, which is what I want. Perhaps for the next version, just have individual country checkboxes for from and to.

This is something I'm planning on incorporating in the next release :)

I don't know how you did it, but this app is many many many times faster than anything else out there (at least for up to 4 stores). The results are very slightly more expensive, so perhaps this is due to a calculation shortcut or just a different method.

Speed was my primary goal! I am surprised you are finding the results to be more expensive. Would you mind emailing me a BSX file that demonstrates this? Please send it to the support address on the website. Thanks!

Share this post


Link to post
Share on other sites

Does it requires NET Framework or any other library in Windows?

I tried to launch it but on a secondary PC the result was an error dialog telling it is not a win32 application.

About the country filter, please organize that in groups, so that it would be easy to select, for example, only the European countries with a single click (that is what I need ^___^ ).

Share this post


Link to post
Share on other sites

Thanks soo much

Now I can quickly find the best price for the parts I need for my MOC.

Could it be possible to have brickwizard get the shipping cost?

Does Bricklink show the shipping cost or does that have to be sent to the buyer in a message from the seller?

If it shows the shipping cost then brickwizard could get that and then tell the user what it is.

I know sounds hard but its nice to have.

Edited by SNIPE

Share this post


Link to post
Share on other sites

Does it requires NET Framework or any other library in Windows?

I tried to launch it but on a secondary PC the result was an error dialog telling it is not a win32 application.

About the country filter, please organize that in groups, so that it would be easy to select, for example, only the European countries with a single click (that is what I need ^___^ ).

Yes, Brick Wizard requires .NET Framework 4.0. Also, it requires a 64-bit version of Windows 7 or higher. Does your secondary PC have 64-bit Windows?

As for the country filter, the current version (0.1.5) allows for selection by regions. I assume that is what you prefer?

Thanks soo much

Now I can quickly find the best price for the parts I need for my MOC.

Could it be possible to have brickwizard get the shipping cost?

Does Bricklink show the shipping cost or does that have to be sent to the buyer in a message from the seller?

If it shows the shipping cost then brickwizard could get that and then tell the user what it is.

I know sounds hard but its nice to have.

Unfortunately, as you suspected, each BrickLink seller has different shipping policies making it impossible to predict shipping costs within Brick Wizard. However, BrickLink has plans to streamline shipping price calculations so this may be possible in the future.

Edited by Rotsiser Mho

Share this post


Link to post
Share on other sites

Can you say a little bit more about the exact algorithms you are using to do the calculation? In particular, I'm curious what assumptions you are making to prune that combination tree. TSPs are a particular area of interest to me, and I'm happy to see this application to LEGO and Bricklink being tackled a bit more efficiently.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.