Selling Macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

User avatar
Hades0721
a lesser mummy
a lesser mummy
Posts: 31
Joined: Sun Apr 11, 2004 4:57 pm
Contact:

Selling Macro

Post by Hades0721 » Sat Apr 24, 2004 3:09 pm

Having problems getting this macro to run. It won't parse the FindItem command. Says that an unparseable string of text was detected.

Code: Select all

| - SellItem.mac - 
| 
| Usage: /macro SellItem "Bottle of Milk" 
| 11/21/03 

| #event Selling "for the Electrum Malachite Bracelet."


Sub Main 
   /declare OldMoney global 
   /declare NewMoney global 

   /autoinv 
   

   :Finding 
      /newif (!${FindItem[@Param0].ID}) /goto :Done 
      ${FindItem[@Param0].InvSlot} 

   :WaitFind 
      /newif (!${SelectedItem[@Param0].ID}) /goto :WaitFind 

/doevents

   :WaitSell 
      /varset NewMoney ${Me.Cash} 
      /newif (@NewMoney==@OldMoney) /goto :WaitSell 
      /goto :Finding 

   :Done  
      /endmacro 

/return 

Sub Event_Selling
   :Selling 
      /delay 1s 
      /varset OldMoney ${Me.Cash} 
      /shiftkey /notify MerchantWnd MW_Sell_Button leftmouseup 
/return
"I'm Goin' to Hell. Who's comin' with me?" - Eminem

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Selling Macro

Post by wassup » Sat Apr 24, 2004 3:53 pm

Hades0721 wrote:Having problems getting this macro to run. It won't parse the FindItem command. Says that an unparseable string of text was detected.

Code: Select all

| - SellItem.mac - 
| 
| Usage: /macro SellItem "Bottle of Milk" 
| 11/21/03 

| #event Selling "for the Electrum Malachite Bracelet."


Sub Main 
   /declare OldMoney global 
   /declare NewMoney global 

   /autoinv 
   

   :Finding 
      /newif (!${FindItem[@Param0].ID}) /goto :Done 
      ${FindItem[@Param0].InvSlot} 

   :WaitFind 
      /newif (!${SelectedItem[@Param0].ID}) /goto :WaitFind 

/doevents

   :WaitSell 
      /varset NewMoney ${Me.Cash} 
      /newif (@NewMoney==@OldMoney) /goto :WaitSell 
      /goto :Finding 

   :Done  
      /endmacro 

/return 

Sub Event_Selling
   :Selling 
      /delay 1s 
      /varset OldMoney ${Me.Cash} 
      /shiftkey /notify MerchantWnd MW_Sell_Button leftmouseup 
/return
The bottle of milk holds an Electrum Malachite Bracelet? How interesting...

Skye
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Jan 08, 2004 10:17 pm

Post by Skye » Mon May 03, 2004 12:47 am

I wrap this around an INI-driven list of items that I don't ever want to keep. I kind of hacked this around to get it back to the poster's format - hope it helps.

[--edit--] Oh, this assumes that your packs are open - otherwise the /ctrlkey /itemnotify code will fail.

Code: Select all

Sub SellItem
	/declare OldMoney	int	local	0
	/declare NewMoney	int	local	0

	/autoinv 

	:Finding 
		/if (${FindItemCount[${Param0}]}==0) /goto :Done
		/ctrlkey /itemnotify ${FindItem[${Param0}].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 

/return 

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Mon May 03, 2004 1:18 am

Post this in the new macro help forum please. Probably get better response.