Broker dump

dozzier

Active Member
Would there be a way that you could have a script go through the broker say looking for drink or food or whatever you specify and have it do a total of each of the items and dump it to a text file. IE 400 peach brandy 500 artery Punch,

Reason iam wondering about this is so you can see whats selling on your server and whats not. You could run it say for a week and see whats selling on your server. This would help alot i think being it would cover all the tier ranges. Low end and high end items and give you an idea of what to make instead of making alot of diffrent things and hope one or two sells.

Just an idea i thought i would toss out and see if it was possible or even worth having.
 

ownagejoo

Well-Known Member
Yes you can, there is a broker option and it will search on anything that is in the pulldown menu on the broker. I created on that would do a total search of the broker.

The biggest problem is that it is a real time search, so if things get bought as its searching it messes it up a bit, let me see if I have it still and will post it.

OAJ - edit this should get you started on what you want, it does a total search of everything on the broker

function main()
{
variable int MerchantItems = 1
variable int TotalPages = 1
variable int FileCount = 1

variable file VendorFile = "${LavishScript.HomeDirectory}/Scripts/Vendor_${FileCount}.txt"

broker minprice 1 maxprice 99999999999 Sort ByNameAsc

wait 10

VendorFile:Open

wait 1

do
{
Vendor:GotoSearchPage[${TotalPages}]
do
{
VendorFile:Write["${Vendor.Item[${MerchantItems}].Name}:::${Vendor.Item[${MerchantItems}].Price}\n"]
echo "${Vendor.Item[${MerchantItems}].Name} ::: ${Vendor.Item[${MerchantItems}].Price}\n"
wait .5
}
while ${MerchantItems:Inc} <= ${Vendor.NumItemsForSale}
wait 1
MerchantItems:Set[1]
echo end page ${TotalPages}
}
while ${TotalPages:Inc} <= ${Vendor.TotalSearchPages}
wait 10
VendorFile:Close

}
 

dozzier

Active Member
Pygar helped me on this. The echo is messed up but it will pull item naem amount and price. Works great then can import it into excel. Thanks for the code to play with.

Code:
function main()
{
variable int MerchantItems = 1
variable int TotalPages = 1
variable int FileCount = 1

variable file VendorFile = "${LavishScript.HomeDirectory}/Scripts/test_${FileCount}.txt" 

broker minprice 1 maxprice 99999999999 Sort ByNameAsc -Type food|

wait 10 

VendorFile:Open

wait 1

do
{
Vendor:GotoSearchPage[${TotalPages}] 
do
{
VendorFile:Write["${Vendor.Item[${MerchantItems}].Name}:::${Vendor.Item[${MerchantItems}].Price}:::${Vendor.Item[${MerchantItems}].Quantity}\n"]
echo "${Vendor.Item["${Vendor.Item[${MerchantItems}].Name}:::${Vendor.Item[${MerchantItems}].Price}:::${Vendor.Item[${MerchantItems}].Quantity}\n"
wait .5
}
while ${MerchantItems:Inc} <= ${Vendor.NumItemsForSale}
wait 1
MerchantItems:Set[1]
echo end page ${TotalPages}
}
while ${TotalPages:Inc} <= ${Vendor.TotalSearchPages}
wait 10
VendorFile:Close

}
 
Top Bottom