BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: khayman on December 07, 2008, 05:21:35 pm

Title: NewCity module
Post by: khayman on December 07, 2008, 05:21:35 pm
This is a new Age of Conan City building overview module.

Since we cant upload you can find the module here http://selbo.net/NewCity/NewCity_1.1.php.gz (http://selbo.net/NewCity/NewCity_1.1.php.gz)

New Features in version 1.1 (same link)
* Ability to choose what to display in the resource overview Refined, Gather, Both, RefinedLong (Gathername included) or RefinedLonger (Gathername and amount included) use "!settings City" to change it
* Tier header in city and build pages are now links to a page showing individual building resource needs.

I tried Madrulf's City Progression module (the one shipped with bebot) and found it too limiting. So i set out to build my own module.

The NewCity module has the following features.
* Build target - Shows a resource overview for the next building so the players can see how many resources are missing for the building to be completed.
* Tier overview - Shows a resource overview for the Tier, also shows how many items are currently in the bank.
* Random build order - With the build menu you can build your buildings in any order. It will autosubtract all resources from the cank overview
* Build all button - Builds all remaining buildings of a type (nice to use for the walls and towers)
* Build menu - No need to type anything for building, just click links.
* Demolish buildings - Possibility to remove buildings (usually if you clicked build by mistake ;) )

The commands are
* !city - Member level command that displays the current build status
* !build - Displays the build menu
* !build <name> - Builds the specified building
* !build all <name> - Builds the maximum amount of the specified building
* !demolish - Displays the build menu
* !demolish <name> - Demolishes the specified building
* !demolish all <name> - Demolishes all of the specified building
* !bank - Display the bank menu
* !bank add <resource> <amount> - Add <amount> of <resource> to the bank
* !bank remove <resource> <amount> - Remove <amount> of <resource> from the bank
* !bank set <resource> <amount> - Set the amount of <resource> to <amount>
* !buildtarget <name> - Sets the buildtarget to building <name>
* !deatils <tier> - Shows a overview page of the resource needs for each building in the tier (available as a link in the city and build pages)

Please give feedback if you try it and find bugs (or if you just like it :) )
Title: Re: NewCity module
Post by: Getrix on December 07, 2008, 06:56:05 pm
Tried it and looks nice!

Only comment i got is you have removed total amount of each resource needed...
"Brick" doesnt say so much for most players... Ppl is missing it.

And also the info about each buildings total cost in resource/money is removed..

Else it looks good!
Title: Re: NewCity module
Post by: khayman on December 07, 2008, 07:59:18 pm
Ill add the raw resource name and numbers as well.
With !buildtarget you can see the resource needs for the current build target, bit i guess i can add a small page to show the resource cost of each building. I didnt want to put it into the overview since it will become 2 pages instead of 1.
Title: Re: NewCity module
Post by: khayman on December 07, 2008, 09:50:35 pm
New version uploaded, give it a try.
Title: Re: NewCity module
Post by: xlDanek on December 08, 2008, 09:30:13 am
Hi!

I get a

Code: [Select]
Warning: Invalid argument supplied for foreach() in /home/www/web3/html/bebot/modules/aoc/City.php on line 156

Error at the Bebot Startup.

Do you know why I get this error?
Title: Re: NewCity module
Post by: Blueeagle on December 08, 2008, 12:51:29 pm
Hi!

I get a

Code: [Select]
Warning: Invalid argument supplied for foreach() in /home/www/web3/html/bebot/modules/aoc/City.php on line 156

Error at the Bebot Startup.

Do you know why I get this error?

This is not an error, it is just a warning.

This is caused by the database table being unpopulated. Once you actually build something this warning will go away.

However the developer should have forseen this and added a check to his database query to see if it returned an empty result. It's no harder then
if(!empty($result)){/*data found*/}else{/*no data found*/}.
Title: Re: NewCity module
Post by: khayman on December 08, 2008, 06:16:48 pm
True, sloppy coding/testing there :p Fixed and new version uploaded.
Title: Re: NewCity module
Post by: xlDanek on December 08, 2008, 10:44:07 pm
I think there's a little mistake in the formatting of the "coins":

If I add "97727818" to the bank, "!bank" displays the right output:

97G 72S 78C 18T : Coins

But "!city" shows, under "Resources needed for Tier_III_Buildings" for example (also under the other "Resources needed" parts) a wrong amount of coins (in the bank):

22G 41S Coins (977G 27S 81C -12T in the bank)


There's somewhere a little mistake in the calculation :D about the 10x of the right amount :D

But it looks good....  :P
Title: Re: NewCity module
Post by: khayman on December 09, 2008, 08:45:06 am
Yeah, it seems i made a slight miscalculation there. Ill dump a new version out later today.
Title: Re: NewCity module
Post by: xlDanek on December 10, 2008, 11:40:21 pm
Another little mistake:

If i click on the ""Tier 1 Buldings", "Tier 2 Buldings", "Tier 3 Buldings", "Tier 1 Walls", "Tier 2 Walls" or "Tier 3 Walls" links in the window that i get with the "!city" or the "!build" command, the chat link text always says:

"Tier III Walls Building resource overview"

But if i click on the link in the chat the right window appears. It's only the text of the link in the chat that is wrong.
Title: Re: NewCity module
Post by: khayman on December 11, 2008, 07:33:33 pm
Should be fixed now. It was a runaway return statement :)
Title: Re: NewCity module
Post by: xlDanek on December 12, 2008, 12:45:38 am
Looks really nice!

No further mistake found so far :D


PS: I just wanted to post that a ";" is missing ;) But this time you've been faster.  ;D
Title: Re: NewCity module
Post by: Margon on December 18, 2008, 10:44:57 am
i have a problem with this modul, die bot write the data in the sql table "Botname_city" but try to read the table "city"
when i restart the bot, the !city window is allways empty becouse there is no data in the "city" table

i am a sql noob and cant fix it :( can you do it please?
Title: Re: NewCity module
Post by: khayman on January 02, 2009, 01:58:54 pm
I will look at it, its probably a collision with the old city modules table.
Title: Re: NewCity module
Post by: palm521 on February 04, 2009, 06:47:59 pm
dunno how to install this, should it rename the other city module?

i have been moving the newcity.php to custom folders. but the old one seems to be in place.

any advice is appreciated

thanks
Title: Re: NewCity module
Post by: khayman on February 05, 2009, 01:56:27 pm
You should just remove the old city module and copy this one to the same location. It does not matter what it is called (as far as i know).

If you download the latest version it should now be able to coexsist with the old city tables (it should not delete any data).
Title: Re: NewCity module
Post by: Ynelin on April 24, 2009, 01:30:04 am
I cant download this from the OP. Is it found somewhere else?
Title: Re: NewCity module
Post by: khayman on May 07, 2009, 06:41:48 pm
Should still be available with the link in the first post. It was probably offline due to uppgrades or powerfailure.
Title: Re: NewCity module
Post by: bbung on October 05, 2009, 12:45:30 pm
Download link is down. Can i get it somewhere else ?

Title: Re: NewCity module
Post by: Getrix on October 05, 2009, 01:03:30 pm
There you go:
http://dump.sjef.biz/aoc/bebot/NewCity.phps
Title: Re: NewCity module
Post by: bbung on October 05, 2009, 01:30:56 pm
Wow, u r fast. Thank you very much!
Title: Re: NewCity module
Post by: Yite on October 26, 2009, 12:33:36 pm
Will try the module later but shouldn't this topic be in AoC Custom modules instead of AO?
Title: Re: NewCity module
Post by: PBbot on November 26, 2009, 03:45:21 pm
I get this error on this module:
Mysql ERROR<# 1> on query: SELECT 'text', 'value' from pbbot_city
Unknown column 'text' in 'field list'
Title: Re: NewCity module
Post by: Kyr on December 22, 2009, 03:15:11 am
I ran into this same problem.  The built-in city module uses a table with the same name, but a different structure.  You need to drop that existing table and restart the bot.

~Kyr
Title: Re: NewCity module
Post by: Anastasia on March 18, 2010, 03:15:03 am
I have installed this awesome module to my guilds bot but for the life of me just cant figure out how to change the location instance...

We are in PoitainEast and the bot keeps calling our location LacheishEast...

Any advice would be awesome!!!!!

Thanks in advance!!!!

Ana
Title: Re: NewCity module
Post by: Runemy on March 18, 2010, 10:20:45 am
The owner of the bot can change that in !settings for the module.
Title: Re: NewCity module
Post by: Anastasia on March 18, 2010, 11:05:59 am
yeah im the owner lol but a total noob!!!  :o

how do i get into the settings??

 ;D
Title: Re: NewCity module
Post by: Anastasia on March 18, 2010, 12:38:11 pm
OMG think i just figured it out!!!

I was trying from wrong toon :/

NOOB!!!

 ;D
Title: Re: NewCity module
Post by: RooK80 on August 11, 2010, 08:59:03 pm
I dont get it.. I installed this module, went through the settings, all ok. build all our buildings we have at guildcity and there was no errors or anything. Then, booted the guildbot as i installed other new stuff but, when i went back and checked !city and !build it has lost all build buildings ? how can this be..?
Title: Re: NewCity module
Post by: Drizzurdeen on August 12, 2010, 11:38:38 am
maybee the other mod have created an new table in the database ... just have a look on it ... this would be the only answer i have ;)

drizz
Title: Re: NewCity module
Post by: SalmonSeller on October 18, 2010, 12:57:05 am
I dont get it.. I installed this module, went through the settings, all ok. build all our buildings we have at guildcity and there was no errors or anything. Then, booted the guildbot as i installed other new stuff but, when i went back and checked !city and !build it has lost all build buildings ? how can this be..?

Yes, I have this issue also. None of the buildings, materials, money, etc seems to survive past the bot rebooting - it has all returned to Zero.

Any ideas?   ???
Title: Re: NewCity module
Post by: Yite on October 18, 2010, 12:26:13 pm
you might have to drop the original city module's table
Title: Re: NewCity module
Post by: Tsamoonia on November 02, 2010, 08:17:13 pm
whenever i use this i put in all the information.. anytime the bot is restarted... it clears the info.  i can never keep that information on what has been created and what hasnt up.  any reason?
Title: Re: NewCity module
Post by: SalmonSeller on November 04, 2010, 05:32:35 am
whenever i use this i put in all the information.. anytime the bot is restarted... it clears the info.  i can never keep that information on what has been created and what hasnt up.  any reason?

Yeah, I'm still having this issue as well. It simply will not retain the information. I have followed the suggestions posted, but have had no success. It keeps the information initially, but as soon as the bot is restarted, it is all reset. Got me stumped.  :(
Title: Re: NewCity module
Post by: SalmonSeller on November 12, 2010, 08:38:34 am
Re this issue, noticed this text showing in the bot boot up screen (or whatever you call it):

(http://i573.photobucket.com/albums/ss172/SalmonSeller/AoC/boterrorpic0002.jpg)

Not really sure what it all means of course. I know conan2 is the folder the frm files are in (I tracked that much down), and I'm guessing norbtest_city is the data table for the city info?? What the rest means though [shrug].

Any help much appreciated.
Title: Re: NewCity module
Post by: Khalem on November 12, 2010, 09:14:02 pm
Try the following version SalmonSeller

NB!: This version is untested and changes the database layout slightly and should not be needed unless you suffer from the bot "forgetting" between restarts

You are getting an MySQL error 121 on creation of the table which stores the city state. From what I can gather this is caused by issues related to primary key, so I have added an autoincrementing primary key ID field to the database table which should hopefully get around that issue.
Title: Re: NewCity module
Post by: Tsamoonia on November 21, 2010, 11:25:42 pm
ty khalem... i will try it out and let you know
Title: Re: NewCity module
Post by: Tsamoonia on November 21, 2010, 11:53:20 pm
nope still doesnt save..
Title: Re: NewCity module
Post by: SalmonSeller on December 12, 2010, 10:09:46 am
Yes, unfortunately, no improvement. I'll post a screeny of the error message asap.  :(
Title: Re: NewCity module
Post by: SalmonSeller on February 26, 2011, 04:10:09 am
Well, I finally got around to posting the current error message that spams at bot loadup. And, I have applied the previous fix, which didnt seem to change anything.

(http://i573.photobucket.com/albums/ss172/SalmonSeller/AoC/bcb9c9b6.jpg)

Any idea's? As noted earlier, you can put info into the city module, but after a while, presumably a restart (or roster update???) it wipes all the info. Often I don't restart it though, and it still wipes. <shrug>
Title: Re: NewCity module
Post by: GaRoN on March 03, 2011, 05:27:11 am
does someone have a version within the tavern 1-3 ???
SimplePortal 2.3.7 © 2008-2024, SimplePortal