SellItem.inc

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot.

Moderator: MacroQuest Developers

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

SellItem.inc

Post by bob_the_builder » Thu Feb 26, 2004 8:18 pm

Code: Select all

| - SellItem.inc - 
| Bob_the_builder
| 
| 11/21/03 
| #include SellItem
| /call SellItem "item_name"

Sub SellItem
   /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 
      /delay 1s 
      /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 
      |/endmacro 

/return 

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Mon Mar 01, 2004 1:39 am

This doesnt seem to work? It /calls the subroutine (put an echo to check) but nothing actually happens!

have tried /call SellItem "<itemname>" as well as /call SellItem similar "<itemname>"

Nothing seems to make it work! any ideas :)

Thanks!

Draekz

**EDIT**

Code: Select all

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

   
It seems to be in this code that im having my problem, it stops here..doesnt find the item..what i want it to do is find an item SIMILAR to the name you have as @Param0, from what it looks like..if it doesnt find "exactly" the parameter item, it will think there isnt any..any chance theres a way around this so that it can find a $count on similar items..not just an exact search?

Anyway, thanks for the help! thats where the sellitem.inc gets stuck! once thats fixed the thing i posted in help will be completely working 100 percent! (with a few minor glitches that wont affect your fisher in any way)

Draekz

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 Mar 01, 2004 11:00 pm

Check out the link for the macro.

I've tried to break this, just seems to work well.

Let me know though.

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

And I thought i'd post the link in the non macro area so that you can link back to the macro area. I'm no board nazi but normally post macro questiosn in the macro area... believe it or not folks do read macro area and respond.

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

But glad you got a working sell macro, might place it here also so its easy to find later.

Bob