BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: GBH on July 19, 2008, 03:28:54 am

Title: Updated - Crafting Module
Post by: GBH on July 19, 2008, 03:28:54 am
Hi,

I've made the craft tracking module a little more user friendly. Specifically, it now


It might not be the most elegant way of doing it but for my first ever bit of PHP or indeed coding whatsoever I'm quite happy with it.

Buffarse
Title: Re: Updated - Crafting Module
Post by: Sigi_cz on July 28, 2008, 08:45:28 pm
thanks. good to have this, because gmembers often set only one craft and then it is not working properly
Title: Re: Updated - Crafting Module
Post by: Organizer on July 29, 2008, 11:52:36 am
Thanks, hopefully this can be added to the core pack...
Title: Re: Updated - Crafting Module
Post by: Lightwave on July 31, 2008, 09:00:02 pm
My coding ability is rather poor so I'm hesitant to publish changes I've made...
but I made a minor change adding in a "None" type to the class1, class2 enum so people with zero or one profession/s can still add info, or availability if there's a need for more people to do a certain thing.

Also, I added class1_tier, class2_tier ints so people can register their tier proficiency as well.  eg setcraft Weaponsmith 5 Armorsmith 5.

Next step will be to add in settings for resource gathering tier capabilities, and then an easier way to search for a crafter of a certain type.  (But, someone better, could probably do this before me :p )
Title: Re: Updated - Crafting Module
Post by: GBH on July 31, 2008, 09:58:23 pm
Hehe well one of those changes was on my to-do list too ;)

I wanted to to add the ability to do !craftingclass all to show a complete list but I got stuck when  had the time producing a windowed list (I think I can do it now) and also a !craftingclass Armoursmith which would list all of them.

:)

Post your changes though, it's what I did. Worst you'll get is some friendly person improving it or correcting it. Remember I'd never touched code in my life before making my change. We all have to start somewhere :)

Buff
Title: Re: Updated - Crafting Module
Post by: Lightwave on July 31, 2008, 10:14:36 pm
Yeah ok...

I changed around the wording a bit from the text things too, and figured some people might not care for that.
Title: Re: Updated - Crafting Module
Post by: Sigi_cz on August 01, 2008, 09:19:06 am
Thanks for yout work guys but it seems that it does not update info in DB with new values.

I had modified a bit the help system for those commands. File is attached.
Title: Re: Updated - Crafting Module
Post by: GBH on August 01, 2008, 10:41:50 am
I'm off for a few days unfortunately and hardly an expert but my guess is that if the table already exists, it wont execute the code that sets up the class_tier fields because it only executes if theres no existing table. Unless we drop  table first (which is jut not desirable as it wipes all the existing info) we need to update the table with those fields.

Don't have the time to look at fixing it (if indeed that is the problem) but it's an idea.

Cheers

Buff
Title: Re: Updated - Crafting Module
Post by: Sigi_cz on August 01, 2008, 11:17:36 am
Lightwawe's code should do update
Code: [Select]
$this -> bot -> db -> query('INSERT INTO #___craftingclass (name,class1,class1_tier,class2,class2_tier) VALUES("'.$name.'","'.$options[0].'","'.$options[1].'","'.$options[2].'","'.$options[3].'") ON DUPLICATE KEY UPDATE class1=values(class1), class1_tier=values(class1_tier), class2=values(class2), class2_tier=values(class2_tier)');
Title: Re: Updated - Crafting Module
Post by: Lightwave on August 01, 2008, 01:56:47 pm
I'm still a bit confused... the line you pasted seems to be exactly what my file already had?
Title: Re: Updated - Crafting Module
Post by: Sigi_cz on August 01, 2008, 02:58:43 pm
I'm still a bit confused... the line you pasted seems to be exactly what my file already had?
yes it is your code. it was ansver to GBH.

still. why it is not working? :)
Title: Re: Updated - Crafting Module
Post by: Lightwave on August 01, 2008, 04:08:41 pm
Where are you not seeing the info update?  !whois or !craft

!whois uses cached information and won't update as quickly as !craft which should show an immediate change.
Title: Re: Updated - Crafting Module
Post by: Sigi_cz on August 01, 2008, 05:04:18 pm
Where are you not seeing the info update?  !whois or !craft
!craft. I had Alchemist and Gemcutter. now I tried Alchemist 1 Gemcutter 3 and !craft showed me only craft names and not tiers. Then i tried Weaponspith 1 Armorsmith 1, and craft showed up Alchemist and gemcutter without tiers again.
Title: Re: Updated - Crafting Module
Post by: Lightwave on August 01, 2008, 06:10:41 pm
Sounds like you didn't update your database as GBH mentioned.

You either need to delete the craftingclass table, or manually add in the class1_tier, class2_tier columns to the table.

You should be getting a reply when you send the message to the bot saying "Thank you for updating your crafting information."  I'm guessing you don't?
SimplePortal 2.3.7 © 2008-2024, SimplePortal