As suggested by Sicprofundus
Any issues let me know.
Added /dive buyall # option to buy all tradeskill items under # plat.
Added zonename to merchant list heading. If you already have entries in your ini you will need to edit to add the zone shortname manually, such as [poknowledge-Merchants]
Added Partial matching for item names. You will need to add the entry to the ini file manually, such as
[Items]
Immaculate=1
To stop buying an item you need to manually remove the entry. Setting it to 0 does not disable it.
Rich (BB code):
| dumpsterdive.mac - Sym 8.18.2017 exclusively for RedGuides.com
|
| Runs around checking merchants for items others have sold
| Requires MQ2Nav
| This macro will buy all items listed in your ini. This may be expensive.
| It can also buy every tradeskill tagged item it sees. This may be VERY expensive.
| ******************************************************************************************
| ******************************************************************************************
| **** ****
| **** If you try to buy an infinite default stock item it will fill up your inventory. ****
| **** ****
| ******************************************************************************************
| ******************************************************************************************
|
| To use partial name matching you will need to add the entry to the ini file manually.
|
| Usage: /mac dumpsterdive
|
| Once running the following commands are available.
|
|/dive merchant
| Add targeted merchant to ini under the [Zone.ShortName-Merchants] heading
|
|/dive item
| Add item on cursor to ini then autoinventory the item
|
|/dive start
| Starts buying loop
|
|/dive buyall XX
| Starts buying loop and will buy ALL non default stock tradeskill items under XXp
#bind DiveCommand /dive
sub Main
/declare IniFile string outer dumpsterdive.ini
/declare BuyType int outer 0
/declare MaxBuyPrice int outer 0
/echo \atDumpsterDive.mac :: v1.1 :: by Sym for RedGuides.com
/echo \atCheck all listed merchants for items you want to buy
/echo \at
/echo \ag/dive merchant\ay - Add target to merchant list
/echo \ag/dive item\ay - Add item on cursor to buy list
/echo \ag/dive start\ay - Start buying
/echo \ag/dive buyall #\ay - Start buying and buy \ar**ALL**\ay items tagged as tradeskill that are less than # plat each
:WaitForCommand
/doevents
/delay 1
/goto :WaitForCommand
/return
Sub Bind_DiveCommand
/if (${Param0.Equal[start]}) /call BuyLoop
/if (${Param0.Equal[merchant]}) /call AddMerchant
/if (${Param0.Equal[item]}) /call AddItem
/if (${Param0.Equal[buyall]}) {
/varset BuyType 1
/varset MaxBuyPrice ${Param1}
/call BuyLoop
}
/return
sub AddMerchant
/if (!${Target.ID}) {
/echo \arTarget the merchant first!
/return
}
/ini ${IniFile} ${Zone.ShortName}-Merchants "${Target.CleanName}" 1
/echo \atAdded \ag${Target.CleanName}\at to ini file.
/return
sub AddItem
/if (!${Cursor.ID}) {
/echo \arPut an item on your cursor first!
/return
}
/ini ${IniFile} Items "${Cursor.Name}" 1
/echo \atAdded \ag${Cursor.Name}\at to ini file.
/autoinv
/return
sub BuyLoop
/declare MerchantCount int local ${Ini[${IniFile},${Zone.ShortName}-Merchants].Count[|]}
/if (!${MerchantCount}) {
/echo \arYou need to add a merchant to the ini file!
/endmac
}
/varcalc MerchantCount ${MerchantCount}-1
/declare a int local
/for a 1 to ${MerchantCount}
/echo \atBuying from \ag${Ini[${IniFile},${Zone.ShortName}-Merchants].Token[${a},|]}
/call NavToMerchant "${Ini[${IniFile},${Zone.ShortName}-Merchants].Token[${a},|]}"
/next a
/return
sub NavToMerchant(string MerchantName)
/echo \atNavigating to \ag${MerchantName}
/target npc ${MerchantName}
/delay 1s
/if (!${Target.ID}) /return
:WaitTarget
/if (!${Me.Speed}) /nav target
/if (!${Target.ID}) /return
/delay 3
/if (${Target.Distance}>15) /goto :WaitTarget
/nav stop
/delay 1s
/nomodkey /click right target
/delay 5s ${Merchant.Open}
/e \atWaiting for merchant to populate
:WaitPopulate
/if (!${Merchant.Open}) /return
/delay 5
/if (!${Merchant.Items}) /goto :WaitPopulate
/delay 5
/if (${BuyType}) {
/call BuyAllTradeskillItems
} else {
/call BuyItems
}
/return
sub BuyItems
/echo \atStarting buy from \ag${Target.CleanName}
/declare a int local
/declare b int local
/declare c int local
/declare ItemName string local
/declare ListID string local
/declare IsDefaultItem int local
/declare ItemCount int local ${Ini[${IniFile},Items].Count[|]}
/if (!${ItemCount}) {
/echo \arYou need to add an item to the ini file!
/endmac
}
/varcalc ItemCount ${ItemCount}-1
:StartBuy
/for a 1 to ${ItemCount}
/if (!${Me.FreeInventory}) /return
/if (!${Merchant.Open}) /return
/varset IsDefaultItem 0
/varset ItemName ${Ini[${IniFile},Items].Token[${a},|]}
/varset ListID ${Window[MerchantWnd].Child[ItemList].List[${ItemName},2]}
/if (${Window[MerchantWnd].Child[ItemList].List[${ListID},3].Equal[--]}) /varset IsDefaultItem 1
/if (!${IsDefaultItem} && ${ListID}) {
/echo \atBuying \ag${Window[MerchantWnd].Child[ItemList].List[${ListID},2]}
/delay 5
/notify MerchantWnd ItemList listselect ${ListID}
/nomodkey /shiftkey /notify MerchantWnd MW_Buy_Button leftmouseup
/delay 1s
/goto :StartBuy
}
/next a
/if (${Window[MerchantWnd].Open}) /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp
/delay 1s
/return
sub BuyAllTradeskillItems
/echo \atStarting buy of \ar**ALL**\at tradeskill items under ${MaxBuyPrice}p from \ag${Target.CleanName}
/declare a int local
/declare ListID string local
/declare ItemPrice string local
/declare IsDefaultItem int local
:StartBuy
/for a 1 to ${Merchant.Items}
/if (!${Me.FreeInventory}) /return
/if (!${Merchant.Open}) /return
/varset IsDefaultItem 0
/varset ListID ${Window[MerchantWnd].Child[ItemList].List[=${Merchant.Item[${a}]},2]}
/varset ItemPrice ${Int[${Window[MerchantWnd].Child[ItemList].List[${ListID},4]}]}
/if (${Window[MerchantWnd].Child[ItemList].List[${ListID},3].Equal[--]}) /varset IsDefaultItem 1
/if (!${IsDefaultItem} && ${Merchant.Item[${a}].Tradeskills} && ${ItemPrice} < ${MaxBuyPrice}) {
/echo \atBuying \ag${Merchant.Item[${a}]}
/delay 5
/notify MerchantWnd ItemList listselect ${ListID}
/nomodkey /shiftkey /notify MerchantWnd MW_Buy_Button leftmouseup
/delay 1s
/goto :StartBuy
}
/next a
/if (${Window[MerchantWnd].Open}) /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp
/delay 1s
/return
Any issues let me know.
Added /dive buyall # option to buy all tradeskill items under # plat.
Added zonename to merchant list heading. If you already have entries in your ini you will need to edit to add the zone shortname manually, such as [poknowledge-Merchants]
Added Partial matching for item names. You will need to add the entry to the ini file manually, such as
[Items]
Immaculate=1
To stop buying an item you need to manually remove the entry. Setting it to 0 does not disable it.
Last edited:



