sits.mac - slightly improved ts.mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

sits.mac - slightly improved ts.mac

Post by fryfrog » Fri Jul 25, 2003 3:17 am

Please see the thread titled ts.mac - All Purpose Tradeskill Macro for a better version of sits.mac. Actually, its the original ts.mac with sits.mac's improvements and more! Also since MQ has CHANGED their scripting language you would need to use the "old" version to run these two until someone finds the time to convert them :)


I am leaving the following, but there is no reason to use it or maybe even read it.


The comments should pretty much say it all. I took the ts.mac and made it work with the currently broken /click left item and added a few features found in the todo list as well as a few new features of my own desire. Of major note is the replacement of the "keep" / "destory" portion of the command line macro launch. It can STILL be found IN the macro, and is set to "keep" by default. Instead you can specify a number, 0 for unlimited and anything else for the number of successful combines you would like. That is just more useful to me, besides i think /click left destroy is broken?

Be sure to open your inventory and arrange all your bags so they do not overlap. Then close each bag and your inventory before you start the script. If you are using an environmental container, be sure IT'S position does not overlap AND that it is open when you start the script (since /click left item crashes me).

There are a few small code optimizations, but nothing entirely mind blowing. My favorite part is actually the statistics. I have noticed about a 97% success rate on quite a few trivial items with about a 3-4% skill up rate.

NEW!
Removed some double /clicks... but they were all to /click left auto anyway.

Another thanks to Kagonis for his fix of the "env" containers. If you are using and environmental combiner, use "env" instead of its name.

Big thanks to "kagonis" for improving (and posting!) the script. He included a change that lets you increase the delay quite a bit w/o having to worry about bad clicking of items, added a "stop on trivial" feature AND fixed my "attempt to recover from failed attempt" code (quite simply and intelligently i might add!).

Thanks a bunch :)

Code: Select all

| ts.mac (slightly improved tradeskill.mac) 
| ----------------------- 
| *** DESCRIPTION *** 
| IF YOU ARE USING AN ENVIRONMENTAL CONTAINER, HAVE IT OPEN WHEN YOU START THE MACRO 
| Syntax: /macro ts <0-X> <CombinerName> <Component> [Component] [Component] [Component] [Component] [Component] [Component] [Component] [Component] [Component] 
| 
| The first option is how many successes you want, 0 means unlimited and any other number is used for how many successful combines you want 
| Can add up to 10 components and combine them in the selected combiner. (Notice, MacroQuest NEEDS to be compiled to handle more than 10 paramaters, 
| read subnote on what file to edit, and what line.) Can specify wether to keep or destroy the finished product INSIDE THE SCRIPT, returned components 
| WILL NOT be destroyed, only the new item(s), that isn't part of the component list. As a precaution, it must specifically say "destroy" (case doesn't 
| matter, case insensitive), if it says anything else it will keep the end product. 
| 
| To speed up the macro I put in #turbo and /delay's after just about each mouse movement. The delay is defined the ghe global variable $dly 
| Set wether to abort macro on tell or to ignore it with the global variable $abt 
| 
| Scroll down to "VARIABLES TO LOOK AT!" for some user setable variables 
| 
| *** FEATURES *** 
| - Pause script by targeting self 
| - Combine X number of successes (or unlimited) 
| - Keep or Destory result (set inside script, not from cmd line) 
| - Turn on/off display of statistics 
| - Statistics about combines such as trivial combines, successes, failures, skillups, % of successes and % of skillups 
| - Trivial warning 
| - Failed combine DNC recovery, cleans pack and retries.  If no error in 5 more attempts will reset and not exit. 
| - Can use wildcard matching "#ShortName" instead of "Pieces of ShortName" (included in previous version, but not mentioned) 
| 
| *** CREDITS *** 
| These are the persons I know I borrowed code from, I'm sure I forgot some.. 
| -- 
| General idea, and many of the sub routines from: 
| - Gengis (http://macroquest2.com/phpBB2/viewtopic.php?p=4759#4759) 
| - Pigeon (http://macroquest2.com/phpBB2/viewtopic.php?p=15523#15523) 
| 
| - #Wildcard sub routine idea from Serberus (http://macroquest2.com/phpBB2/viewtopic.php?p=9443#9443) 
| 
| 
| *** TODO *** 
| - Rumors say that when using "destroy", the macro is not working completely as intended. Investigating. 
| - !DONE BY FRYFROG! Thinking about adding some statistic Sub Routines, as in Zeuz's macro (http://macroquest2.com/phpBB2/viewtopic.php?p=16800#16800) 
| - !DONE BY FRYFROG! On CombineError, make the macro "/call CleanPack" 1 time, then retry combine. If CombineError 2 times in a row then "/call EndCombines". 
| 
| 
| *** SUB NOTE *** 
| Before compiling MacroQuest (note; the search strings are without the quotes): 
| - OPEN "EQLib\MQ.h" 
| - FIND "#define MAX_STACKVARS 10" 
| - REPLACE "#define MAX_STACKVARS 30" 

#turbo 
#define CombStr v1 
#define CombInt v2 
#define TotalComp v3 
#define dly v4 
#define abt v5 
#define cbe v6 
#define SkillFailCounter v50 
#define SkillSuccessCounter v51 
#define SuccessRate v53 
#define TotalAttempts v54 
#define SkillUpCounter v55 
#define SkillUpRate v56 
#define ShowStats v57 
#define CombineErrorCounter v58 
#define SkillTrivialCounter v59 
#define FinishedProduct v60 
#define ErrorAtCombine v61 
#define DesiredSuccesses v62 
#define EndOnTrivial v63 

#event SkillTrivial "You can no longer advance your skill from making this item" 
#event SkillUp "You have become better at" 
#event SkillFailure "You lacked the skills" 
#event SkillSuccess "You have fashioned the items together to create something new" 
#event FullInventory "There was no place to put that" 
#event CombineError "You cannot combine these items in this container type!" 
#chat tell 

Sub Main 
   | ############################## VARIABLES TO LOOK AT! ##################################### 
   | SET SHOWSTATS TO 1 TO SHOW STATS AND WARNINGS, 0 FOR OFF 
   /varset ShowStats 1 
   | SET ENDONTRIVIAL TO 1 TO STOP THE MACRO WHEN ITEM BECOMES TRIVIAL 
   /varset EndOnTrivial 1
   | SET THE DELAY BETWEEN MOUSE CLICKS HERE 
   /varset dly 2 
   | ABORT ON RECIEVING A TELL, SET TO "TRUE" or "FALSE" 
   /varset abt "FALSE" 
   | IF YOU WOULD LIKE TO KEEP YOUR FINAL PRODUCT, SET TO "KEEP" OTHERWISE SET TO "DESTORY" 
   /varset FinishedProduct "keep" 
   | ############################## VARIABLES TO LOOK AT! ##################################### 

    
   |/cleanup 
   /varset ErrorAtCombine 0 
   /varset CombineErrorCounter 0 
   /varset SkillTrivialCounter 0 
   /varset SkillFailCounter 0 
   /varset SkillSuccessCounter 0 
   /varset SuccessRate 0 
   /varset TotalAttempts 0 
   /varset SkillUpRate 0 
   /varset SkillUpCounter 0 
    
   /call ClearCursor $FinishedProduct 
    
   /if n $p0>0 /if n $p0<=5000 { 
      /echo Setting to $p0 successful attempts! 
      /varset DesiredSuccesses $p0 
   } else /if $p0==0 { 
      /echo Setting to unlimited attempts! 
      /varset DesiredSuccesses 0 
   } else { 
      /echo Invalid setting for # of attempts 
      /endmacro 
   } 
    
   /if "$p2"=="" { 
      /echo Syntax: /macro ts <0-X> <CombinerName> <Component> [Component]... 
      /endmacro 
   } 
   /call CombFind "$p1" 
   /if $CombInt<=7 /call OpenInv 
   /if $CombInt==8 { 
      /call OpenEnv 
      /delay $dly 
   } 
   /if $CombInt>=98 /if $CombInt<=99 { 
      /if n $CombInt==99 /echo Cannot find container << $p1 >> 
      /if n $CombInt==98 /echo Too far away from << $p1 >> 
      /endmacro 
   } 
   /call HandlePacks open 
   /varset TotalComp 0 
   /call ClearCursor $FinishedProduct 
   :CountComponents 
      /varset a(1,$TotalComp) "$p$int($calc($TotalComp+2))" 
      /varadd TotalComp 1 
      /if n $int($TotalComp)>10 { 
         /echo Syntax: /macro ts <0-X> <CombinerName> <Component> [Component]... 
         /echo You can only add up to a total of 10 components. 
         /endmacro 
      } 
      /echo Component $int($TotalComp): $p$int($calc($TotalComp+1)) 
      /if "$p$int($calc($TotalComp+2))"~~"$" { 
         /goto :Begin 
      } else /if "$p$int($calc($TotalComp+2))"=="" { 
         /goto :Begin 
      } else { 
         /goto :CountComponents 
      } 
   :Begin 
      /call ClearCursor $FinishedProduct 
      /doevents 
      /for l0 0 to $int($calc($TotalComp-1)) 
         /call AddComp "$a(1,$l0)" $l0 
      /next l0 

   :Combine 
      /doevents 
      /call DoCombine 

   :ClearCursor 
      /doevents 
      /call ClearCursor $FinishedProduct 
    
   /if "$target(name,clean)"=="$char(name)" { 
      /echo You have targeted yourself, pausing.  To resume, type /target clear or just target something else. 
      :HoldingPattern 
         /delay 2s 
      /if "$target(name,clean)"=="$char(name)" /goto :HoldingPattern 
   } 
    
   /if n $DesiredSuccesses!=0 /if n $DesiredSuccesses<=$SkillSuccessCounter { 
      /echo Created $int($DesiredSuccesses) items as requested! 
      /call EndCombines 
   } 
    
   /goto :Begin 
/return 

Sub CleanPack 
   /press ctrl 
   /sendkey down shift 
   /if "$CombStr"=="enviro" { 
      /varset l0 10 
   } else { 
      /varcalc l0 $pack($CombInt,slots)-1 
   } 

   /for l1 0 to $l0 
      /click left $CombStr $l1 
      /delay $dly 
      /click left auto 
      /delay $dly 
   /next l1 
   /sendkey up shift 
   /press shift 
/return 

Sub HandlePacks 
   /varset l0 0 
   /if "$p0"=="open" /goto :Open 
   /if "$p0"=="close" /goto :Close 
   /if "$p0"=="" /goto :Syntax 
   :Open 
      /for l0 0 to 7 
         /if "$pack($int($l0))"=="TRUE" /if "$pack($int($l0),open)"=="FALSE" { 
            /click right inv $int($l0) 
            /delay $dly 
         } 
      /next l0 
      /goto :End 
   :Close 
      /for l0 0 to 7 
         /if "$pack($int($l0))"=="TRUE" /if "$pack($int($l0),open)"=="TRUE" { 
            /click right inv $int($l0) 
            /delay $dly 
         } 
      /next l0 
      /goto :End 
   :Syntax 
      /echo Syntax: /call HandlePacks <open|close> 
      /endmacro 
   :End 
/return 

Sub OpenInv 
   /varset CombStr "pack $CombInt" 
   /if "$pack($int($l0),open)"=="FALSE" /click right inv $int($l0) 
   /delay $dly 
   /if $pack($CombInt,empty)==FALSE /call CleanPack 
/return 

Sub OpenEnv 
   /varset CombInt e 
   /varset CombStr enviro 
   |/face item 
   /delay $dly 
   |/click left item 
   |/delay $dly 
| Code currently not functioning. 
|   :WaitOpen 
|      /if $pack($CombInt,open)==FALSE /goto :WaitOpen 
|   /delay $dly 
|   /if $pack($CombInt,empty)==FALSE /call CleanPack 
/return 

sub ClearCursor 
   :Loop 
      /delay $dly 
      /if $cursor()!=NULL { 
         /if "$p0"=="DESTROY" { 
            /varset l0 0 
            :SubLoop 
               /if "$a(1,$l0)"~~"#" { 
                  /varset l1 "$right($calc($strlen("$a(1,$l0)")-1),"$a(1,$l0)")" 
                  /varset l2 0 
               } else { 
                  /varset l1 "$a(1,$l0)" 
                  /varset l2 1 
               } 

               /if n $l2==0 /if "$cursor(name)"~~"$l1" { 
                     /click left auto 
                     /delay $dly 
               } else /if n $l2==1 /if "$cursor(name)"=="$l1" { 
                     /click left auto 
                     /delay $dly 
               } 
               /if "$cursor()"!="NULL" { 
                  /if n $l0<$calc($TotalComp-1) { 
                     /varadd l0 1 
                     /goto :SubLoop 
                  } else { 
                     /click left destroy 
                     /delay $dly 
                  } 
               } 
         } else { 
            /click left auto 
            /delay $dly 
         } 
      } 
      /if $cursor()!=NULL /goto :Loop 
/return 

sub DoCombine 
   :Loop 
      | CLICK LEFT COMBINE MISSES THE COMBINE BUTTON WITH MY UI, TEMPORARY FIX BY SETTING IT TO DONE. 
      | /click left $CombStr done 
      /click left $CombStr combine 
      /doevents 
      /delay $dly 
      /if $pack($CombInt,empty)==FALSE /goto :Loop 
/return 

sub AddComp 
   /press shift 
   /sendkey down ctrl 
   /if "$p0"~~# { 
      /finditem similar "$right($calc($strlen("$p0")-1),"$p0")" 
   } else { 
      /finditem "$p0" 
   } 
   /if $find()==FALSE /goto :NoComp 
   /delay $dly 
   /click left $CombStr $p1 
   /goto :End 
   :NoComp 
      /echo Could not find << $p0 >> 
      /call EndCombines 
   :End 
      /sendkey up ctrl 
      /press ctrl 
/return 

Sub CombFind 
   /varset CombInt 99 
   /if "$p0"~~"#" { 
      /varset l1 "$right($calc($strlen("$p0")-1),"$p0")" 
      /varset l2 0 
   } else { 
      /varset l1 "$p0" 
      /varset l2 1 
   } 
   /for l3 0 to 7 
      /if n $l2==0 /if "$pack($l3,name)"~~"$l1" /varset CombInt $l3 
      /if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset CombInt $l3 
      /if n $l2==1 /if "$pack($l39,combine)"=="$l1" /varset CombInt $l3 
   /next l3 
   /if n $CombInt==99 { 
      /if "$l1"=="env" /varset CombInt 8
      /if $CombInt!=8 {
         /itemtarget $p0
         /if n $ground(id)==0 /varset CombInt 99 
         /if n $distance(item)>20 /varset CombInt 98 
         /if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8
      }
   } 
/return $CombInt 

Sub DisplayStats 
   /echo Combine Statistics - Successes: $int($SkillSuccessCounter), Failures: $int($SkillFailCounter), Trivial: $int($SkillTrivialCounter) 
   /varcalc TotalAttempts $SkillFailCounter + $SkillSuccessCounter 
   /varcalc SuccessRate $SkillSuccessCounter / $TotalAttempts * 100 
   /varcalc SkillUpRate $SkillUpCounter / $TotalAttempts * 100 
   /echo Successes Rate: $int($SuccessRate) % out of $int($TotalAttempts) attempts 
   /if n $SkillUpCounter>0 /echo Skill Ups: $int($SkillUpCounter) , Skill Rate: $int($SkillUpRate) % out of $int($TotalAttempts) attempts 
   /if n $SkillTrivialCounter>0 /echo THIS ITEM IS OR HAS GONE TRIVIAL! 
/return 

Sub EndCombines 
   /call CleanPack 
   |/cleanup 
   /if n $ShowStats==1 /call DisplayStats 
   /endmacro 
/return 

Sub Event_Chat 
   /if "$abt"=="TRUE" { 
      /echo Got a tell, stopping. 
      /call EndCombines 
   } 
/return 

Sub Event_CombineError 
   /varcalc ErrorAtCombine $SkillFailCounter + $SkillSuccessCounter 
   /varadd CombineErrorCounter 1 
   /if n $CombineErrorCounter<=1 { 
      /echo Attempting to recover from failed combine! 
      /call CleanPack 
   } else { 
      /echo Failed to recover from failed combine! 
      /call EndCombines 
   } 
/return 

Sub Event_FullInventory 
   /echo Your inventory is full, ending macro. 
   /call EndCombines 
/return 

Sub Event_SkillFailure 
    /varadd SkillFailCounter 1 
    /if n $CombineErrorCounter>=1 /varset CombineErrorCounter 0 
/return 

Sub Event_SkillSuccess 
    /varadd SkillSuccessCounter 1 
    /if n $CombineErrorCounter>=1 /varset CombineErrorCounter 0 
/return 

Sub Event_SkillUp 
    /varadd SkillUpCounter 1
    /echo $int($SkillUpCounter) skill ups in $int($calc($SkillFailCounter+$SkillSuccessCounter)) attempts!
    /beep
/return 

Sub Event_SkillTrivial 
    /varadd SkillTrivialCounter 1 
    /if n $ShowStats==1 /if n $SkillTrivialCounter==1 /echo THIS ITEM IS OR HAS GONE TRIVIAL! 
    /if n $EndOnTrivial==1 /if n $SkillTrivialCounter==1 /call EndCombines 
/return
Last edited by fryfrog on Wed Oct 08, 2003 7:32 am, edited 6 times in total.

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

/click left is NOT broken

Post by wassup » Fri Jul 25, 2003 6:17 am

Why do you keep saying /click left is broken in practically every post you make.

/click left It is not broken
/click left destroy is not broken

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Fri Jul 25, 2003 7:11 am

go walk up to any env combine item and type "/itemtarget <name here>", then "/face item" then "/click left item" and tell me if the command "/click left item" crashes you or not. i am not saying /click left is broken, i'm saying /click left item.

it crashes me, if it doesn't crash you then i am happy for you and would like to know what you have done differently. as for the /click left destory... i am taking the guys word for it as i have not made anything i would like to destroy. if destroy works, super.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Fri Jul 25, 2003 7:50 am

Well, the recover from wrong items in combine container isn't working quite like I hoped. Also, if you put a stack of items in there you get a pop up box instead of a text based error... gay.

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Post by ap50 » Fri Jul 25, 2003 8:34 am

Does this mean we'll get a Totally Improved Trade Skill macro?
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Fri Jul 25, 2003 3:16 pm

nah, i think totally improved is beyond my meeger abilities. slightly improved will be the word of the day AAAAAAHHHHHHH!

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 » Fri Jul 25, 2003 3:27 pm

fryfrog wrote:go walk up to any env combine item and type "/itemtarget <name here>", then "/face item" then "/click left item" and tell me if the command "/click left item" crashes you or not. i am not saying /click left is broken, i'm saying /click left item.

it crashes me, if it doesn't crash you then i am happy for you and would like to know what you have done differently. as for the /click left destory... i am taking the guys word for it as i have not made anything i would like to destroy. if destroy works, super.
Well, I don't know about that. All of my macro's assume the tradeskill container is already opened, since it takes all of half a second to click one open. I myself create macros to avoid the repetitive clicking of creating the items, not opening the containers.

Why not make it easier on yourself and create a macro that assumes the container is already open?

Could have saved yourself quite a bit of time and frustration.

Oh, and sorry for the misunderstanding. I was thinking of /finditem. It was early when I made the previous reply.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Fri Jul 25, 2003 3:37 pm

You may want to take a look at the comments of the macro then, the original author was the one that used the assumption that we would not want to have the container open. The original script targeted the item, faced it and then left clicked on it. I removed all assumptions about not being in the container and forced it to just assume the container was open, because (as you say) it is not only much easier, but it works.

If you don't mind testing /click left item in game, I really would appreciate it. It may just be broken for me :)

Zelker
a lesser mummy
a lesser mummy
Posts: 38
Joined: Fri Jan 03, 2003 3:01 pm

Post by Zelker » Sat Jul 26, 2003 10:41 am

I believe the /click left item has been broken since the patch on 7-11. Crashes me to desktop too.

Z

shamblar
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Jul 27, 2003 12:45 pm

Post by shamblar » Sun Jul 27, 2003 12:47 pm

I am unable to get this to work properly. I see the mouse cursor move, but it clicks nothing. I've tried slowing it down, and still it moves around, but clicks nothing. I am not sure what I may be doing wrong.

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Mon Jul 28, 2003 3:57 am

The reason I auto open bags is simple..

I wanted to make sure that my inventory was open, for /click left auto and /click left destroy.

The $invpanel (or whatever it's called, I can't remember) is broken and cannot tell you wether invetory window is actually open or not.

A sure way was simply to call /cleanup, wich automatically makes 4x /press esc and opens inventory. As all of you should know, this results in all bags to close as well, so I made it open all bags etc. on its own. (call me lazy. I try to make my macros as self reliant as I can).

To Fryfrog. Haven't tried it yet. But from looking over the code I'd say you done a great job on the statistic stuff. The total combines is excellent idea too, as well as the target self pause.

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Improvement Suggestion ...

Post by MacroFiend » Mon Jul 28, 2003 10:39 am

If would be nice if you could call the combiner by type in addition to name.

If you change the following in to the CombFind subroutine, it should take care of it ...

Change

Code: Select all

      /if n $l2==0 /if "$pack($l3,name)"~~"$l1" /varset CombInt $l3 
      /if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset CombInt $l3 
to

Code: Select all

      /if n $l2==0 /if "$pack($l3,name)"~~"$l1" /varset CombInt $l3 
      /if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset CombInt $l3 
      /if n $l2==1 /if "$pack($l39,combine)"=="$l1" /varset CombInt $l3

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Wed Jul 30, 2003 4:10 pm

I like the auto-opening of bags, the way you have done it works great. I just look forward to /click left item working so that you can just be near the combiner. Feel free to rip what ever code you want from it and put it into yours, maybe i'll just delete the sits thread when you do :)

I will look at adding the combiner type code you put below, looks pretty simple :)

Right now, the DNC message doesn't work the way i expected, so i will tweak that on the next big trade skill rampage :)

User avatar
Clone39
a ghoul
a ghoul
Posts: 91
Joined: Mon Jul 07, 2003 7:26 pm
Location: Montreal, Canada

Post by Clone39 » Mon Aug 04, 2003 1:22 pm

this is a very good macro.. been using it for a while now. Only little bu i've been through is sometimes it doesnt pick-up one of the components but it gets back with the recovering from failure code.

One thing i would like to see in this macro is a part where when you run out of components, it targets the nearest merchant and sell the resulted items.

Where would i have to put that code into the macro so it would work well?! I am slowly learning how to make my own macro, really basic stuff, but with this code i cant tell where it would fit. Could you point me where i should get started to implement that feature?!

thanks

Clone39

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Mon Aug 04, 2003 3:01 pm

There are macros made, and very good ones, for that single purpose, of selling stuff to merchants. You could just take such a macro, modify it a bit and include it, then just make a /call sellitem "itemname" or how this sub is called etc.