Looking for a Macro to buy an item from a vendor then sell it back. I thought I had seen one before, but can't seem to find one. Any help finding it or writing one would be appreciated. Thanks.
| Usage:
| target the vendor
| /mac buystuff "water flask" 100
#include ninjadvloot.inc
sub main
/declare StuffToBuy string outer
/declare AmountToBuy int outer
/if (${Defined[Param0]}) {
/varset StuffToBuy ${Param0}
}
/if (${Defined[Param1]}) {
/varset AmountToBuy ${Param1}
}
/call SetupAdvLootVars
/call npc "${Taget.CleanName}"
/call Buy "${StuffToBuy}" ${AmountToBuy}
/return
Sub Main
/if (!${Window[MerchantWnd].Open}) {
/echo You need to have a merchant window open!
/end
}
/if (!${Defined[Param0]}) {
/echo Proper usage: /macro sellitem ItemName
/end
}
/declare OldMoney int Inner
/call ClearCursor
/if (${Param0.Equal[NULL]}) /return
/delay 2s
:Finding
/if (${FindItemCount[=${Param0}]}) {
/nomodkey /itemnotify ${FindItem[=${Param0}].InvSlot} leftmouseup
/delay 5 ${SelectedItem.ID}==${FindItem[=${Param0}].ID}
/if (${SelectedItem.ID}==${FindItem[=${Param0}].ID}) {
/delay 1s
/varset OldMoney ${Me.Cash}
/nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup
/delay 2s (${Me.Cash}!=${OldMoney})
}
/goto :Finding
}
/echo No more ${Param0} to sell!!!
/return
Sub ClearCursor
/declare x int local
:auto_inv
/if (${Cursor.ID}) {
/if (${Cursor.Container}) {
/for x 1 to 8
/if (!${InvSlot[pack${x}].Item.Container}) /nomodkey /itemnotify pack${x} leftmouseup
/next x
} else {
/timed 5 /autoinventory
}
/goto :auto_inv
}
/return
Yes looking for a mac to buy and sell an item back over and over for profit. This isn't on live servers, but on an eqemu server. Thanks for the help!
Sub main(param0, param1)
/declare StuffToBuy string outer
/declare AmountToBuy int outer
/if (${Defined[Param0]}) {
/varset StuffToBuy ${Param0}
}
/if (${Defined[Param1]}) {
/varset AmountToBuy ${Param1}
}
/call SetupAdvLootVars
/call npc "${Taget.CleanName}"
/call Buy "${StuffToBuy}" ${AmountToBuy}
/return
/if (${Defined[Param0]}) {
/if (${Bool[Param0]}) {
/dothatthingIwanted
} else {
/cechob "No parameters were supplied, usage: /mac buy thingtosell priceMinium"
}
}
Here are my buy and sell macs.
Buy
Code:| Usage: | target the vendor | /mac buystuff "water flask" 100 #include ninjadvloot.inc sub main /declare StuffToBuy string outer /declare AmountToBuy int outer /if (${Defined[Param0]}) { /varset StuffToBuy ${Param0} } /if (${Defined[Param1]}) { /varset AmountToBuy ${Param1} } /call SetupAdvLootVars /call npc "${Taget.CleanName}" /call Buy "${StuffToBuy}" ${AmountToBuy} /return
Sell
Code:Sub Main /if (!${Window[MerchantWnd].Open}) { /echo You need to have a merchant window open! /end } /if (!${Defined[Param0]}) { /echo Proper usage: /macro sellitem ItemName /end } /declare OldMoney int Inner /call ClearCursor /if (${Param0.Equal[NULL]}) /return /delay 2s :Finding /if (${FindItemCount[=${Param0}]}) { /nomodkey /itemnotify ${FindItem[=${Param0}].InvSlot} leftmouseup /delay 5 ${SelectedItem.ID}==${FindItem[=${Param0}].ID} /if (${SelectedItem.ID}==${FindItem[=${Param0}].ID}) { /delay 1s /varset OldMoney ${Me.Cash} /nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup /delay 2s (${Me.Cash}!=${OldMoney}) } /goto :Finding } /echo No more ${Param0} to sell!!! /return Sub ClearCursor /declare x int local :auto_inv /if (${Cursor.ID}) { /if (${Cursor.Container}) { /for x 1 to 8 /if (!${InvSlot[pack${x}].Item.Container}) /nomodkey /itemnotify pack${x} leftmouseup /next x } else { /timed 5 /autoinventory } /goto :auto_inv } /return
/call SetupAdvLootVars
/call npc "${Taget.CleanName}"
/call Buy "${StuffToBuy}" ${AmountToBuy}
#warning
Sub Main(Param0)
/if (${Defined[Param0]}) {
/if (${Param0.Length}) {
/declare thingToBuy string outer ${Param0}
/cechob "\aoAttempting to Buy and Sell ${thingToBuy}"
} else {
/cechob "\arNo parameters were supplied, usage: /mac buysell thingtosell"
/echo "\apEnding the Macro!"
/end
}
}
/call OpenAllContainers
/if (!${checkInv[${thingToBuy}]}) {
/cechob "\ayYou don't own this item"
} else {
|/goto :mainLoop
}
/if (!${checkVend[${thingToBuy}]}) {
/cechob "\ayThe Vendor doesn't have this item"
}
:mainLoop
/return
|Sub to use as a function to return if you have the item.
Sub checkInv(string buyItem)
/return ${FindItemCount[=${buyItem}]}
Sub checkVend(string buyItem)
/if (!${Window[MerchantWnd].Open}) {
/cechob "\ayYou need to open a merchant! Attempting to do that for you."
/target class Merchant
/if (${Target.Distance} < 20) {
/echo Attempting to open merchant!
/invoke ${Target.RightClick}
/delay 3s
} else /if (${Target.Race.Name.Equal[Merchant]}) {
/echo ${Target.CleanName} is to far away to open the Merchant, get closer!
} else {
/echo No Merchant in this Zone!!
/end
}
} else {
}
/return
Sub OpenAllContainers
|** Done only once declare invslot count (calculation to remove the first 23 slots because those are your worn items.) **|
/if (!${Defined[InvSlots]}) {
/declare InvSlots int outer 32
/cechob "\arAll packs opened, you must leave them open for macro to work. Move them if they are in your way!!"
}
|** Opening your inventory **|
/if (!${Window[InventoryWindow].Open}) {
/windowstate InventoryWindow open
}
|** Opening all your bags **|
/declare i int inner
/for i 23 to ${InvSlots}
/if (${Me.Inventory[${i}].Container} && !${Me.Inventory[${i}].Open}) {
/nomodkey /itemnotify pack${Int[${Math.Calc[${i}-22]}]} rightmouseup
}
/next i
/return
Sub SellToVendor(ItemToSell)
/if (${Window[MerchantWnd].Open}) {
:sell
/echo Selling ${ItemToSell}
/nomodkey /itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup
/delay 5
/nomodkey /shiftkey /notify merchantwnd MW_Sell_Button leftmouseup
/delay 2s
/if (${FindItem[${ItemToSell}].InvSlot}) /goto :sell
} else {
/cechob "You need to open a merchant! Attempting to do that for you."
/target class Merchant
/if (${Target.Distance} < 20) {
/echo Attempting to open merchant!
/invoke ${Target.RightClick}
/goto :sell
} else /if (${Target.Race.Name.Equal[Merchant]}) {
/echo ${Target.CleanName} is to far away to open the Merchant, get closer!
} else {
/echo No Merchant in this Zone!!
/end
}
}
/return
/nomodkey /shiftkey /notify merchantwnd MW_ItemList leftmouseup
/nomodkey /shiftkey /notify merchantwnd MW_ItemList cork leftmouseup
/nomodkey /shiftkey /notify merchantwnd MW_ItemList[cork].ID leftmouseup
/nomodkey /shiftkey /notify merchantwnd MW_ItemList listselect #
Sub Main
|Change Elegant Defiant Breastplate to something else to use a different item. Be sure to leave the quotes ""
/declare thingToBuy string outer "Elegant Defiant Breastplate"