collapse collapse

Menu


* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Search



* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Kyr: Quote
    Live free or die.


    March 03, 2010, 03:28:21 AM
  • Kyr: cancel that
    March 03, 2010, 03:27:53 AM
  • Kyr: I never do!
    March 03, 2010, 03:27:41 AM
  • Kyr: I never use it
    March 03, 2010, 03:26:11 AM
  • TBK: nope :P
    March 01, 2010, 10:17:40 PM
  • WeZoN: no one uses this shoutbox ? :P
    February 26, 2010, 07:11:06 AM
  • WeZoN: check out aoc custom modules ^^  alliance chat from Borgan is up
    February 03, 2010, 06:48:24 AM
  • Yite: I see dead people
    February 02, 2010, 06:47:32 AM
  • squattinbull: I love Bebot!
    January 12, 2010, 12:16:03 PM
  • Riccarr: First Shout of 2010! Woohoo!
    January 07, 2010, 01:09:48 PM
  • Shakor: Happy new year!
    December 31, 2009, 01:04:18 PM
  • Shelly: Merry Christmas Everyone!
    December 25, 2009, 09:17:35 PM
  • Iheaca: Happy Christmas to all !
    December 24, 2009, 04:07:01 AM
  • Getrix: Happy xmas everytone! =)
    December 24, 2009, 01:07:49 AM
  • Temar: why does forum keep rolling back
    December 23, 2009, 02:05:48 PM
  • Shakor: Bebot not working for AoC patch 1.06 :)
    December 13, 2009, 06:33:00 PM
  • Khalem: Seems there is something wrong with the dutch language files :\
    December 10, 2009, 06:12:35 AM
  • WeZoN: i thnk you guys should check your footer.php ^^
    December 04, 2009, 08:12:07 AM
  • BongTechnician: O.o
    December 03, 2009, 09:39:54 PM
  • PBbot: Hi
    November 17, 2009, 11:12:10 AM

* Board Stats

  • stats Total Members: 1448
  • stats Total Posts: 14822
  • stats Total Topics: 2016
  • stats Total Categories: 7
  • stats Total Boards: 31
  • stats Most Online: 168

Author Topic: Updated - Crafting Module  (Read 2106 times)

0 Members and 2 Guests are viewing this topic.

Offline GBH

  • BeBot Hero
  • ******
  • Posts: 32
Updated - Crafting Module
« on: July 18, 2008, 08:28:54 PM »
Hi,

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

  • Checks 2 crafts have actually been entered and if not informs the user they need to set both at the same time
  • Checks that the crafts are the correct types and if not informs the user what valid crafts are
  • Parses the input and formats it correctly for the SQL code which forces uppercase first letter so it wont fail because of case sensitivity

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

Offline Sigi_cz

  • BeBot Rookie
  • *
  • Posts: 17
Re: Updated - Crafting Module
« Reply #1 on: July 28, 2008, 01:45:28 PM »
thanks. good to have this, because gmembers often set only one craft and then it is not working properly

Offline Organizer

  • BeBot Apprentice
  • ***
  • Posts: 135
Re: Updated - Crafting Module
« Reply #2 on: July 29, 2008, 04:52:36 AM »
Thanks, hopefully this can be added to the core pack...

Offline Lightwave

  • BeBot Rookie
  • *
  • Posts: 7
Re: Updated - Crafting Module
« Reply #3 on: July 31, 2008, 02: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 )

Offline GBH

  • BeBot Hero
  • ******
  • Posts: 32
Re: Updated - Crafting Module
« Reply #4 on: July 31, 2008, 02: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

Offline Lightwave

  • BeBot Rookie
  • *
  • Posts: 7
Re: Updated - Crafting Module
« Reply #5 on: July 31, 2008, 03: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.

Offline Sigi_cz

  • BeBot Rookie
  • *
  • Posts: 17
Re: Updated - Crafting Module
« Reply #6 on: August 01, 2008, 02: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.

Offline GBH

  • BeBot Hero
  • ******
  • Posts: 32
Re: Updated - Crafting Module
« Reply #7 on: August 01, 2008, 03: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

Offline Sigi_cz

  • BeBot Rookie
  • *
  • Posts: 17
Re: Updated - Crafting Module
« Reply #8 on: August 01, 2008, 04: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)');

Offline Lightwave

  • BeBot Rookie
  • *
  • Posts: 7
Re: Updated - Crafting Module
« Reply #9 on: August 01, 2008, 06:56:47 AM »
I'm still a bit confused... the line you pasted seems to be exactly what my file already had?

Offline Sigi_cz

  • BeBot Rookie
  • *
  • Posts: 17
Re: Updated - Crafting Module
« Reply #10 on: August 01, 2008, 07:58:43 AM »
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? :)

Offline Lightwave

  • BeBot Rookie
  • *
  • Posts: 7
Re: Updated - Crafting Module
« Reply #11 on: August 01, 2008, 09:08:41 AM »
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.

Offline Sigi_cz

  • BeBot Rookie
  • *
  • Posts: 17
Re: Updated - Crafting Module
« Reply #12 on: August 01, 2008, 10:04:18 AM »
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.

Offline Lightwave

  • BeBot Rookie
  • *
  • Posts: 7
Re: Updated - Crafting Module
« Reply #13 on: August 01, 2008, 11:10:41 AM »
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?

 


* Recent Posts

AoChatwrapper_Core error by the hundreds by Runemy
[March 11, 2010, 07:44:14 PM]


MOVED: New Commands Module plz :) by Temar
[March 11, 2010, 05:18:21 PM]


Raid armor search module by TBK
[March 11, 2010, 12:32:45 PM]


AOChat Lib for Java by TBK
[March 11, 2010, 12:27:40 PM]


AoC Raid weapon search module by TBK
[March 11, 2010, 08:19:06 AM]


* Who's Online

  • Dot Guests: 13
  • Dot Hidden: 0
  • Dot Users: 6
  • Dot Users Online:

* Forum Staff

Khalem admin Khalem
Administrator
admin Alreadythere
Administrator
Temar gmod Temar
Developer