Alchemy

dulak

Vagoo!
Joined
Jul 9, 2006
Messages
1,460
Reaction score
4
Points
38
Hey, this is an older alchemy macro I've had laying around for some time. It partially works but I'm guessing from lack of updates to the macro, it doesn't function as it should. It's not my work at all and I've no idea how to get up with the author but I'm going to post it here and see if one of you uber programmers can fix it for me. Any help would be greatly appreciated.
Code:
| Alchemy.mac version 2.0
|
| Written by Armysoldier
|
| March 5 2006
|
| Modifications:
|
| 26 APR 06: Call to read locs was missing... added it
|
| 2 APR 06: REworked to new recipies 
|
| THIS MACRO DOES NOT DESTROY OR SELL OFF YOU End result potions
|
| I suggest to reduce cost of ALCHEMY 
|             1. FARM or buy DEEP ORC meat - and make Deep Orc Essence - 195 TRIV - cost 1G 2S 5C per combine
|             2. to go from 210 - 300 - FORAGE RED CUPS and COLLECT DEEP WATER INK 
|                  DISTILATE of _______ VIII - 255 TRIV - Cost 14p 1G 5S 1C per combine w/ RED CUPS
|                  DISTILATE of _______ IX - 302 TRIV - COST From under 1PP - 2PP per combine w/ DEEP WATER INK
|
|
| 26 MAR 2006: moved 2 subs and event declarations to CommonSubs.inc
|
| This new line of tradeskill macros uses the NEW UI and the OLD UI for TS containers
| 
| The Macro will attempt to find the recipe using the NEW UI first
| If no recipe is found it will go Old school and do a set of combines
| these macros take into account the SALVAGE function and react accordingly
| 
|
| A special thanks to A_Druid_00 for advising on some streamlining modifications
| and to Override for his Tradeskill Code that has been around for so long 
| and is the inspiration for this code
|
| Some of the code was pulled from other macros and modified and manipulated 
| to do the tasks set forth.
|
| This code is designed for Abysmal Sea
|
| *** FOR THIS CODE TO WORK ***
| You need to Stand BETWEEN Lita Hegeway @ loc 122,-50 
|                           AND Jorlan Hegeway in Abysmal Sea
| You need to be in the first person view
| You need to ensure that when you click the tradeskill container the NEW UI comes up first
| the 5 FILES need to be in the macro\common folder (see includes below)
| A Medicine Bag needs to be in slot 8 of your packs
|
| 
|
|Inventory
| _______
|| 1 | 5 |
||___|___|
|| 2 | 6 | 
||___|___|
|| 3 | 7 |
||___|___|
|| 4 | 8 |
||___|___|
|


#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc
#include common/CommonSubs.inc


Sub Main
    /declare OldSkill int outer ${Me.Skill[Alchemy]}
    /declare SkillMaxWanted int outer
    /declare PackCode string outer 
    /declare Component[10] string outer
    /declare i int outer
    /declare MerchantNameA string Outer
    /declare MerchantNameB string Outer
    /declare MerchantNameC string Outer
    /declare CombItemName string outer
    /declare ItemTo string outer
    /declare EndingVar int outer
    /declare DelayMult int outer
    /declare Container string outer
    /declare Checkrecipe string outer
    /declare NewUI int outer

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Customize these settings if you want
|                    
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /varset SkillMaxWanted 210 
    /varset DelayMult 1
    /declare Filename string outer Alchemy.ini

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Call Read INI for locations array
|                    
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /call ReadINIA ${Filename} "Abysmal Sea" 
    /if (!${Defined[LocArray]}) { 
       /echo No Loc Array Created...
       /endmacro 
    } 

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Begin 
|
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :start

|--- Check Current Skill against Skill wanted 
    /echo Alchemy is at ${Me.Skill[Alchemy]}

    /if (${Me.Skill[Alchemy]}>=${SkillMaxWanted}) {
      /echo Alchemy is at ${SkillMaxWanted}. Quiting!
      /endmacro
    }

    /if (${Me.Skill[Alchemy]}<83) {
          /varset MerchantNameA Sara Hegeway
          /varset MerchantNameB Jensine Hegeway
      }
    /if (${Me.Skill[Alchemy]}>=84 && ${Me.Skill[Alchemy]}<136) {
          /varset MerchantNameA Jensine Hegeway
          /varset MerchantNameB Maren Hegeway
      }
    /if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<211) {
          /varset MerchantNameA Jorlan Hegeway
          /varset MerchantNameB Lita Hegeway
          /varset MerchantNameC Oline Hegeway
      }

    /if (${Me.Skill[Alchemy]}<55) {
    /varset CombItemName DI2
    /varset ItemTo Distillate of Immunization II
    }
    /if (${Me.Skill[Alchemy]}>=55 && ${Me.Skill[ALchemy]}<84) {
    /varset CombItemName DI3
    /varset ItemTo Distillate of Immunization III
    }
    /if (${Me.Skill[Alchemy]}>=84 && ${Me.Skill[Alchemy]}<101) {
    /varset CombItemName WOLF2
    /varset ItemTo Philter of the Wolf II
    }
    /if (${Me.Skill[Alchemy]}>=101 && ${Me.Skill[Alchemy]}<136) {
    /varset CombItemName WOLF3
    /varset ItemTo Philter of the Wolf III
    }
    /if (${Me.Skill[Alchemy]}>=135 && ${Me.Skill[Alchemy]}<179) {
    /varset CombItemName DS6
    /varset ItemTo Distillate of Skinspikes VI
    }
    /if (${Me.Skill[Alchemy]}>=178 && ${Me.Skill[Alchemy]}<211) {
    /varset CombItemName WOLF5
    /varset ItemTo Philter of the Wolf 5
    }
   
    /call ReadIni ${CombItemName}
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Buy Components
|
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /varset EndingVar 1
    /varset NewUI 1

    /if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<210) /call Movement 3 3 0

    /target ${MerchantNameA}

    /nomodkey /click right target

    /delay 5s ${Window[MerchantWnd].Open}

    /call OpenPacks

    /call Buy "${Component[2]}" 20

    /if (${Me.Skill[Alchemy]}<136) /call Buy "${Component[1]}" 20

    /if (${Me.Skill[Alchemy]}<84) /call Buy "${Component[3]}" 60

    /if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<211) /call Buy "${Component[3]}" 20

    /if (${Me.Skill[Alchemy]}<136) /call Movement 3 3 0

    /if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<211) /call Movement 1 1 0

    /target ${MerchantNameB}

    /nomodkey /click right target

    /delay 5s ${Window[MerchantWnd].Open}

    /call Buy "${Component[4]}" 20

    /if (${Me.Skill[Alchemy]}>=84 && ${Me.Skill[Alchemy]}<211) /call Buy "${Component[5]}" 40

    /if (${Me.Skill[Alchemy]}>=84 && ${Me.Skill[Alchemy]}<136) /call Buy "${Component[3]}" 20

    /call Movement 3 3 0

    /if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<211) {

           /call Movement 4 4 0

           /target ${MerchantNameC}

           /nomodkey /click right target

           /delay 5s ${Window[MerchantWnd].Open}

           /call Buy "${Component[1]}" 20

           /call Movement 1 1 0

           }

    /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp

    /call ClosePacks

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MAKE Items
|
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      /nomodkey /itemnotify pack8 rightmouseup
      /doevents
      /delay 3s ${Window[TradeskillWnd].Open} 
      /if (!${Window[TradeskillWnd].Open}) /nomodkey /click left Item 
      /delay 3s ${Window[TradeskillWnd].Open} 
      /call ChooseRecipe
      /call ClosePacks

    /target ${MerchantNameA}
   
    /delay 5s ${Target.ID}==${Spawn[${MerchantNameA}].ID}

    /nomodkey /click right target

/delay 5s ${Window[MerchantWnd].Open} 

    /call OpenPacks

    /call Sell "${Component[1]}"

    /call Sell "${Component[2]}"

    /call Sell "${Component[3]}"

    /call Sell "${Component[4]}"

    /if (${Me.Skill[Alchemy]}>83) /call Sell "${Component[5]}"

    /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp

    /call ClosePacks

    /doevents

    /goto :start

    /return


|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Skill up
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Sub Event_Skillup
        /if (${Me.Skill[Alchemy]}>${OldSkill}) {
        /echo Your Alchemy Went Up!! It's now ${Me.Skill[Alchemy]}!
        /varset OldSkill ${Me.Skill[Alchemy]}
/return

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event No Longer Advance 
|used if there are some subcombines that need to be made in some TS
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_Advance
    /varset EndingVar 2
/return

And here is the ini file as well:
Code:
[Abysmal Sea]
Value=4
Loc1=106,-50
Loc2=140,-53
Loc3=157,-52
Loc4=108,-36

[DI2]
Cont=Medicine Bag
Comp0=crude potion vial  
Comp1=single sage leaf
Comp2=mullein leaf
Comp3=Vox's dust

[DI3]
Cont=Medicine Bag
Comp0=rough potion vial  
Comp1=single sage leaf
Comp2=mullein leaf
Comp3=violet tri-tube sap

[WOLF2]
Cont=Medicine Bag
Comp0=sprig of birthwort
Comp1=sprig of fenugreek
Comp2=makeshift potion vial  
Comp3=blue vervain bulb
Comp4=a dash of wolf blood


[WOLF3]
Cont=Medicine Bag
Comp0=sprig of birthwort
Comp1=sprig of fenugreek
Comp2=simple potion vial  
Comp3=betherium bark
Comp4=a dash of wolf blood


[DS6]
Cont=Medicine Bag
Comp0=acaana  
Comp1=bugbane
Comp2=comfrey
Comp3=plain potion vial
Comp4=flamewort


[wolf5]
Cont=Medicine Bag
Comp0=birthwort
Comp1=dragonwart
Comp2=fenugreek
Comp3=smooth potion vial
Comp4=a measure of wolf blood
 
I knew he was a member here but from what I can tell, he hasn't been active in a while. I hadn't noticed however, that he last updated his original post in may lol. I'm gonna give these a shot and see what happens.

-Edit-
Well I gave it a try and it's doing the exact same thing. The macro will start, open all my bags, target the merchant but after that does nothing. And this is the only one I'm having problems out of so far. I've used the brewing one and it's quite nifty.
 
I tried to use this and had the same problem. I think they way that i got it to work was i had to actully buy one of the items it was trying to buy from the vendor.

Then i believe it would buy all the stuff....Either way i stopped using it because soon as it was done and would start to make the stuff, It would CTD me everythime.

So in essence i would have to manually make everything anyways.

I just bought everything i needed and then used the macro that continuesly makes things. Forgot what its called but it comes with the default compile.
 
Check the zip in post 194 of the TS thread, that has most fixes updated but might need one or two still.
 
did that, no dice. Ah well though, not really needed now but I would still suggest a fix somehow.
 
combine.mac

Can just buy the ingredients and then use combine mac it does all the clicking for you. Not 100% automated but least your hand doesn't get tired and can watch tv or play other toons while working trades.