Sell Item Help

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

Mry0y0
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Sep 28, 2003 6:28 pm

Sell Item Help

Post by Mry0y0 » Mon Dec 08, 2003 3:08 pm

Code: Select all

| - SellItem.mac - 
| 
| Usage: /macro SellItem "Item Name" 
| 11/21/03 
#turbo
Sub Main 
/target MerchantName   
/press u
/delay 10   
   /declare OldMoney local 
   /declare NewMoney local 

   /autoinv 
   /sendkey down shift 

   :Finding 
      /if n $count("@Param0")==0 /goto :Done 
      /finditem "@Param0" 

   :WaitFind 
      /if "$cursor()"=="FALSE" /goto :WaitFind 

   :Selling 
      /varset OldMoney $char(cash)      
      /sellitem $selecteditem(count) 
      /click left merchant sell 

   :WaitSell 
      /varset NewMoney $char(cash) 
      /if n @NewMoney==@OldMoney /goto :WaitSell 
      /goto :Finding 

   :Done 
      /sendkey up shift 
      /click left merchant done
      /endmacro 

/return 
Here's a script I got elsewhere, that I modified a little bit, on Selling -Which works fine for me it does all I want it to do except I got it to open the merchant but how do I make it auto-open the inventory and like the first 2 bags or all of the bags etc... and then how do I make it close the bags after it clicks done on the merchant?

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Mon Dec 08, 2003 3:35 pm

Code: Select all

/if $invpanel==FALSE /press i
/finditem "@Param0" 
Finds an item in your inventory by name.
similar Searches for substrings in name.
Opens pack if needed, clicks it, and closes pack again if it was closed.
And add

Code: Select all

/cleanup
Cleans up open windows and then reopens inventory
Sends ESC, ESC, ESC, ESC, ESC, I
By the way, might try using the manual and continuing with the current thread that you got the code from.

http://macroquest2.com/phpBB2/viewtopic.php?t=3784

Bob

...

Sephin
orc pawn
orc pawn
Posts: 25
Joined: Fri Nov 28, 2003 2:33 pm

Post by Sephin » Tue Dec 09, 2003 12:34 am

Didnt work for me... I used...

Code: Select all

#turbo
Sub Main 
/target Merchant
/face
/press u 
/delay 10    
   /declare OldMoney local 
   /declare NewMoney local 

   /autoinv

   :Finding 
      /click right inv 1
      /delay 2
      /click right inv 2
      /delay 2
      /click right inv 3
      /delay 2
      /click right inv 4
      /delay 2
      /click right inv 5
      /delay 2
      /click right inv 6
      /delay 2
      /click right inv 7
      /delay 2
      /click right inv 8
      /delay 2
      /if n $count("@Param0")==0 /goto :Done 
      /finditem "@Param0" 

   :WaitFind 
      /if "$cursor()"=="FALSE" /goto :WaitFind 

   :Selling 
      /varset OldMoney $char(cash)      
      /sellitem $selecteditem(count) 
      /click left merchant sell 

   :WaitSell 
      /varset NewMoney $char(cash) 
      /if n @NewMoney==@OldMoney /goto :WaitSell 
      /goto :Finding 

   :Done 
      /sendkey up shift 
      /click left merchant done 
      /endmacro 

/return 
Weird it would open all bags and then it would go to buy item that is selected on vendor. Do I /selectitem "Metal Bits" or what do I do ?

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

Post by wassup » Tue Dec 09, 2003 6:31 am

Code: Select all

:WaitFind 
      /if "$cursor()"=="FALSE" /goto :WaitFind
Try

Code: Select all

:WaitFind
   /if "$selectedItem()"!="@Param0" {
      /delay 0
      /goto :WaitFind
   }

Mry0y0
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Sep 28, 2003 6:28 pm

Post by Mry0y0 » Tue Dec 09, 2003 9:38 pm

By the way, might try using the manual and continuing with the current thread that you got the code from.

http://macroquest2.com/phpBB2/viewtopic.php?t=3784

Bob
Also, do not post any macro requests here. Please use the Macro Request forum for that. This is also not the place for getting help with your macro. This forum is designed for finished, (hopefully) working macros.

Thank you!
This forum is for those of you who need help with your macros, are wondering how to make your macro do something, etc... This is not a place to request macros. We've setup a special forum for macro requests. From here on out any macro requests posted in this topic will be deleted.

Please do not post threads with redundent topics like "I need help with a macro". If you are posting the thread here it is obvious that you need help with a macro.

This is also not a forum for general MacroQuest support (setting up, etc...).

Thank you!

I thought I was following the manual? Correct me if I'm wrong. =(
Thx for the help all.