tradeskill.mac - Universal Combine Macro

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

Moderator: MacroQuest Developers

Digitalxero
a ghoul
a ghoul
Posts: 129
Joined: Tue Sep 10, 2002 5:01 pm

tradeskill.mac - Universal Combine Macro

Post by Digitalxero » Sun Oct 27, 2002 10:05 am

I used the tailoring mac as a guide, for this and turned it into a universal combin macro, for up to 9 items(Using the latest IRC Release)

Useage:
/macro tradeskill "<tradeskill>" "# Item1" "# Item2" "# Item3" "# Item4" "# Item5" "# Item6" "# Item7" "# Item8" "# Item9"

<tradeskill> can be
Alchemy
Baking Env
Baking Inv
Brewing
Fishing
Fletching
Jewlcraft
Poison
Pottery Kiln
Pottery Wheel
Smithing
Tailoring Env
Tailoring Inv
Tinkering

Code: Select all

| - Tradeskill.mac - 
| 
| Need to have inventory window open already and Be near the enviromental container if you require one 
| 
| Useage: 
|   /macro tradeskill "<tradeskill>" "# Item1" "# Item2" "# Item3" "# Item4" "# Item5" "# Item6" "# Item7" "# Item8" "# Item9" 
|   <tradeskill> can be Smithing, Baking Inv, Baking Env, Brewing, Tailoring Inv, Tailoring Env, Alchemy, Fishing, Fletching, Jewlcraft, Pottery Wheel, Pottery Kiln, 

Tinkering, Poison 
| 
| 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
} else {
	/call container_check "$p0"
}

   /varset v0 "$v80"

   /sendkey down ctrl
   /goto :MakeItems


:MakeItems
      |v6 is used to tell it which slot in v0 
      |to place the next item you pickup 
   /varset v6 0


|--> First item 
      |v7 is used to hold each parameter in, so i can re-use code 
   /varset v7 "$p1"

   /call PlaceItems
   /if $return==0 /goto :Done
   /if $return==10 /goto :nofind

   /if "$p2"=="" /goto :combine

|--> Second item
   /varset v7 "$p2"

   /call PlaceItems
   /if $return==0 /goto :Done
   /if $return==10 /goto :nofind

   /if "$p3"=="" /goto :combine
|--> Third item
   /varset v7 "$p3"

   /call PlaceItems
   /if $return==0 /goto :Done
   /if $return==10 /goto :nofind

   /if "$p4"=="" /goto :combine
|--> Fourth item
   /varset v7 "$p4"

   /call PlaceItems
   /if $return==0 /goto :Done
   /if $return==10 /goto :nofind

   /if "$p5"=="" /goto :combine
|--> Fifth item
   /varset v7 "$p5"

   /if "$p6"=="" /goto :combine
|--> Sixth item
   /varset v7 "$p6"

   /if "$p7"=="" /goto :combine
|--> Seventh item
   /varset v7 "$p7"

   /if "$p8"=="" /goto :combine
|--> Eighth item
   /varset v7 "$p8"

   /if "$p9"=="" /goto :combine
|--> Nineth item
   /varset v7 "$p9"

   /call PlaceItems
   /if $return==0 /goto :Done
   /if $return==10 /goto :nofind

:Combine
   /click left $v0 combine
   /delay 10
   /doevents
   /if $return==99 /goto :Done
   /goto :AutoDrop

:AutoDrop
   /click left auto
   /delay 1
   /if "$cursor()"=="TRUE" /goto :AutoDrop
   /goto :MakeItems



: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
   /for v1 1 to 9
      /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


      |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
      /finditem similar $arg(2,"$v7")
      /if $find()==FALSE /return 10   |a returned value of 10 is
	/echo Cklick left $v0 $v6 
      /click left $v0 $v6
      /varadd v6 1
   /next v5
/return $v1

Sub Event_NoCombine
/return 99


sub container_check
/echo Made it to container_check with Trade skill $p0

   /if "$p0"=="Alchemy"	{
	/call Alchemy
   } else /if "$p0"=="Baking Env" {
	/call BENV
   } else /if "$p0"=="Baking Inv" {
	/call BINV
   } else /if "$p0"=="Brewing" {
	/call Brewing
   } else /if "$p0"=="Fishing" {
	/call Fishing
   } else /if "$p0"=="Fletching" {
	/call Fletching
   } else /if "$p0"=="Jewelcraft" {
	/call Jewlecraft
   } else /if "$p0"=="Poison" {
	/call Poison
   } else /if "$p0"=="Pottery Wheel" {
	/call PotteryW
   } else /if "$p0"=="Pottery Kiln" {
	/call PotteryK
   } else /if "$p0"=="Smithing" {
	/call Smithing
   } else /if "$p0"=="Tailoring Env" {
	/call TENV
   } else /if "$p0"=="Tailoring Inv" {
	/call TINV
   } else /if "$p0"=="Tinkering" {
	/call Tinkering
   }

    /varset v80 "$v81"
/return "$v80"

sub Alchemy
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="Medicine Bag" /varset v10 $v99
/next v99
/return "pack $v10"

sub BENV
/itemtarget Oven
/face item
/click left item
/return enviro

sub BINV
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="Spit" /varset v10 $v99
/next v99
/return "pack $v10"

sub Brewing
/itemtarget Brew
/face item
/click left item
/return enviro

sub Fishing
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="tacklebox" /varset v10 $v99
/next v99
/return "pack $v10"

sub Fletching
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="fletching" /varset v10 $v99
/next v99
/return "pack $v10"

sub Jewlecraft
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="jewelers" /varset v10 $v99
/next v99
/return "pack $v10"

sub Poison
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="mortar" /varset v10 $v99
/next v99
/return "pack $v10"

sub PotteryW
/itemtarget Pottery Wheel
/face item
/click left item
/return enviro

sub PotteryK
/itemtarget Kiln
/face item
/click left item
/return enviro

sub Smithing
/itemtarget Forge
/face item
/click left item
/return enviro

sub TENV 
/itemtarget Loom
/face item
/click left item
/return enviro

sub TINV
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="tailoring" /varset v10 $v99
/next v99
/varset v81 "pack $v10"
/return "$v81"

sub Tinkering
/varset v10 99
/for v99 0 to 7
/if "$pack($v99,combine)"=="tinkering" /varset v10 $v99
/next v99
/return "pack $v10"


Edit, fixed a bug that would was cauing it to not fine the corect combine container
Last edited by Digitalxero on Mon Oct 28, 2002 4:01 am, edited 2 times in total.

User avatar
rizwank
Huggle Police
Huggle Police
Posts: 524
Joined: Tue Jul 23, 2002 12:07 am
Contact:

Post by rizwank » Mon Oct 28, 2002 2:47 am

at first glance only,

excellent.

inc sticky.

someone make sure this works please
#macroquest op
Macroquest Official Documentarion
Macroquest Board Moderator
All around cool guy

[img]http://medicomuerte.users.btopenworld.com/images/fairy_bounce08.gif[/img]

Digitalxero
a ghoul
a ghoul
Posts: 129
Joined: Tue Sep 10, 2002 5:01 pm

Post by Digitalxero » Mon Oct 28, 2002 3:51 am

It works, I skilled up my tailoring to 110, pottery to 122, baking to 143, smithing to 150 using it today. thats how I found the bug I fixed :)


Oh just a note, when doing silk swatches from silk make 1/2 the number of stacks of silk you have in swatches and put them in a bag someware not stacked or else you will grab the swatches when they start filling in the first bag because they contain all the words the original silk does and it uses /finditem similar ... so there is no way around this.

Gengis
a ghoul
a ghoul
Posts: 116
Joined: Wed Aug 14, 2002 7:46 pm

Post by Gengis » Mon Oct 28, 2002 10:37 am

:D

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Post by lifewolf » Fri Dec 20, 2002 10:45 am

Do mine next.

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Post by lifewolf » Fri Dec 20, 2002 10:48 am

Digitalxero wrote:Oh just a note, when doing silk swatches from silk make 1/2 the number of stacks of silk you have in swatches and put them in a bag someware not stacked or else you will grab the swatches when they start filling in the first bag because they contain all the words the original silk does and it uses /finditem similar ... so there is no way around this.
There is, just need a group effort of tradeskill macroers to use normal finditem first, and if that fails, automaticly use finditem similar from then on, unless it fails too.

So when you look for "Spider Silk", it will /finditem "Spider Silk" and if you have 0 then /finditem similar "Spider Silk". Would be very helpful.

elkcit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Aug 31, 2002 3:20 pm

finditem

Post by elkcit » Sat Dec 21, 2002 5:25 pm

or perhaps an exlude tag on the finditem command...

/finditem similar "Silk" exclude "Swatch"

Tigger7833
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Oct 10, 2004 10:47 pm

Post by Tigger7833 » Sun Oct 10, 2004 10:49 pm

nm. didn't pay attention to the date when i did search lol
Last edited by Tigger7833 on Sun Oct 10, 2004 11:06 pm, edited 2 times in total.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Sun Oct 10, 2004 10:57 pm

Seeing as the last post previous to yours is FROM ALMOST TWO YEARS GO, AND this thread is in the forum named "OUTDATED MACRO'S", I DON'T THINK SO.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]