A Challenge to Coders: Argent Dawn Writ Calculator

Helps with Argent Dawn's "Craftsman's Writ" quests

Moderator: Rihlsul

A Challenge to Coders: Argent Dawn Writ Calculator

Postby Rihlsul » Mon Jul 24, 2006 9:58 am

So, I was thinking about the powers of Roster while I was looking at a stack of Argent Dawn writs in my backpack. I have a list of things like "4 Gnomish Battle Chickens" and "10 Major Mana Potions".

Now, my next to-do would be to go to our guild roster, and build a list of ingredients of all the different things I need to gather to fulfill the writs I have. This got me thinking:

Wouldn't it be cool if an add-on existed in WoWRoster called Writ Calculator? All it would need is a list of known writs. The user would then check off which writs they have and hit 'Calculate'. Based on the known items in the writs, it'll check the db for the ingredients, parse it out per writ checked of, finally producing a long list of the base materials needed.

In my example of Battle Chickens, a db might know (and might not, just return 'Not found') that a single Gnomish Battle Chicken takes:

1 Mithril Casing
6 Truesilver Bar
6 Mithril Bar
2 Inlaid Mithril Cylinder
1 Gold Power Core
2 Jade

If we parse that again to see if any of these items are recipie items, we see:

1 mithril casing takes 3 mithril bars
1 Inlaid Mithril Cylinder takes 5 mithril bars, 1 gold bar, and one truesilver bar
1 gold power core takes 1/3 gold bar

So, to make 1 gnomish battle chicken, it should list the following raw ingredients (sequence unimportant):

13 Mithril Bars
8 Truesilver Bars
3 gold bars (always round up!)
2 Jade

So, to fulfill the Writ of 4 Gnomish Battle Chicken, this Writ Calculator would display to the user:

52 Mithril Bars
32 Truesilver Bars
10 Gold Bars (remember, 0.3 gold bar for a power core, so 9.2 are needed, but we round up)
8 Jade

I can easily help with the logic and populating the Writ data into something (table, array, whatever), but I don't know php well enough to just write this bugger on my own.

Anyone who is savvy to PHP and WoWRoster interested in picking up this gauntlet of coding challenge? :pirate:
Rihlsul,
Guild Leader of The Dirty Hordes
User avatar
Rihlsul
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 125
Joined: Tue Jul 04, 2006 8:27 pm

A Challenge to Coders: Argent Dawn Writ Calculator

Postby nightfighter » Mon Jul 24, 2006 11:12 am

In accounting they call this Bill of Materials. The biggest problem I see with what you are talking about here is the recipes are not broken out into records that list the items and quantities that are needed, they are strings in a field in a database.
User avatar
nightfighter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 169
Joined: Wed Jul 05, 2006 11:25 pm
Location: Boise, Idaho, USA

Re: A Challenge to Coders: Argent Dawn Writ Calculator

Postby Rihlsul » Mon Jul 24, 2006 4:39 pm

Yup. I work with MRP/MPS (manufacturing) systems for a living. It was thinking about the fact that I could do this in minutes in the systems I use daily that made me wish for this tool (what I'm describing is a multi-level BOM pick list ;p).

The perk here is that the formatting is nice and even. Each reagent in the string is delimited by a "<BR>" and follows a uniform "[Item] x[Qty]" pattern, even if only 1 is required.
Rihlsul,
Guild Leader of The Dirty Hordes
User avatar
Rihlsul
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 125
Joined: Tue Jul 04, 2006 8:27 pm

Re: A Challenge to Coders: Argent Dawn Writ Calculator

Postby Rihlsul » Tue Jul 25, 2006 2:32 am

Nevermind. I've completed it. PHP n0.0b power!

I'll link to the add-on download later this evening.

Feel free to look:

http://www.ironcladgathering.com/roster ... e=writcalc

See if you can break it or spot obvious errors now.
Rihlsul,
Guild Leader of The Dirty Hordes
User avatar
Rihlsul
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 125
Joined: Tue Jul 04, 2006 8:27 pm


Return to Writ Calculator

Who is online

Users browsing this forum: No registered users and 1 guest

cron