Pugs
Member
- Joined
- Feb 6, 2005
- RedCents
- 654¢
This is just a little thing i cut and mod out of the other one to make it go faster and safer for finding items that are below price in the Bazaar. You must run to every trader open it and give it a min to search through it but it is a ton faster than the warp one.
Rich (BB code):
|Slumin
|edited from other macs Sorry don't rember aouther but props on a nice one
|By Pugs
#include common\buy.inc
#define DEBUG_1 /echo
#define DEBUG_2 /echo
Sub main
:loop
/if (${Merchant.Open}) /call TraderDive 8.5
/goto :loop
/return
Sub TraderDive(float percentNeeded)
/declare priceToBuy int local
/declare priceToSell int local
/declare profit int local
/declare profitPc float local
/declare iteration int local
/declare totalItems int local ${Merchant.Items}
/if (${totalItems}<1) /return
/varcalc percentNeeded 1.0+${Math.Calc[${percentNeeded}/100]}
/for iteration 1 to ${totalItems}
/if (${Merchant.Open}&&(${iteration}<=${totalItems})) {
/varset priceToBuy ${Merchant.Item[${iteration}].BuyPrice}
/varset priceToSell ${Merchant.Item[${iteration}].Value}
/varcalc profit ${priceToSell}-${priceToBuy}
|Ignore items that profit less than 1pp regardless.
/if (${profit}>1000) {
/varcalc profitPc ${Math.Calc[${priceToSell}/${priceToBuy}]}
/if (${profitPc}>=${percentNeeded}) {
DEBUG_1 You can resell ${Merchant.Item[${iteration}].Name} at ${Math.Calc[${profitPc}*100.0].Int}% buying price.
|/mqpause
/popup Buying ${Merchant.Item[${iteration}].Name} from ${Merchant.Name}
/call PCBuy "${Merchant.Item[${iteration}]}" 20
} else {
DEBUG_2 Profit on ${Merchant.Item[${iteration}]} was ${profit} but only ${Math.Calc[${profitPc}*100.0].Int}%
|/mqpause
}
}
}
/next iteration
/return


