Recipe Calculator

Calculates how many raw items you need for x amount of crafted items

Moderator: Averen

Recipe Calculator

Postby Averen » Mon Jul 31, 2006 9:08 pm

Well if you've seen the Writ Calculator by Rihlsul (Cheers to him for the tip on reagents!) then you might guess what this is.

It basically calculates how many raw items you need for x amount of crafted items.

It is not completely finished but finished enough for you lot to test it out. If you go here to my test roster you can find it by going to "Made By" or by going to the "Recipes" section for a particular character and clicking the name of the item you'd like to calculate for. Have a little play around and tell me your suggestions/comments/bugs you've found etc.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Recipe Calculator

Postby Rihlsul » Wed Aug 02, 2006 5:33 am

That's pretty slick. I'll admit I didn't get it at first that I was to click on the recipe name to bring up the calculator.

Might be interesting to see it work akin to the Shopping add-on (possibly with some later ties to such, but would *have* to be optional "Copy to Shopping Cart" functionality), where you can add to your "Shopping List", then in the list, edit the Qty.

That'd be a huge hit, I'll wager.

:thumright: Continued nice work Averen!
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: Recipe Calculator

Postby foreseit » Fri Aug 25, 2006 2:09 am

looks good! I'm gonna install it and see how it goes. :)
User avatar
foreseit
WR.net Journeyman
WR.net Journeyman
 
Posts: 139
Joined: Tue Jul 25, 2006 10:03 pm

Recipe Calculator

Postby foreseit » Fri Aug 25, 2006 4:54 am

wait. it's not available for download? :( I'd like to install it... lol. :)
User avatar
foreseit
WR.net Journeyman
WR.net Journeyman
 
Posts: 139
Joined: Tue Jul 25, 2006 10:03 pm

Recipe Calculator

Postby Averen » Fri Aug 25, 2006 12:59 pm

Haha, no one ever seemed to be very bothered about it so I never released it. I'll just sort out an installation file then I'll upload it for you.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Recipe Calculator

Postby Averen » Fri Aug 25, 2006 2:57 pm

Here it is.

Recipe Calc

Just unzip that and pu it in your addons directory.

On it's own it does nothing as nothing links to it.

To make recipes on a characters page open the calculator.

Open lib/recipes.php
Find
Code: Select all

    
function out()
 

Replace with
Code: Select all

    
function out($link=null)
 


Find
Code: Select all

        $returnstring 
.= '<a href="'.$itemlink[$roster_conf['roster_lang']].urlencode(utf8_decode($this->data['recipe_name'])).'" target="_itemlink">'

Replace with
Code: Select all

        
if($link !== null){
        
$link $link;
        
$target '';
        } else {
        
$link $itemlink[$roster_conf['roster_lang']];
        
$target '_itemlink';        
        }
        
$returnstring .= '<a href="'.$link.urlencode(utf8_decode($this->data['recipe_name'])).'" target="'.$target.'">'


Open lib/char.php
Find
Code: Select all

                $returnstring 
.= $recipe->out();
 

Replace with
Code: Select all

                $returnstring 
.= $recipe->out('addon.php?roster_addon_name=recipecalc&recipeid=');
 


Find
Code: Select all

    
<td class="membersRow'.$stripe.'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></td

Replace with
Code: Select all
    <td class="membersRow'.$stripe.'"><a href="addon.php?roster_addon_name=recipecalc&recipeid='.urlencode(utf8_decode($recipe->data['recipe_name'])).'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></a></td

Done.

To make links on the "Made By" pages point to the calculator.

Open addons/recipe/RecipeList.php
Find
Code: Select all

            $thottURL
='<a href="http://www.thottbot.com/index.cgi?i='.
            
str_replace(' ''+',$recipe->data['recipe_name']).'" target="_thottbot">'

Replace with
Code: Select all

            $thottURL
='<a href="addon.php?roster_addon_name=recipecalc&recipeid='.
            
str_replace(' ''+',$recipe->data['recipe_name']).'">'


Find
Code: Select all
                $content .=  $recipe->out(); 

Replace with
Code: Select all
                $content .=  $recipe->out('addon.php?roster_addon_name=recipecalc&recipeid='); 


Find
Code: Select all
                $content .=  $table_cell_start.'&nbsp;<span style="color:#'.substr$recipe->data['item_color'], 2).';">'.$recipe->data['recipe_name'].'</span>&nbsp;</td>'

Replace with
Code: Select all
                $content .=  $table_cell_start.'&nbsp;<a href="addon.php?roster_addon_name=recipecalc&recipeid='.
                
str_replace(' ''+',$recipe->data['recipe_name']).'"><span style="color:#'.substr$recipe->data['item_color'], 2).';">'.$recipe->data['recipe_name'].'</span></a>&nbsp;</td>'


Tada finished.
Last edited by Averen on Tue Sep 05, 2006 7:42 pm, edited 3 times in total.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Recipe Calculator

Postby Nenaisu » Sun Sep 03, 2006 11:23 pm

Hi,

I'm testing you Calculator I have a German Roster and try to bring it to work.

first thing to add, localisation.lua:

$wordings['deDE']['title'] = 'Rezept Kalkulator';

$wordings['deDE']['itemdescription'] = 'Beschreibung:';
$wordings['deDE']['whocanmakeit'] = 'Wer kann es herstellen';
$wordings['deDE']['dnotpopulatelist'] = 'Nicht in Liste';
$wordings['deDE']['applybutton']= 'Start';

I will post the rest wen I got it working.
Image
User avatar
Nenaisu
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Fri Aug 04, 2006 2:40 am
Location: Germany

Recipe Calculator

Postby Averen » Mon Sep 04, 2006 1:05 am

Cheers, I have been told the installtion instructions do not work. I'll check it out. Sorry it wasn't sooner I have been away.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Recipe Calculator

Postby Nenaisu » Mon Sep 04, 2006 3:24 pm

I couldn't find the reason why it's still not working on our page. I have no coding experiance so I will be glad if you can tell me whats wrong :)

If you need german translations I'll like to help you (as you see my german ist much better than my english ;) )
Image
User avatar
Nenaisu
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Fri Aug 04, 2006 2:40 am
Location: Germany

Recipe Calculator

Postby Averen » Tue Sep 05, 2006 7:45 pm

Ok instructions are fixed! Sorry for the long wait I've been extremely busy.

I've also edited the mod a little too.

Here.

Any suggestions and localisations (I change localisation file slightly) are very much welcome :).
Last edited by Averen on Tue Sep 05, 2006 7:59 pm, edited 2 times in total.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Recipe Calculator

Postby Nenaisu » Tue Sep 05, 2006 9:40 pm

When its welcome here the new localisaton:

Code: Select all
$wordings['deDE']['title'] = 'Rezepte Rechner';

$wordings['deDE']['itemdescription'] = 'Beschreibung:';
$wordings['deDE']['whocanmakeit'] = 'Wer kann es herstellen';
$wordings['deDE']['dnotpopulatelist'] = 'Nicht in Liste';
$wordings['deDE']['applybutton']= 'Start';
$wordings['deDE']['recp_not_exist']= 'Sie haben ein nicht existierendes Rezept ausgewählt, bitte versuchen sie es erneut';
$wordings['deDE']['recp_not_exist_title'] = 'Rezepte Rechner - Rezept existiert nicht';
$wordings['deDE']['recp_calc'] = 'Rechner';
$wordings['deDE']['recp_amount'] = 'Menge';
$wordings['deDE']['recp_reagent'] = 'Reagenz';
$wordings['deDE']['recp_reagents'] = 'Reagenzien';
$wordings['deDE']['recp_count'] = 'Berechnung';


I changed my char.php, recipe.php and recipeList.php as mentioned above.

With recipe Addon it will start the Calculator with Recipe overwiev in Character it will not start.

When in Calculator I could not calculate the Recipes.

In Headline the Error is:

Notice: Undefined offset: 1 in /home/www/web502/html/wowroster/addons/recipecalc/recipecalc.php on line 296

here the link to my roster: http://www.die-triade.de/wowroster/

I make the changes twice but maybe I oversaw something :)
Last edited by Nenaisu on Tue Sep 05, 2006 9:42 pm, edited 2 times in total.
Image
User avatar
Nenaisu
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Fri Aug 04, 2006 2:40 am
Location: Germany

Recipe Calculator

Postby Averen » Tue Sep 05, 2006 10:58 pm

I'm on your page and im not getting the

Notice: Undefined offset: 1 in /home/www/web502/html/wowroster/addons/recipecalc/recipecalc.php on line 296

error anywhere.

As for the character problem, are you sure you've changed

Code: Select all
<td class="membersRow'.$stripe.'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></td

to
Code: Select all
<td class="membersRow'.$stripe.'"><a href="addon.php?roster_addon_name=recipecalc&recipeid='.urlencode(utf8_decode($recipe->data['recipe_name'])).'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></a></td


?

Also you missed the last variable in the localisation file :P
Last edited by Averen on Tue Sep 05, 2006 11:03 pm, edited 1 time in total.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: Recipe Calculator

Postby Nenaisu » Wed Sep 06, 2006 2:36 am

Averen wrote:I'm on your page and im not getting the

Notice: Undefined offset: 1 in /home/www/web502/html/wowroster/addons/recipecalc/recipecalc.php on line 296

error anywhere.

As for the character problem, are you sure you've changed

Code: Select all
<td class="membersRow'.$stripe.'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></td

to
Code: Select all
<td class="membersRow'.$stripe.'"><a href="addon.php?roster_addon_name=recipecalc&recipeid='.urlencode(utf8_decode($recipe->data['recipe_name'])).'"><span style="color:#'.substr( $recipe->data['item_color'], 2, 6 ).'"'.$recipe->data['recipe_name'].'</span></a></td


?

Also you missed the last variable in the localisation file :P


Thanks that was the missing issue :)

Witch last variable? I thought I have all?

The Error appears not at every recipies I found out by testing, mostly I found it at alchemy recepies.

Lock here as example:

http://www.die-triade.de/wowroster/addo ... er+Titanen
Last edited by Nenaisu on Wed Sep 06, 2006 2:44 am, edited 1 time in total.
Image
User avatar
Nenaisu
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Fri Aug 04, 2006 2:40 am
Location: Germany

Recipe Calculator

Postby Averen » Wed Sep 06, 2006 11:01 am

Hmm it seems to be a problem when an ingredient to an itemhas a non-standard character in them. I'll have a poke around and see what i can do.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Recipe Calculator

Postby Anaxent » Wed Sep 06, 2006 3:13 pm

Ya know im thinking im going to like this addon quite abit. I will download and install tomorrow and workik with it one thing I noticed is that it seems to get rid of the links to thottbot or allakazam... With that in mind I know overlib allows links to be made with in the tooltip. this would allow us to have a tooltip with a link to the calc or to alla/thot so we don't loose any of the expierance of wowroster and it's ability's.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Next

Return to Recipe Calculator

Who is online

Users browsing this forum: No registered users and 0 guests