Sell Items to Vendor

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Bigguy70
a ghoul
a ghoul
Posts: 85
Joined: Tue Sep 27, 2005 9:08 am

Sell Items to Vendor

Post by Bigguy70 » Fri Dec 30, 2005 12:31 pm

Here is 2 versions of item seller I put together Any uses find and the uses Equal to compare.

Code: Select all

| BGSellAny.mac
| Author: Bigguy70
|
| OPEN VENDOR WINDOW BEFORE STARTING.
| Usage: /macro BGSell.mac "Item Name"
|
| spelling does not have to be exact ie /macro bgsell.mac "rat"
| will sell any item with RAT in the name including "iron RATions"
|
| Only Items in an OPEN CONTAINER will be sold.  This macro does not
| sell items equiped or those in main inventory.
|
| /keypress ctrl+b is personal setting for open all bags (in EQ under keys)

#include common.inc

#Event junk       "#*#you absolutely nothing#*#"

Sub Main(string ItemToSell)
   /declare container int local
   /declare slot int local
   /declare OldMoney int Outer                                  
   /declare NewMoney int Outer                                  
   /declare junk_item 				int 		outer 0 
                               
   /keypress ctrl+b
   
   /if (!${Window[MerchantWnd].Open}) /call EndMacro "You must open the merchant window before running this macro."
   /for container 1 to 8
   	/echo Working Pack ${container}
      /for slot 1 to ${InvSlot[pack${container}].Item.Container}
             /if (${InvSlot[pack${container}].Item.Item[${slot}].ID}) {
                  /shiftkey /itemnotify in pack${container} ${slot} leftmouseup
                  /if (${ItemToSell.Equal[all]}) {
											/call sell
									} else {
                  /if (${SelectedItem.Name.Find[${ItemToSell}]}) {
                  	/call Sell
                  }
                  }
                }
                  /delay 1s
            /next slot
   /next container
   /cleanup
/return

Sub Event_junk
	/varset junk_item 1
	/return

Sub Sell
	/doevents
	
	/if (${junk_item}==0) {
		:Selling
      /delay 1s
      /varset OldMoney ${Me.Cash}
      /nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup

   :WaitSell
      /varset NewMoney $(Me.Cash}
      /if (${NewMoney}==${OldMoney}) /goto :WaitSell
  }
	
	/varset junk_item 0
	/return
Specific Item version:

Code: Select all

| BGSell.mac
| Author: Bigguy70
|
| OPEN VENDOR WINDOW BEFORE STARTING.
| Usage: /macro BGSell.mac "Item Name"
|
| spelling must be exact ie /macro bgsell.mac "rat paw"
|
| Only Items in an OPEN CONTAINER will be sold.  This macro does not
| sell items equiped or those in main inventory.
|
| /keypress ctrl+b is personal setting for open all bags (in EQ under keys)

#include common.inc

#Event junk       "#*#you absolutely nothing#*#"

Sub Main(string ItemToSell)
   /declare container int local
   /declare slot int local
   /declare OldMoney int Outer                                  
   /declare NewMoney int Outer                                  
   /declare junk_item 				int 		outer 0 
    
    /doevents
                               
   /keypress ctrl+b
   
   /if (!${Window[MerchantWnd].Open}) /call EndMacro "You must open the merchant window before running this macro."
   /for container 1 to 8
   /if (!${Window[pack${container}].Open}) /next container
      /for slot 1 to ${InvSlot[pack${container}].Item.Container}
             /if (${InvSlot[pack${container}].Item.Item[${slot}].ID}) {
                  /shiftkey /itemnotify in pack${container} ${slot} leftmouseup
                  /doevents
                  /if (${ItemToSell.Equal[all]}) {
											/call sell
									} else {
                  /if (${SelectedItem.Name.Equal[${ItemToSell}]}) {
                  	/call Sell
                  }
                  }
                }
                  /delay 5
            /next slot
   /next container
   /cleanup
   /echo Done
/return

Sub Event_junk
	/varset junk_item 1
|	/echo junk
	/return

Sub Sell
	/doevents
	
	/if (${junk_item}==0) {
		:Selling
      /delay 1s
      /varset OldMoney ${Me.Cash}
      /nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup

   :WaitSell
      /varset NewMoney $(Me.Cash}
      /if (${NewMoney}==${OldMoney}) /goto :WaitSell
  }
	
	/varset junk_item 0
	/return
Common.inc (found on board..don't remember author)

Code: Select all

| common.inc Common Subroutines
| Converted 4/30/2004
| Last Update: 12/6/2004

| Wait for cursor to contain something.
Sub WaitForPickup
:waiting
   /delay 1
   /if (!${Cursor.ID}) /goto :waiting
/return

|Wait for cursor to become empty.
Sub WaitForDrop
:waiting
   /delay 1
   /if (${Cursor.ID}) /goto :waiting
/return

| Send everything on cursor to inventory.
Sub ClearCursor
:Loop
   /if (${Cursor.ID}) {
      /autoinv
      /delay 5
   }
   /if (${Cursor.ID}) /goto :Loop
/return

|Pause while self is targeted.
Sub Pause
   /if (!${String[${Target}].Equal[${Me}]}) /return
   /echo Pausing!! To resume, type /target clear or target something else.
   :HoldingPattern
      /delay 20
      /if (${String[${Target}].Equal[${Me}]}) /goto :HoldingPattern
/return

| Error reporting.
Sub EndMacro(Error)
   
   /echo An error has occured..${Error} ending macro.
   /beep
   /endmacro
/return

Sub OpenDoor(string Dir)
   /declare Angle int local
   /if (${Dir.Equal[NORTH]}) {
      /varset Angle 0
   } else /If (${Dir.Equal[WEST]}) {
      /varset Angle 90
   } else /If (${Dir.Equal[SOUTH]}) {
      /varset Angle 180
   } else /If (${Dir.Equal[EAST]}) {
      /varset Angle 270
   } else {
      /echo Error in OpenDoor - invalid parameter
      /beep
      /endmacro
   }
   /face Heading ${Angle}
   /delay 10
   /keypress USE
   /delay 10
/return

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 1:40 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 1:41 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 1:42 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 1:44 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:20 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:21 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:22 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:23 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:24 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:25 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:27 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:28 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:29 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Sell Items to Vendor

Post by xyilla » Mon Jun 30, 2025 2:30 pm