Moderator: MacroQuest Developers
I have put a thing in that if you get stuck on the post it works its way around, I have tried it on a lot of people around post and it gets stuck for a second then works its way off. And the name thing, I will look into that, I'm not sure exactly how to fix that one. I will work on it though.BadBoy wrote:See, the problem with those waypoints are, if the person is behind a post, you may get stuck in the post.
Another thing I found:
When you try searching something like "10 dose ant's potion", you get "10 dose ant[]s potion" the [] signifying a box.
Code: Select all
| Bazaar Bargain Hunter - bargain.mac for release/macro folder of MQ2
| v1.4, Zornecro - 8 Oct 2004
| v1.5, Grumpy - 13 Oct 2004
|
| USAGE: /macro bargain "shopping.ini" (while you are currently inside the bazaar)
| /macro bargain "shopping.ini" 50
| The second example says you're only interested in finding items matching your
| shopping list that are discounted AT LEST 50% from your maximum pay price.
|
| Shopping.ini (in this example) would contain 1 section:
| [WantToBuy]
| Blue Diamond=150
| Delightful Orb=1000
|
| That would search for the cheapest blue diamond at or under 150pp,
| and a Delightful Orb at or under 1kpp.
| If you have a longer shopping list, add more lines like these. Don't use quote (") or bar (|) chars.
| The item on your list found at the best discount off your maximum price
| will be selected, and the trader found and the "magic rope" drawn if possible.
|================================================================================================
#turbo 40
|Define these as "/squelch /echo" to quiet down their spam
#define DEBUG_1 "/squelch /echo"
#define DEBUG_2 "/squelch /echo"
Sub Main
/declare bestItem string outer
/declare bestPrice int outer ${maxAskingPrice}
/declare bestVendor string outer
/declare bestDiscount float outer 0
/declare indx int local
/declare index2 int local
/declare iniFile string local
DEBUG_2 Attempting to open Bazaar Search window.
/windowstate BazaarSearchWnd open
/if (${Defined[Param0]} && ${String[${Param0}].Length}>0) {
/varset iniFile "${Param0}"
DEBUG_1 shopping list in file: ${iniFile}
} else {
/echo USAGE: /macro bargain "shopping.ini"
/echo Please read comments at the top of bargain.mac.
/endmacro
}
/if (${Defined[Param1]} && ${Float[${Param1}]}>0) /varcalc bestDiscount ${Param1}/100
/popup Browsing your shopping list: ${iniFile}
/call ShoppingList "${iniFile}"
/if (${Macro.Return}==0) {
DEBUG_1 Nothing at ${Math.Calc[100*${bestDiscount}]}% off...
/popup Nothing for sale you want (at ${Int[${Math.Calc[100*${bestDiscount}]}]}% off)!
} else {
DEBUG_1 List match: ${bestItem} from ${bestVendor} selling for ${bestPrice} (${Math.Calc[100 * ${bestDiscount}]}% off)
/popup Go buy ${bestItem} from ${bestVendor} at ${bestPrice} (${Math.Calc[100 * ${bestDiscount}]}% off)
/call KaChing
}
/return
|Sub: ShoppingList (see top of macro for ini file info)
|Returns: nonzero if it finds an item at or under the desired discount.
Sub ShoppingList(string iniName)
DEBUG_2 ReadINI "${iniName}" "WantToBuy"
/call ReadINI "${iniName}" "WantToBuy"
/if (!${Defined[newArray]}) /return 0
/declare indx int local
/declare maxprice[${newArray.Size}] int local
/for indx 1 to ${newArray.Size}
/varset maxprice[${indx}] ${Ini[${iniName}, WantToBuy, ${newArray[${indx}]}]}
DEBUG_2 ${newArray[${indx}]}=${maxprice[${indx}]}
/next indx
DEBUG_2 have ${newArray.Size} Shopping list items to check...
/declare sli int local
/declare bi int local
/declare discount float local 0
/for sli 1 to ${newArray.Size}
/delay 10 ${Bazaar.Done}
DEBUG_2 Checking ${newArray[${sli}]} for <= ${maxprice[${sli}]}...
/bzsrch race any class any stat any slot any type any price 0 ${maxprice[${sli}]} "${newArray[${sli}]}"
/delay 50 ${Bazaar.Done}
/if (!${Bazaar.Count}) {
DEBUG_2 None that cheap!
/goto :nextItem
}
/if (${Bazaar.Count} >= 200) {
DEBUG_1 Sure you wanted to pay ${maxprice[${sli}]} for a ${newArray[${sli}]}?
/goto :nextItem
}
/for bi 1 to ${Bazaar.Count}
/varcalc discount (${maxprice[${sli}]} - ${Math.Calc[${Bazaar.Item[${bi}].Price} \ 1000]}) / ${maxprice[${sli}]}
/if (${discount} >= ${bestDiscount}) {
/varset bestDiscount ${discount}
/varset bestItem ${Bazaar.Item[${bi}].Name}
/varset bestPrice ${Math.Calc[${Bazaar.Item[${bi}].Price} \ 1000]}
/varset bestVendor ${Bazaar.Item[${bi}].Trader.CleanName}
}
/next bi
/echo ${bestItem} for ${bestPrice} from ${bestVendor} (${Math.Calc[${bestDiscount} * 100]}%)
:nextItem
/next sli
/return ${bestItem.Length}
|Sub: KaChing - we have something to buy (in outer variables bestPrice and bestItem)
Sub KaChing
DEBUG_1 trying to find a path for you...
DEBUG_2 /bzsrch race any class any stat any slot any type any price 0 ${bestPrice} "${bestItem}"
/bzsrch race any class any stat any slot any type any price 0 ${bestPrice} "${bestItem}"
/delay 10s ${Bazaar.Done}
/if (!${Bazaar.Count}) {
/echo Find Trader failed!
} else {
/notify BazaarSearchWnd BZR_ItemList listselect 1
/delay 1s
/notify BazaarSearchWnd BZR_FindTraderButton leftmouseup
}
/return
Sub ReadINI(string fileName, string SectionName)
DEBUG_1 Attempting to Read Section [${SectionName}] from ${fileName}...
/if (${Ini[${fileName}, ${SectionName}, -1, NO].Equal[NO]}) {
DEBUG_1 Section [${SectionName}] wasn't found in File:${fileName}
/return
}
/call CountDefines "${fileName}" "${SectionName}"
/declare newArraySize int local
/varset newArraySize ${Macro.Return}
/if (${newArraySize} <= 0) {
DEBUG_1 [${SectionName}] found, but had no definitions.
/return
}
/if (${Defined[newArray]}) {
DEBUG_1 newArray Defined
/deletevar newArray
DEBUG_1 newArray deleted
}
DEBUG_1 Declaring newArray[${newArraySize}] string outer...
/declare newArray[${newArraySize}] string outer
/declare indx int local
/declare values string local
DEBUG_1 getting values from Ini
/varset values ${Ini[${fileName},${SectionName}]}
DEBUG_1 got values
/for indx 1 to ${newArraySize}
/varset newArray[${indx}] ${values.Arg[${indx},"|"]}
|DEBUG_1 newArray[${indx}]=${newArray[${indx}]}
/next indx
DEBUG_1 [${SectionName}] info Read Successfully from ${fileName}, ${newArraySize} items.
/return
Sub CountDefines(string fileName, string SectionName)
/declare theCount int local
/declare vars string local
DEBUG_1 CountDefines Ini[${fileName},${SectionName}]
/varset vars ${Ini[${fileName},${SectionName}]}
/if (${vars.Length}<1) {
DEBUG_1 null found.
/varset theCount 0
} else {
DEBUG_1 vars: ${vars}
/varcalc theCount ${vars.Count["|"]} - 1
DEBUG_1 Total: ${theCount}
/if (${theCount} < 1) /varset theCount 1
}
/return ${theCount}
Code: Select all
; Zornecro, 8 Oct 2004
; In the lines following [WantToBuy], you put item name=price
; Where the item name can be full or partial, spaces allowed.
; Put an = without a space on either side between the item and the
; maximum price you are willing to pay for it.
; PRICES ARE IN PLATINUM, not coppers!
; You might think by looking at this list it is copper, but nope, these are
; L65 spells and epic drops and other rare items that sell for LOTS on
; my server.
[WantToBuy]
Spell: Ferocity=5000
Spell: Chill Bones=500
Blood of Cazic Thule=50000
Spiroc Feathers=5000
Silver Disc=5000
Words of Awareness=1000
Words of Sapience=1000
Words of Exhiliration=1000
Spell: Sedulous Subversion=1000
Code: Select all
| Bazaar Bargain Hunter - bargain.mac for release/macro folder of MQ2
| v1.4, Zornecro - 8 Oct 2004
| v1.5, Grumpy - 13 Oct 2004
|
| USAGE: /macro bargain "shopping.ini" (while you are currently inside the bazaar)
| /macro bargain "shopping.ini" 50
| The second example says you're only interested in finding items matching your
| shopping list that are discounted AT LEST 50% from your maximum pay price.
|
| Shopping.ini (in this example) would contain 1 section:
| [WantToBuy]
| Blue Diamond=150
| Delightful Orb=1000
|
| That would search for the cheapest blue diamond at or under 150pp,
| and a Delightful Orb at or under 1kpp.
| If you have a longer shopping list, add more lines like these. Don't use quote (") or bar (|) chars.
| The item on your list found at the best discount off your maximum price
| will be selected, and the trader found and the "magic rope" drawn if possible.
|================================================================================================
#turbo 40
|Define these as "/squelch /echo" to quiet down their spam
#define DEBUG_1 /squelch /echo
#define DEBUG_2 /squelch /echo
Sub Main
/declare bestItem string outer
/declare bestPrice int outer ${maxAskingPrice}
/declare bestVendor string outer
/declare bestDiscount float outer 0
/declare indx int local
/declare index2 int local
/declare iniFile string local
DEBUG_2 Attempting to open Bazaar Search window.
/windowstate BazaarSearchWnd open
/if (${Defined[Param0]} && ${String[${Param0}].Length}>0) {
/varset iniFile "${Param0}"
DEBUG_1 shopping list in file: ${iniFile}
} else {
/echo USAGE: /macro bargain "shopping.ini"
/echo Please read comments at the top of bargain.mac.
/endmacro
}
/if (${Defined[Param1]} && ${Float[${Param1}]}>0) /varcalc bestDiscount ${Param1}/100
/popup Browsing your shopping list: ${iniFile}
/call ShoppingList "${iniFile}"
/if (${Macro.Return}==0) {
DEBUG_1 Nothing at ${Math.Calc[100*${bestDiscount}]}% off...
/popup Nothing for sale you want (at ${Int[${Math.Calc[100*${bestDiscount}]}]}% off)!
} else {
DEBUG_1 List match: ${bestItem} from ${bestVendor} selling for ${bestPrice} (${Math.Calc[100 * ${bestDiscount}]}% off)
/popup Go buy ${bestItem} from ${bestVendor} at ${bestPrice} (${Math.Calc[100 * ${bestDiscount}]}% off)
/call KaChing
}
/return
|Sub: ShoppingList (see top of macro for ini file info)
|Returns: nonzero if it finds an item at or under the desired discount.
Sub ShoppingList(string iniName)
DEBUG_2 ReadINI "${iniName}" "WantToBuy"
/call ReadINI "${iniName}" "WantToBuy"
/if (!${Defined[newArray]}) /return 0
/declare indx int local
/declare maxprice[${newArray.Size}] int local
/for indx 1 to ${newArray.Size}
/varset maxprice[${indx}] ${Ini[${iniName}, WantToBuy, ${newArray[${indx}]}]}
DEBUG_2 ${newArray[${indx}]}=${maxprice[${indx}]}
/next indx
DEBUG_2 have ${newArray.Size} Shopping list items to check...
/declare sli int local
/declare bi int local
/declare discount float local 0
/for sli 1 to ${newArray.Size}
/delay 10 ${Bazaar.Done}
DEBUG_2 Checking ${newArray[${sli}]} for <= ${maxprice[${sli}]}...
/bzsrch race any class any stat any slot any type any price 0 ${maxprice[${sli}]} "${newArray[${sli}]}"
/delay 50 ${Bazaar.Done}
/if (!${Bazaar.Count}) {
DEBUG_2 None that cheap!
/goto :nextItem
}
/if (${Bazaar.Count} >= 200) {
DEBUG_1 Sure you wanted to pay ${maxprice[${sli}]} for a ${newArray[${sli}]}?
/goto :nextItem
}
|/varcalc bestPrice ${maxprice[${sli}]} + 1
/for bi 1 to ${Bazaar.Count}
/varcalc discount (${maxprice[${sli}]} - ${Math.Calc[${Bazaar.Item[${bi}].Price} \ 1000]}) / ${maxprice[${sli}]}
/if (${discount} >= ${bestDiscount}) {
/varset bestDiscount ${discount}
/varset bestItem ${Bazaar.Item[${bi}].Name}
/varset bestPrice ${Math.Calc[${Bazaar.Item[${bi}].Price} \ 1000]}
/varset bestVendor ${Bazaar.Item[${bi}].Trader.CleanName}
}
/next bi
/echo ${bestItem} for ${bestPrice} from ${bestVendor} (${Math.Calc[${bestDiscount} * 100]}%)
:nextItem
/next sli
/return ${bestItem.Length}
|Sub: KaChing - we have something to buy (in globals bestPrice, bestProfit and bestItem)
Sub KaChing
DEBUG_1 trying to find a path for you...
DEBUG_2 /bzsrch race any class any stat any slot any type any price 0 ${bestPrice} "${bestItem}"
/bzsrch race any class any stat any slot any type any price 0 ${bestPrice} "${bestItem}"
/delay 10s ${Bazaar.Done}
/if (!${Bazaar.Count}) DEBUG_2 KaChing failed!
/notify BazaarSearchWnd BZR_ItemList listselect 1
/delay 1s
/notify BazaarSearchWnd BZR_FindTraderButton leftmouseup
/return
Sub ReadINI(string fileName, string SectionName)
DEBUG_1 Attempting to Read Section [${SectionName}] from ${fileName}...
/if (${Ini[${fileName}, ${SectionName}, -1, NO].Equal[NO]}) {
DEBUG_1 Section [${SectionName}] wasn't found in File:${fileName}
/return
}
/call CountDefines "${fileName}" "${SectionName}"
/declare newArraySize int local
/varset newArraySize ${Macro.Return}
/if (${newArraySize} <= 0) {
DEBUG_1 [${SectionName}] found, but had no definitions.
/return
}
/if (${Defined[newArray]}) {
DEBUG_1 newArray Defined
/deletevar newArray
DEBUG_1 newArray deleted
}
DEBUG_1 Declaring newArray[${newArraySize}] string outer...
/declare newArray[${newArraySize}] string outer
/declare indx int local
/declare values string local
DEBUG_1 getting values from Ini
/varset values ${Ini[${fileName},${SectionName}]}
DEBUG_1 got values
/for indx 1 to ${newArraySize}
/varset newArray[${indx}] ${values.Arg[${indx},"|"]}
|DEBUG_1 newArray[${indx}]=${newArray[${indx}]}
/next indx
DEBUG_1 [${SectionName}] info Read Successfully from ${fileName}, ${newArraySize} items.
/return
Sub CountDefines(string fileName, string SectionName)
/declare theCount int local
/declare vars string local
DEBUG_1 CountDefines Ini[${fileName},${SectionName}]
/varset vars ${Ini[${fileName},${SectionName}]}
/if (${vars.Length}<1) {
DEBUG_1 null found.
/varset theCount 0
} else {
DEBUG_1 vars: ${vars}
/varcalc theCount ${vars.Count["|"]} - 1
DEBUG_1 Total: ${theCount}
/if (${theCount} < 1) /varset theCount 1
}
/return ${theCount}
Code: Select all
#define DEBUG_1 "/squelch /echo"Code: Select all
/echo DEBUG_1Code: Select all
/squelch We are searching for...Code: Select all
/varset ${newArray}[${indx}] ${values.Arg[${indx},|]}Code: Select all
/varset newArray[${indx}] ${values.Arg[${indx},"|"]}Code: Select all
/varset vars "${Ini[${fileName},${SectionName}]}"Code: Select all
/declare wantedList[12] string outerCode: Select all
/declare foo string outer |1 of several globals needed
ok havin some issues with the bazaar buying macro... its not distinguishing prices correctly... it is trying to buy items for ALOT more pp than it is being told.... also is there a way to set it so that maybe it will calculate how much pp u have available and how many of x item you can afford?.....
here is my code... let me know if something is wrong
ive tried taking the 0's out for the copper, silver, and gold... and all it does then is try to buy items that are far over priced.... currently it wont try to buy anythingCode: Select all
#include common/bazaarbuy.inc #include common/buy.inc #include common/gogetitem.inc Sub Main /declare ItemToBuy string inner /declare HighestPriceToPay int inner /declare TotalYouWant int inner :start /varset ItemToBuy "Mudflow Stone" /varset HighestPriceToPay 1000000 /varset TotalYouWant 1 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy mudflow stone for 1kpp /varset ItemToBuy "sphalerite" /varset HighestPriceToPay 1000000 /varset TotalYouWant 1 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy saphalerite for 1kpp /varset ItemToBuy "Tourmaline" /varset HighestPriceToPay 1000000 /varset TotalYouWant 1 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy tourmaline for 1kpp /varset ItemToBuy "sphalerite" /varset HighestPriceToPay 1000000 /varset TotalYouWant 1 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy sphalerite for 1kpp /varset ItemToBuy "Dust of Discord" /varset HighestPriceToPay 500000 /varset TotalYouWant 8 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy dust of discord for 500pp /varset ItemToBuy "Pyrilen Plasma" /varset HighestPriceToPay 1000000 /varset TotalYouWant 1 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy pyrilen plasma for 1kpp /varset ItemToBuy "slugworms" /varset HighestPriceToPay 200000 /varset TotalYouWant 20 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy slugworms for 200pp /varset ItemToBuy "Discordant Scoriae" /varset HighestPriceToPay 500000 /varset TotalYouWant 20 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy discordant scoriae for 500pp /delay 600s /goto :start /return
PS ive used your other macro's override and they are awsome.... please release that tailoring one soon i would love to get my tailoring up
if i run this portion just like this....
it will find dust of discord selling for 4k each... not 500ppCode: Select all
/varset ItemToBuy "Dust of Discord" /varset HighestPriceToPay 500 /varset TotalYouWant 8 /call BazaarBuy ${ItemToBuy} ${HighestPriceToPay} ${TotalYouWant} |should buy dust of discord for 500pp