Moderator: MacroQuest Developers
Code: Select all
Sub Main
/declare OldMoney int Outer
/declare NewMoney int Outer
/declare ItemToSell string Outer
/varset ItemToSell ${Param0}
/call Sell
/return
Sub Sell
/autoinv
:Finding
/if (${FindItemCount[${ItemToSell}]}==0) /goto :Done
/itemnotify ${FindItem[${ItemToSell}].InvSlot} leftmouseup
:WaitFind
/if (${Bool[${SelectedItem}]}==FALSE) /goto :WaitFind
:Selling
/delay 1s
/varset OldMoney ${Me.Cash}
/shift /notify MerchantWnd MW_Sell_Button leftmouseup
:WaitSell
/varset NewMoney $(Me.Cash}
/if (${NewMoney}==${OldMoney}) /goto :WaitSell
/goto :Finding
:Done
/echo No more to sell!!!
/endmacro
/return
