collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: NewCity module  (Read 17201 times)

0 Members and 1 Guest are viewing this topic.

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
NewCity module
« 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

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 :) )
« Last Edit: December 07, 2008, 09:45:34 pm by khayman »

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: NewCity module
« Reply #1 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!
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #2 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.

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #3 on: December 07, 2008, 09:50:35 pm »
New version uploaded, give it a try.

Offline xlDanek

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: NewCity module
« Reply #4 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?

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: NewCity module
« Reply #5 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*/}.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #6 on: December 08, 2008, 06:16:48 pm »
True, sloppy coding/testing there :p Fixed and new version uploaded.
« Last Edit: December 08, 2008, 06:22:51 pm by khayman »

Offline xlDanek

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: NewCity module
« Reply #7 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

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #8 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.

Offline xlDanek

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: NewCity module
« Reply #9 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.

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #10 on: December 11, 2008, 07:33:33 pm »
Should be fixed now. It was a runaway return statement :)

Offline xlDanek

  • BeBot User
  • **
  • Posts: 22
  • Karma: +0/-0
Re: NewCity module
« Reply #11 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

Offline Margon

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
Re: NewCity module
« Reply #12 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?

Offline khayman

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: NewCity module
« Reply #13 on: January 02, 2009, 01:58:54 pm »
I will look at it, its probably a collision with the old city modules table.

Offline palm521

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: NewCity module
« Reply #14 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

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 502
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal