BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Naturalistic on July 06, 2006, 07:14:46 am

Title: Guild Depot
Post by: Naturalistic on July 06, 2006, 07:14:46 am
Finally got around to finishing it/uploading it.

Featured: It's like a bank, you add your items that are open for the org to have/borrow. People can search for specific items, be able to see who owns the current item, and be able to ask for it.

Suggestions or think of stuff to add? Lemme know. Hope you enjoy it =)



**NOTE**
This only works on the Department style guild ranking system. I haven't been able to figure out a universal code to match all org rankings. It's fairly simple to fix to match it to your org. Or just remove it altogether. Your choice :)

Once I make changes and updates according to guilds, I'll update this. Still working-progress.
Title: Re: Guild Depot
Post by: Pharexys on July 06, 2006, 07:55:59 pm
Sounds very nice ;D i'll post if i see anything wrong.
Title: Re: Guild Depot
Post by: Glarawyn on July 06, 2006, 10:39:46 pm
If you go by rank_id instead of rank, you have two assurances:

rank 0 = Org Leader (President, Lord, whatever...)
rank 1 = 2nd in command (General, whatever.)

However rank 1 can't always do much. See below. :)

Department
0=President
1=General
2=Squad Commander
3=Unit Commander
4=Unit Leader
5=Unit Member
6=Applicant

In a Department, the rank Unit Commander and higher allows organization members to recruit new members.

Faction
0=Director
1=Board Member
2=Executive
3=Member
4=Applicant

In a Faction, only the Director and Board Members can invite new members.

Republic
0=President
1=Advisor
2=Veteran
3=Member
4=Aplicant

In a Republic only the President and Advisors can invite new members.

Monarchy
0=Monarch
1=Counsil
2=Follower

In a monarchy, only the Monarch can invite new members.

Anarchism
0=Anarchist

An anarchism has 1 leader who is also an "Anarchist" but only this member gets to chose the governing form. It takes 3 members who do /org kick {name} to kick someone from such an org. Everyone in an anarchism can recruit new members.

Feudalism
0=Lord
1=Knight
2=Vassal
3=Peasant

In a feudalism, only the Lord can invite new members.
Title: Re: Guild Depot
Post by: Naturalistic on July 07, 2006, 03:47:06 am
Yes, I know the ranks :P

The problem was figuring out a universal "rank" code.

Members shouldn't be allowed to remove other members, but a General/pres should be.

Title: Re: Guild Depot
Post by: Zimble on August 09, 2006, 05:00:09 pm
Nice mod, Naturalistic
Already wrote a web interface for that.

But while trying to delete items we noticed that members are not able to delete items from the db.

I took a look at the code and noticed that in line 111 in the depot_del function the calling charname is compared with the itemurl stored in the db, instead of the contributorID.
So only admins were able to delete items.

So I increased the index by one:
Code: [Select]
111c111
<             if($result2[0][2]==$name) $candel = true;
---
 >             if($result2[0][3]==$name) $candel = true;


Maybe its just our database and the fields are in a diffrent order but I wanted you to know...
Title: Re: Guild Depot
Post by: Naturalistic on August 09, 2006, 05:26:11 pm
Which version of the bot do you run?

It's working as it should here...I'll take a look into it though.
Title: Re: Guild Depot
Post by: Zimble on August 09, 2006, 07:01:46 pm
Thx for the quick response

main.php says $bot_version = "0.3.3";

Don't know, where "our" depot.php is coming from, since I'm not the hoster of the bot

But from what I've seen in depot.php
Code: [Select]
$db -> query("CREATE TABLE IF NOT EXISTS depot
              (id INT(11) NOT NULL PRIMARY KEY, itemName VARCHAR(255), itemURL VARCHAR(255), contributorID VARCHAR(30))");

than $result(0)(2) is indeed the itemURL.
Title: Re: Guild Depot
Post by: Naturalistic on August 13, 2006, 06:23:01 pm
Ah... I added the DB info afterwards.

I probably put them into the wrong order. I'll fix it up, thanks for pointing that out =)
Title: Re: Guild Depot
Post by: Malosar on August 19, 2006, 12:59:46 am
Handy module but didn't quite do what I'd like so I modified it a bit. Now you can add an item and include a number after it depending on how many you have. Adding 63 of the same item and same ql just seemed ridiculous so you can do !depot add itemref 63. The list will display itemref X63.

Also adding no number just adds 1 to the amount since it's obviously just 1 item.

edit: Removed file as was old version.
Title: Re: Guild Depot
Post by: Naturalistic on August 19, 2006, 07:03:10 am
Ah, yeah... forgot to add my updated version.

Has the option to choose what org type you are and the 'rank' you want to be able to remove items.

And if there's multiple of the same item but different people, it x# the item, and lists who has it.

Just need to write a post-it for me to remember to upload tomorrow :)
Title: Re: Guild Depot
Post by: Malosar on August 19, 2006, 03:33:13 pm
Very nice, I'll check it out :)
Title: Re: Guild Depot
Post by: Zimble on August 19, 2006, 08:41:16 pm
Maybe you should add an item-remove link in list/search view to make it easier to remove items:

Code: [Select]
<?php
$stritem 
.= "<font color=#ffff66>#" $val[0] . "</font> - <a href=" $val[2] . ">"$val[1] ."</a>\n[Item holder: " $val[3] . "] [ <a href='chatcmd:///tell <botname> depot del " $val[0] . "'>Remove</a> ]\n\n";
?>


So you no longer need to copy&paste the itemid of the item you want to delete
Title: Re: Guild Depot
Post by: jjones666 on August 20, 2006, 01:38:09 pm
*pokes naturalistic*
Title: Re: Guild Depot
Post by: Wolfbiter on August 20, 2006, 11:22:07 pm
No poking of natu without my written expression!
Title: Re: Guild Depot
Post by: jjones666 on August 25, 2006, 12:38:50 am
Would be cool to show the QL in the list also, tried to figure it out but too tired :)

-jj-
Title: Re: Guild Depot
Post by: Naturalistic on August 25, 2006, 12:45:24 am
*adds to list*
Title: Re: Guild Depot
Post by: jjones666 on September 29, 2006, 08:35:17 am
what we use in org:

http://www.jjones.co.uk/files/buffbag.php
http://www.jjones.co.uk/files/buffbag.txt
- added QL processing
- added QTY processing (courtesy Malosar)
- added remove clicky for items in main list
- added helpfile
- commands changed from depot to buffbag

edit: oops, bad links.

-jj-
Title: Re: Guild Depot
Post by: buff on October 04, 2006, 06:43:15 pm
Just curious if Nat every got the chance to update the new depot file??
the file seems to be the same old one still? or is it new that I just didn't notice? :P
Title: Re: Guild Depot
Post by: Naturalistic on October 04, 2006, 11:51:14 pm
No, I never got around to it. Got busy with RL stuff, and jack stopped reminding me :P

I'll see what I can do tonight, and hopefully put up the final version. :P
Title: Re: Guild Depot
Post by: buff on October 11, 2006, 10:57:08 pm
Nat, can you put a note on first page when u upload it? :P thnx
Title: Re: Guild Depot
Post by: Dabaron on October 12, 2006, 09:37:20 am
I just took JJ's and changed it all from buffbag to depot and it has everything you would need   ;)
Title: Re: Guild Depot
Post by: jjones666 on October 15, 2006, 12:08:01 am
Then this is the !alienbag module we use for storing clumps.
Has all of the features of the buffbag but includes a clicky linked to Wolfbiter's !type function (required: http://bebot.link/index.php/topic,298.0.html).

http://www.jjones.co.uk/files/alienbag.php
http://www.jjones.co.uk/files/alienbag.txt

Cheers,

-jj-
Title: Re: Guild Depot
Post by: Glarawyn on November 01, 2006, 07:09:28 pm
The problem was figuring out a universal "rank" code.

Members shouldn't be allowed to remove other members, but a General/pres should be.

Been trying to figure that out as well. Org Security Module (http://zibby.isa-geek.net/bebot/dev/OSM.phps). I ended it up dumbing it down to be ORGRANK0 (org leader) to ORGRANK6 (Applicant in Department). With the check_security() function in the OSM module you can at least setup some sort of security hierarchy.
Title: Re: Guild Depot
Post by: Naturalistic on November 01, 2006, 07:44:22 pm
But then you're still going to run into specific settings for the rank... so there's not much of a real bonus in code reduction.

Unless I'm just not seeing what you mean.

If I went by rank ID, I could just say 0 or 1 (pres / gen)

And that would work for everything. (might just add that actually)
Title: Re: Guild Depot
Post by: jjones666 on November 01, 2006, 09:32:48 pm
OMFG, i thought updated version for a minute Natu :-P

-jj-
Title: Re: Guild Depot
Post by: Naturalistic on November 01, 2006, 09:59:04 pm
You said you didn't need my version of it :p

And you already posted another version... so I haven't bothered with mine much :P
Title: Re: Guild Depot
Post by: jjones666 on January 11, 2007, 07:25:38 pm
Bump for my favourite Campalot superadmin :-)

(Don't wanna post my modules in the A-Z) ;-p

-jj-
Title: Re: Guild Depot
Post by: pusikas on January 25, 2007, 12:04:54 am
Not 100% sure, but I think if I search for something and it isnt in buffbag/depot, I get the full list. Which can take quite some time. Or am I misinterpreting something here?
Title: Re: Guild Depot
Post by: pusikas on January 26, 2007, 10:22:11 am
Now it doesnt do that anymore. Duh. A few days ago it always dumped the complete list on me when I searched for a fragment of the source. Now it correctly says that it doesnt have it. Strange...
Title: Re: Guild Depot
Post by: Malosar on February 05, 2007, 09:21:43 pm
I've decided to update this again. We wanted the ql's which was updated beforehand and thanks for that however we didn't like it deleting the whole entry when specifying an id, if there's a quantity for that item. So i've made it, by default, delete 1 from the quantity instead of deleting the entry entirely (in the case there's more than 1 of course).  Also you can specify an amount on the delete command to remove a certain quantity (or all) from that entry.

Also fixed the contributor check for removing items.

edit: and oh yes, my version I renamed back to depot (sorry JJ) as we prefer that command/name. /s/depot/buffbag ftw
Title: Re: Guild Depot
Post by: Malosar on February 06, 2007, 04:43:19 pm
Quick minor chage, limited output on depot list to 50 items in guild chat and no limit in a tell. Reposted depot.php in previous post.
Title: Re: Guild Depot
Post by: Malosar on February 09, 2007, 04:43:34 pm
Last change for this hopefully, at least for my usability requirements. I've added a quantity add function so if I'm adding items identical to ones already in the depot, I just need to raise the amount instead of adding as a separate item. Links in list and search now have

Another minor change, it won't spam the depot list if you get a command wrong anymore. The list will only be displayed on !depot list instead of just !depot as org members would get a command wrong in a tell and wait for 16 pages of items.

EDIT: Removed these versions for download as they are outdated. See newer post further on in thread.
Title: Re: Guild Depot
Post by: Malosar on February 09, 2007, 07:13:37 pm
And lastly here is my depot uploading script I wrote which creates a very basic html table of your depot items, including auno links, and uploads it to a webserver via FTP. So useful for those whom run a website and want the depot on there as well. You can incorporate it into your site, or spruce it up however you like. I run the script via a cron once a day.

EDIT: Removed file for download as older version, see post further on in thread.
Title: Re: Guild Depot
Post by: pusikas on February 10, 2007, 01:57:45 pm
For some reason, the
Code: [Select]
if (is_writable($filename)) {is always false for me, so the script always complains about not being able to write the file. If I comment this out, the HTML file gets created and uploaded as it should. *shrug* So it kinda works for me, except for that strange glitch. Thanks for a nice addition to he depot. :)
Title: Re: Guild Depot
Post by: Dabaron on February 12, 2007, 11:39:23 am
Last change for this hopefully, at least for my usability requirements. I've added a quantity add function so if I'm adding items identical to ones already in the depot, I just need to raise the amount instead of adding as a separate item. Links in list and search now have
  • [-] instead of [remove] to allow quick control of inventory quantities.


Another minor change, it won't spam the depot list if you get a command wrong anymore. The list will only be displayed on !depot list instead of just !depot as org members would get a command wrong in a tell and wait for 16 pages of items.

There is an error with your syntax for the - in the blob.... still trying to figure out exactly what it is but it keeps killing bot with what it says is an error on line 160.
Title: Re: Guild Depot
Post by: redmagician on February 13, 2007, 05:49:00 am
Very nice module.

One of my org-mates is a help-a-holic so she went crazy when I dropped this into the bot. *looks at over 3000 entries just from her in the past day or so*

I've run into a few 'problems' though

1) On the uploading script is_writable checks to see if the file is writable *and* if it exists so it pretty much always errors if the module is run for the first time

I see two solutions to this, either mention it somewhere so the person running the bot can create an empty file with the filename

OR write the file anyway if it doesn't exist (maybe by using file_exists somewhere in there?)

2) Theres also a problem with the way the ql is extracted. Its assumed the ql starts at character 24 but this isn't always true, theres a few that start at 22 (nanos and belts from what she's told me, she's literally crazy about the module...)

I'm not quite sure what I'll do to fix this on my end, I'll probably check the previous few characters for a '/' and start on the character right after.
Title: Re: Guild Depot
Post by: Malosar on February 13, 2007, 03:28:02 pm
Fixed parsing of ql to use an exploded array of the itemref instead of counting characters. Also fixed an incorrect response for gc on adding item with quantity. Removed is_writable check on depotftp.php and added more feedback on processes in case of errors.

Previous post files updated.
Title: Re: Guild Depot
Post by: Malosar on March 08, 2007, 05:02:54 pm
Updated Depot again. Added private bank functions to allow personal banks that cannot be searched or accessed by anyone but you and your alts. The module will search any items on any of your alts listed in the db and allow control from any character on your alts list as well. Also updated control on your own items in the public org bank to allow from any of your listed alts.

Commands are now split (mostly) between !depot (public org bank) and !bank (private bank only).

Also added a request function, with link in the blob for easy request access. Clicking the link has the bot send a tell to the item holder advising the name, itemname and id.

Updated depotftp.php to retrieve public only items for ftp'ing.

Existing depot users will need to update their sql table:
Code: [Select]
update depot add column private boolean;

Update: Fixed a couple of issues as stated further on in thread
Title: Re: Guild Depot
Post by: Ozball on March 10, 2007, 06:51:38 am
Not sure if its somthing I'm doing wrong or what, but having a couple issues with the module.

1. After doing !depot list it displays the output fine, but then displays a second line saying "/tell Tvbot !help !depot/bank"
eg.
To [Tvbot]: !depot list
[Tvbot]: Item List
[Tvbot]: /tell Tvbot !help !depot/bank

2. When doing !depot add <item> without a number after it I get the following in the console.

"Warning: Missing argument 4 for depot::depot_add(). called in <path>\Depot.php on line 57 and defined in <path>\Depot.php on line 126
MySQL error (# 0) on query: INSERT INTO depot (id, itemName, itemURL, ql, amount, contributorID, private) VALES ('1173505348', 'Flurry of Blows', 'itemref://85907/85908/27', '27', '1', 'Sidus',)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1"

and then the item doesnt add to the list (even though the bot out puts that it has been added, !depot list doesnt show it).

One final question ^^ with the depotftp are we ment to open the file and manually put in the dbname, dbpass etc?

Other than that, awesome module :D
Title: Re: Guild Depot
Post by: Malosar on March 10, 2007, 03:27:03 pm
hmm guess my testing wasn't as thorough as I thought, seemed to be working fine. I'll check it out over the weekend and see if I can track down the problems.

First thing though is "VALES" should be "VALUES", not sure how that could have changed. It's also not adding the private setting there.

Also, yes you are supposed to edit the depotftp.php and enter all the values for the db, ftp etc.
Title: Re: Guild Depot
Post by: Ozball on March 10, 2007, 04:18:06 pm
The VALES is my typo sorry. It is VALUES.
Title: Re: Guild Depot
Post by: Ozball on March 11, 2007, 07:27:55 am
Been playing with trying to get depotftp working, and keep running into a problem with, I think, the way im putting in the ftp server.

At the moment what I have is:

$ftpserver="ftp://ftp.terminalvelocity-ao.com/";

and I get:

[11-Mar-2007 16:52:58] PHP Warning:  ftp_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known.  in F:\Tvbot\BeBot_v0.2.11\modules\depotftp.php on line 60
[11-Mar-2007 16:52:58] PHP Warning:  ftp_login() expects parameter 1 to be resource, boolean given in F:\Tvbot\BeBot_v0.2.11\modules\depotftp.php on line 62

I'm assuming the second warning is due to the first one, but the first one I cant seem to avoid. I've tried numorus ways of putting the ftp server, without the ftp://, with http:// instead of the ftp:// even tried with the username and password in the path and nothing seems to work. Any idea what I'm doing wrong?  :-\
Title: Re: Guild Depot
Post by: Vhab on March 11, 2007, 09:41:36 am
should be without ftp:// and / afaik.
double-checked the domain name?
Title: Re: Guild Depot
Post by: Ozball on March 11, 2007, 02:36:45 pm
O.o I could have sworn I tried that.... maybe I had the / at the end before or somthing.... Works now though thanks :)
Title: Re: Guild Depot
Post by: Malosar on March 12, 2007, 02:01:33 pm
Fixed errors on depot add, had missed a private setting on one of the depot add function calls. Fixed the selection for main/alts items and owner checks.

Updated previous post with newer Depot.php
Title: Re: Guild Depot
Post by: Malosar on March 12, 2007, 10:53:49 pm
argh fixed another problem with sql selection on search....
Title: Re: Guild Depot
Post by: Monery on October 09, 2007, 10:16:17 am
Is this project still being worked on? if so I would very much love to place this on my bot cause I have had several members ask me if there is such a thing and I can't seem to get it to work on bebot 0.4.x
SimplePortal 2.3.7 © 2008-2024, SimplePortal