L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 05:02:02 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 > BeBot Hyborian modules > Topic: Updated - Crafting Module
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Updated - Crafting Module  (Read 979 times)
0 Members and 2 Guests are viewing this topic.
GBH
Freshman
*
Offline Offline

Posts: 15


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: 84


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

Posts: 15


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

Posts: 15


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 > BeBot Hyborian modules > Topic: Updated - Crafting Module
« previous next »
 
Jump to:  

Recent
Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11145
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 15
Total: 19
Agnot
Glarawyn
xlDanek

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.583 seconds with 28 queries. (Pretty URLs adds 0.031s, 4q)
Loading...