BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => AO 0.6.x Custom/Unofficial modules => Topic started by: Tutomech on April 07, 2010, 02:51:06 pm

Title: Wishlist module
Post by: Tutomech on April 07, 2010, 02:51:06 pm
Module for tracking wishes of org members.

Contributors:
Originaly developed by Helkarakse (RK2)
Upgraded to version 1.1a by Tutomech (RK2)
Upgraded to version 1.2a by Tutomech (RK2)

Commands:
Code: [Select]
!wishlist
!wishlist add TEXT
Other commands should be accessible from clicks in UI.

Configuration:
Code: [Select]
!settings wishlist
and
Code: [Select]
!wishadmin rules TEXT
Again other commands should be acessed from the UI.
Title: Re: Wishlist module
Post by: Tutomech on April 07, 2010, 02:54:00 pm
Version 1.2a (2010-04-12)
Upgraded to version 1.2a by Tutomech (RK2)

Change log:
Bugfixes:
- Undo command shows every time
- Command to delete other person wish does report an error now
New features:
- added a MIA status to wishes for people who did not log in in a long time
- added a tell command to persons names
- added a setting for access level of !wishadmin

TODO:
- Database table names to be changed to bebot naming convention.


Check attachments in this post for the new version.
Tuto

------------------------------------------------------------------------------------
Version 1.1a ( 2010-04-07 )
Originaly developed by Helkarakse (RK2)
Upgraded to version 1.1a by Tutomech (RK2)
Change log:
- Removed access level check for creating list of unhanled wishes.
- Added access level check to command handler
- Added online indicators to names
- Changed timed limit from displaying filled wishes to a fixed number
- Fixed display ordering of unhandled wishes.
- Added option to use otherbot data trough otherbot setting
- Fixed the bug where users could not add Miy's armor to wishes (' injection)

Known issues:
- Undo command shows only if command is invoked by an admin
- Command to delete other person wish does not report an error (database does not allow it to be deleted)

TODO:
- Database table names to be configured properly.
- Add a setting for access levels of !wishlist and !wishadmin
- Fix known issues
- Removing wishes of people who did not log in in a long time.

NOTES:
Module is in alpha stage. It might do some unexpected deeds with untested configurations.
To contact me write to [email protected] or post on forums in http://bebot.link
Title: Re: Wishlist module
Post by: Khalem on April 09, 2010, 12:15:37 am
I've been pondering on doing something similar myself. Will check this out later when I get some time.
Title: Re: Wishlist module
Post by: Tutomech on April 09, 2010, 10:39:45 am
I've been pondering on doing something similar myself. Will check this out later when I get some time.

Thank you for kind words.

I consider myself a good coder. I do most of work in C++ and Java. So my PHP code is probably sub pair. But that is not the biggest concern atm.

Issue at hand 1:
I do not know how to handle database table names in BeBot. For a simple install there is no problem at all, but alliance  of bots (farm cities and stuff) and data sharing between bots is not done according to BeBot standards.

Issue at hand 2:
Someday i have to check how to check result of a DB update query so i can report an error if an user tries to delete other persons wish.

After i resolve issue 2, i can publish version 1.2.
The biggest improvement is wishlist ageing (by checking last status change in online DB).

Issue at hand 3:
But since online table is used by multiple bots i can get wrong/duplicate entries for online status of a person. It works in my org install, but there might be an issues there joining tables. current SQL looks like this:
Code: [Select]
$sql = "select " . // FIXME ugly dependancy
       "distinct(" . $this -> dataname . ".id), " .
       $this -> dataname . ".creator, " .
       $this -> dataname . ".timestamp, " .
       $this -> dataname . ".request, " .
       "online.status_gc_changetime " .
       "from " . $this -> dataname . " left join online on " . $this -> dataname . ".creator=online.nickname " .
       "where " . $this -> dataname . ".status=1 order by " . $this -> dataname . ".timestamp, online.status_gc_changetime;";

Any tips/suggestions are welcome.
Tuto
Title: Re: Wishlist module
Post by: Drizzurdeen on April 10, 2010, 08:35:13 pm
hmmmm nice one ...
but would it bee possibel to tell the wish-creator over the gui of the mod ?
Title: Re: Wishlist module
Post by: Tutomech on April 11, 2010, 11:44:16 am
hmmmm nice one ...
but would it bee possibel to tell the wish-creator over the gui of the mod ?

A tell command from the wishlist was planned at the start, but i do not know how useful would that be.
Adding it is no problem at all, since I already know who is online and on which alt.

I almost have a version 1.2, but it needs 1 more bug fix. I ll add a tell command too.

My noob question is, how do i see number of lines updated in PHP?
I do NOT want to add additional query to check creator name.
Code: [Select]

   $sql = "UPDATE ".$this -> dataname." SET `status` = '0', `statname` = '$name', `stattime` = '$time' WHERE `creator`='$name' and `id` = $id";
   $result = $this -> bot -> db -> query($sql);
Title: Re: Wishlist module
Post by: Tutomech on April 12, 2010, 09:59:00 am
Released version 1.2a.

Check 2nd post for details and download.
tuto
Title: Re: Wishlist module
Post by: Barbapappan on October 29, 2010, 01:09:14 pm
I threw this module into our AO org bot. But some wishes show up as duplicates. The request ID's are the same on the duplicate entries. When I click Filled on one of them, both is marked as Filled. Any ideas why they pop up two times?
Title: Re: Wishlist module
Post by: Tsamoonia on October 30, 2010, 12:31:09 am
can someone explain what this is?  wishlist?  what is it all about?
Title: Re: Wishlist module
Post by: Tsamoonia on November 04, 2010, 06:25:25 pm
i cant seem to get this module to work.  is it still be worked on or is there something i am missing?
Title: Re: Wishlist module
Post by: Tutomech on November 05, 2010, 12:36:50 pm
I threw this module into our AO org bot. But some wishes show up as duplicates. The request ID's are the same on the duplicate entries. When I click Filled on one of them, both is marked as Filled. Any ideas why they pop up two times?

You are probably sharing one wishlist between 2 bots.
If both bots have the same person in their online list, their entries get duplicated by db query.
A quick and dirty fix is to delete the duplicate online entry in online table.

Sorry but i was not able to find enough time to fix the issue. Might fix it in not so near future.
Title: Re: Wishlist module
Post by: Tutomech on November 05, 2010, 12:38:19 pm
can someone explain what this is?  wishlist?  what is it all about?

Please do read the introduction posts of this thread.
Title: Re: Wishlist module
Post by: Tutomech on November 05, 2010, 12:43:54 pm
i cant seem to get this module to work.  is it still be worked on or is there something i am missing?

You did not provide enough information for me to give you any helpful answer.

The module is in use in DOC so i consider it a "beta" version.
Title: Re: Wishlist module
Post by: elrojo on November 20, 2010, 10:59:34 am
nice idea for a module.  Since i'm new to all of this, is there any chance that you might be able to post the commands possible etc?
Title: Re: Wishlist module
Post by: Tsamoonia on November 21, 2010, 11:22:26 pm
Sorry tut.  Yeah i read about it.  i like the idea but i cant seem to get it to work.  No wishes are being added that people are trying to add... when i say its not working... the module is there and we can use teh commands and it respond appropriately but nothing shows up on the list.. nothing is saving.  in the settings i was not sure about this...

Quote
otherbot: XXXXXX
Description: Name of the bot that is hosting data (has to be in same database).
/tell XXXXX !set wishlist otherbot <new value>

Should i have my bot in here or is there a different bot that i need to have listed as the host?

I may try and delete it and reinstall it to the bot... any ideas as to what the issue is
Title: Re: Wishlist module
Post by: Tsamoonia on December 01, 2010, 09:06:22 pm
ok i realized... this is an AO module... i was attempting to use it in aoc.   can any adjustments be made so it is compatible in aoc as well.  i realy like the idea of this module
Title: Re: Wishlist module
Post by: Runemy on December 02, 2010, 04:17:17 am
There's no reason why this mod shouldn't work in AoC as well mate, just plug 'n play! :)
Title: Re: Wishlist module
Post by: Tsamoonia on December 02, 2010, 07:17:08 am
yeah i didnt think so but i am having an issue with it acknowledging commands.  not sure why either
Title: Re: Wishlist module
Post by: Tsamoonia on December 07, 2010, 10:55:47 pm
ok.  this will be my last attempt to get this going.  It still is not working.

1. can someone post the most up to date version of it?
2 in the settings it says this: the XXX are in place of my current bot name.  my bot had a name change as well.. could any of this effect why it is not working.
otherbot:  XXXXX
 Description: Name of the bot that is hosting data (has to be in same database).
/tell XXXX !set wishlist otherbot <new value>
3. commands that are working: !settings wishlist, !wishlist, !help wishlist, !help wishadmin.... all other commands do not work.

these are the current issues i am having.

if there is anyone who can provide me with any info as to what is wrong,  i am open ears.
Title: Re: Wishlist module
Post by: Tutomech on January 03, 2011, 01:28:25 pm
Sorry tut.  Yeah i read about it.  i like the idea but i cant seem to get it to work.  No wishes are being added that people are trying to add... when i say its not working... the module is there and we can use teh commands and it respond appropriately but nothing shows up on the list.. nothing is saving.  in the settings i was not sure about this...

Quote
otherbot: XXXXXX
Description: Name of the bot that is hosting data (has to be in same database).
/tell XXXXX !set wishlist otherbot <new value>

Should i have my bot in here or is there a different bot that i need to have listed as the host?

I may try and delete it and reinstall it to the bot... any ideas as to what the issue is

Other bot settings is for sharing the wishlist between multiple bots. So if you have multiple orgs allied (or multiple cities - bots) they all work on the same list.

Would be cool if you could check the contents of the database to see if it did store the data at all.
I ll double check the source and try to guess what is wrong in a bit.

Title: Re: Wishlist module
Post by: Tutomech on January 03, 2011, 01:45:43 pm
ok.  this will be my last attempt to get this going.  It still is not working.

1. can someone post the most up to date version of it?
2 in the settings it says this: the XXX are in place of my current bot name.  my bot had a name change as well.. could any of this effect why it is not working.
otherbot:  XXXXX
 Description: Name of the bot that is hosting data (has to be in same database).
/tell XXXX !set wishlist otherbot <new value>
3. commands that are working: !settings wishlist, !wishlist, !help wishlist, !help wishadmin.... all other commands do not work.

these are the current issues i am having.

if there is anyone who can provide me with any info as to what is wrong,  i am open ears.

Hmmm.
A bot name change could have made bot loose reference to table name.
A quick dirty fix might be to set otherbot  setting to the old botname.
(note i am only guessing here, so mybe it will, mybe it won't work)
Title: Re: Wishlist module
Post by: Shelly on February 06, 2011, 08:00:32 pm
One thing I found was that the default setting for showing MIA requests was "not to show" you may think it is not showing if the module has not seen you log on/off. try that or change the setting for showing MIAperson requests via /tell yourbot settings wishlist.

Nice module. :)
Title: Re: Wishlist module
Post by: Heffalomp on June 15, 2011, 11:19:59 pm
I threw this module into our AO org bot. But some wishes show up as duplicates. The request ID's are the same on the duplicate entries. When I click Filled on one of them, both is marked as Filled. Any ideas why they pop up two times?

You are probably sharing one wishlist between 2 bots.
If both bots have the same person in their online list, their entries get duplicated by db query.
A quick and dirty fix is to delete the duplicate online entry in online table.

Sorry but i was not able to find enough time to fix the issue. Might fix it in not so near future.

Anyone got a fix for this? Kinda anoying since we share the db with several bots and some show the same people online so some show up with 7-8 times duplicate requests in the wishlist but only one request is stored in the db...
SimplePortal 2.3.7 © 2008-2024, SimplePortal