HOME FORUM
* *

Content

  •    Links
  •        Downloads
  •        Bugtracker
  •        Code repository
  •        Documentation (Wiki)

User

Welcome, Guest. Please login or register.
Did you miss your activation email?
July 04, 2009, 06:17:33 PM

Login with username, password and session length

Search




Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > BeBot Hyborian modules > Topic: Updated - Crafting Module
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Updated - Crafting Module  (Read 1671 times)
0 Members and 1 Guest are viewing this topic.
GBH
Rookie
**
Offline Offline

Posts: 24


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
Logged
Sigi_cz
Freshman
*
Offline Offline

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
Logged
Organizer
Apprentice
***
Offline Offline

Posts: 124


Re: Updated - Crafting Module
« Reply #2 on: July 29, 2008, 04:52:36 AM »

Thanks, hopefully this can be added to the core pack...
Logged
Lightwave
Freshman
*
Offline Offline

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 )
Logged
GBH
Rookie
**
Offline Offline

Posts: 24


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 Wink

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.

Smiley

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 Smiley

Buff
Logged
Lightwave
Freshman
*
Offline Offline

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.
Logged
Sigi_cz
Freshman
*
Offline Offline

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.
Logged
GBH
Rookie
**
Offline Offline

Posts: 24


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
Logged
Sigi_cz
Freshman
*
Offline Offline

Posts: 17


Re: Updated - Crafting Module
« Reply #8 on: August 01, 2008, 04:17:36 AM »

Lightwawe's code should do update
Code:
$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)');
Logged
Lightwave
Freshman
*
Offline Offline

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?
Logged
Sigi_cz
Freshman
*
Offline Offline

Posts: 17


Re: Updated - Crafting Module
« Reply #10 on: August 01, 2008, 07:58:43 AM »

Quote from: Lightwave 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?
yes it is your code. it was ansver to GBH.

still. why it is not working? Smiley
Logged
Lightwave
Freshman
*
Offline Offline

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.
Logged
Sigi_cz
Freshman
*
Offline Offline

Posts: 17


Re: Updated - Crafting Module
« Reply #12 on: August 01, 2008, 10:04:18 AM »

Quote from: Lightwave on August 01, 2008, 09:08:41 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.
Logged
Lightwave
Freshman
*
Offline Offline

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?
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > BeBot Hyborian modules > Topic: Updated - Crafting Module
« previous next »
 
Jump to:  

Recent

  • bind module to group? by Alreadythere [Today at 06:07:10 PM]
  • multiple bots on one acco... by WeZoN [Today at 04:52:37 PM]
  • No Auto-notify for new Me... by Wolfbiter [Today at 12:04:14 PM]
  • Player Quotes by clashbot [Today at 09:53:22 AM]
  • Quotes module by clashbot [Today at 09:44:54 AM]
  • unable to load by Khalem [Today at 09:01:07 AM]
  • Bebot 6.3 installation pr... by Gridsurge [Today at 05:58:27 AM]
  • Installing v0.6.3 by Vulkor [Today at 12:34:46 AM]
  • AoC and Patch 1.05 by Apollyon [July 03, 2009, 10:00:56 PM]
  • !items error now by Rekkx [July 03, 2009, 07:29:43 PM]

Stats

Members
  • Total Members: 1225
  • Latest: Apollyon
Stats
  • Total Posts: 12812
  • Total Topics: 1743
  • Online Today: 29
  • Online Ever: 168
  • (July 01, 2007, 09:30:02 PM)
Users Online
Users: 5
Guests: 18
Total: 23
WeZoN
DJKRose
Crazy
TinyPortal v1.0 beta 3 © Bloc

Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
| NewDef design by Bloc
Page created in 0.168 seconds with 35 queries. (Pretty URLs adds 0.037s, 4q)
Loading...