/macro tailoring "1 swatch" "1 pattern" "1 viscous" "4 Heady"
result: Finds one item who's name contains 'swatch', 1 item who's name has 'pattern' in it (keep in mind it'll try to use the first pattern it finds, regardless of type), 1 vile of viscous mana, and 4 heady kiola's.
Don't bother trying to provide the full item name. This macro utilizes $arg, which returns a substring. If I have a string that says: "This is a test", each word in that string is what's called a substring (in case your not a programmer, sorry for talking down to you if you are). This macro assumes that there are only two substrings in each parameter (max of 5 parameters), and each parameter MUST be given with quotation marks.
If I type this:
/macro tailoring "1 vial of viscous mana"
It will look for any item which has the word 'vial' in it, and ignore the 'of viscous mana' part. If your going to use this, your going to have to be smart about how you use it. Telling it to look for 'silk' isn't a good idea, because it could find normal silks, a silk robe, a silk cloak ... but if you type swatch, then there's really only a few types of swatches it could find.
Um, that's about it i guess. If you have questions, post 'em
Code: Select all
| - Tailoring.mac -
|
| Need to have inventory window open already.
|
| Useage:
| /macro tailoring "#Item1" "#Item2" "#Item3" "#Item4" "#Item5"
|
| Replace # with the amount of that particular item. Do not
| feed it values greater than 9, and less than 1.
|
#include routines.mac
#turbo
#event NoCombine "You cannot combine these items in this container type!"
Sub Main
/if "$p0"=="" /goto :Done
/call FindCombiner Tailoring
| /echo Tailoring container in inventory slot $return
| /click right inv $return
|v0 is the tailoring container
/varset v0 $return
/sendkey down ctrl
:MakeItems
|v6 is used to tell it which slot in v0
|to place the next item you pickup
/varset v6 0
| /echo p0: "$p0" p1: "$p1" p2: "$p2" p3: "$p3" p4: "$p4"
|--> First item
|v7 is used to hold each parameter in, so i can re-use code
/varset v7 "$p0"
/call PlaceItems
/if $return==0 /goto :Done
/if $return==10 /goto :nofind
| /echo $v0 - $v1 - $v2 - $v3 - $v4 - $v5 - $v6 - $v7
| /echo p0: "$p0" p1: "$p1" p2: "$p2" p3: "$p3" p4: "$p4"
/if "$p1"=="" /goto :combine
|--> Second item
/varset v7 "$p1"
/call PlaceItems
/if $return==0 /goto :Done
/if $return==10 /goto :nofind
/if "$p2"=="" /goto :combine
|--> Third item
/varset v7 "$p2"
/call PlaceItems
/if $return==0 /goto :Done
/if $return==10 /goto :nofind
/if "$p3"=="" /goto :combine
|--> Fourth item
/varset v7 "$p3"
/call PlaceItems
/if $return==0 /goto :Done
/if $return==10 /goto :nofind
/if "$p4"=="" /goto :combine
|--> Fifth item
/varset v7 "$p4"
/call PlaceItems
/if $return==0 /goto :Done
/if $return==10 /goto :nofind
:Combine
/click left pack $v0 combine
/delay 10
/doevents
/if $return==99 /goto :Done
/click left auto
/goto :Done
:nofind
/echo Didn't find: $arg(2,"$v7")
/goto :Done
:zero
/echo You did not provide a value between 1 & 9
:Done
/sendkey up ctrl
/return
sub PlaceItems
| /echo $v0 - $v1 - $v2 - $v3 - $v4 - $v5 - $v6 - $v7
/for v1 1 to 9
| /echo "$v7" -> "$arg(1,"$v7")"
/if "$arg(1,"$v7")"=="$v1" /goto :DoneChecking
/next v1
/echo Char1 of v7 not 1-9
|This line only gets executed if the first char in $v7 is not
|a number between 1 & 9
/return 0
:DoneChecking
| /echo $v0 - $v1 - $v2 - $v3 - $v4 - $v5 - $v6 - $v7
|loops using v5 as a counter, from 1 to v1, to place the correct
|number of items stated in $v7 into your tailoring kit, using v6
|to determine which slot in the kit to place the item(s) that were
|located. v5 is set to 1 & incremented for each individual item,
|whereas v6 is only reset to 0 at the beginning of :MakeItems
/for v5 1 to $v1
| /echo v5: $v5 v1: $v1
| /echo $v7 -> $arg(1,"$v7")
/finditem similar $arg(2,"$v7")
/if $find()==FALSE /return 10 |a returned value of 10 is
|/goto :nofind in sub main
/click left pack $v0 $v6
/varadd v6 1
/next v5
/return $v1
Sub Event_NoCombine
/return 99
