Hey everyone, this has come up a few times so i thought i would write a quick and dirty Link Database type script. Here is how it works... Basically it stores any link that comes through the chat service in VG.
How to Add items
There are 2 ways to add items to your Database.
1) Run the script and let it collect links from chat
2) Get a Database from someone else and merge it with yours
Is there and easy way to merge a DB?
Of course there is!!! I wouldn't make you add items line by line. Place the xml file you want to merge with yours in your XML folder (be careful that it isn't named VGItemDB.xml). Lets say that our file to merge is DBStarter.xml (which is included) you would type the following in your console:
run ItemDB Merge DBStarter
How to Retrieve a Link:
To get a link from the Database it is simple... in your chat window type:
/LinkItem "Channel" "Item"
where Channel is where you want it to output (say, 1, group) and Item is the Item you are looking for. Lets see a Real Life example...
/LinkItem "tell Fred" "My Uber Sword"
This will send a tell to fred with a link to My Uber Sword if it exists.
*NOTE* The quotes are important
What if an Item doesn't exist?
Simple... It will just put an echo to your console saying, "Item Not Found".
Can Other people request items from my DB?
Of course they can. All they have to do is send you a tell that looks like this:
/tell LinkBot LinkItem ~Uber Sword of Swinging~
What if someone requests a link from me that I don't have?
They Will get a tell from you saying, "Item Not Found".
*NOTE* It is suggested that you only let your most trusted friends use the Link from tell feature.
How to Add items
There are 2 ways to add items to your Database.
1) Run the script and let it collect links from chat
2) Get a Database from someone else and merge it with yours
Is there and easy way to merge a DB?
Of course there is!!! I wouldn't make you add items line by line. Place the xml file you want to merge with yours in your XML folder (be careful that it isn't named VGItemDB.xml). Lets say that our file to merge is DBStarter.xml (which is included) you would type the following in your console:
run ItemDB Merge DBStarter
How to Retrieve a Link:
To get a link from the Database it is simple... in your chat window type:
/LinkItem "Channel" "Item"
where Channel is where you want it to output (say, 1, group) and Item is the Item you are looking for. Lets see a Real Life example...
/LinkItem "tell Fred" "My Uber Sword"
This will send a tell to fred with a link to My Uber Sword if it exists.
*NOTE* The quotes are important
What if an Item doesn't exist?
Simple... It will just put an echo to your console saying, "Item Not Found".
Can Other people request items from my DB?
Of course they can. All they have to do is send you a tell that looks like this:
/tell LinkBot LinkItem ~Uber Sword of Swinging~
What if someone requests a link from me that I don't have?
They Will get a tell from you saying, "Item Not Found".
*NOTE* It is suggested that you only let your most trusted friends use the Link from tell feature.
Attachments
-
2.5 KB Views: 301
Last edited: