Tailoring.mac

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

Moderator: MacroQuest Developers

Phantal
orc pawn
orc pawn
Posts: 18
Joined: Tue Aug 13, 2002 7:57 pm

Tailoring.mac

Post by Phantal » Fri Aug 16, 2002 4:18 am

Example of use:

/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
-Phantal
Last edited by Phantal on Fri Aug 16, 2002 4:26 am, edited 1 time in total.

Phantal
orc pawn
orc pawn
Posts: 18
Joined: Tue Aug 13, 2002 7:57 pm

...

Post by Phantal » Fri Aug 16, 2002 4:20 am

Oh, and um ... make sure you have the inventory window open, and open your tailoring kit yourself.

I didn't write this to be used with a loom, sorry. Maybe in v2 or something ;p

-Phantal

Cleric78
orc pawn
orc pawn
Posts: 17
Joined: Wed Sep 11, 2002 10:51 pm

/ponder

Post by Cleric78 » Thu Sep 12, 2002 6:34 pm

i tried running this .mac ... yes i have the inv window open and the tailoring kit open and it messes up .... this is the string i feed eq "/macro tailoring "4 heady" "1 vial" "1 silk" "1 pattern" ... its is to make Wu's armor ... the .mac runs great except that at the end it just ends when it auto drops the item ... i fiddled with the code a lil but screwed it up more ... please help :)

Cleric78

eqjim
a lesser mummy
a lesser mummy
Posts: 35
Joined: Tue Aug 27, 2002 3:56 pm

Post by eqjim » Fri Sep 13, 2002 12:27 am

yes i have the inv window open and the tailoring kit open and it messes up .... this is the string i feed eq "/macro tailoring "4 heady" "1 vial" "1 silk" "1 pattern" ... its is to make Wu's armor
... the .mac runs great except that at the end it just ends when it auto drops the item
not sure what you want it to do.. it sounds like its working. its making the item and then dropping it into your inventory, right?

but you say it messes up.. then you say it works great, confusing!!@@@

what im thinking you want it to do is to keep making items until you run out of supplies. example would be: you give it the text to make a wu sash.. and you want it to keep making wu sashes until your out of the needed components. yes?

i dont have the trade skills to test this but maybe just adding a loop would work?

but if it ran out of the supplies it might screw up.. not sure.

try this:

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 
 :startallover
   /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 
/goto :startallover
/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 
all i added was

:startallover

after the sub main and

/goto :startallover

after the :Done

what i think *should* happen .. is itll try to make 1 of whatever you tell it to (like a wu sash).. once its done making or failing that 1 attempt it should go back to the top and run threw the code agian trying to make another.. and keep doing that until it runs out of the items needed

post a reply if thats what your talking about and if it works or not. thanks.

Cleric78
orc pawn
orc pawn
Posts: 17
Joined: Wed Sep 11, 2002 10:51 pm

ahh srry

Post by Cleric78 » Fri Sep 13, 2002 12:58 am

ok srry i meant to say is:

it works for 1 round then stops after it auto drops it (even if you have all the suplies to make 100) it still only does 1 round

then you have to type "/macro tailoring "4 heady" "1 vail" "1 pattern" "1 silk" all over again ... i was hitting shift+up arrow to make it run again

i will try the new .mac

Cleric78

Cleric78
orc pawn
orc pawn
Posts: 17
Joined: Wed Sep 11, 2002 10:51 pm

WHOOT

Post by Cleric78 » Fri Sep 13, 2002 1:58 am

ok the new .mac does execatly what i wanted it to do :)

thank you thank you thank you

ok there is just one more thing that the code needs ... the ability to use a DELUXE Sewing Kit ... which i have one ... they are 10slots where as the lard is only 8 slots ... i am gonna _try_ to mod the code my self and see if i can get it to work :)

Cleric78