New combine.mac

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Groo
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue Feb 24, 2004 1:46 pm

New combine.mac

Post by Groo » Wed Mar 10, 2004 2:05 pm

Here is my simplified tradeskill macro. Uses the standard ini file for recipies and works with new UI. It is much smaller than the others & works with multiple tool recipes.

Start with the container open in experiment mode. Put "recipe.ini" in the same dir.

Code: Select all

|| Combine.mac by Groo Mar 8, 2004

#event FullInventory "There was no place to put that" 
#event CombineError "You cannot combine these items in this container type!" 
#chat tell

Sub Main 
    /declare Container global
    /declare PackCode global
    /declare Component array
    /declare i global

    /call readIni "@Param0" 
    :Begin  
        /call ClearCursor
        /for i 0 to 9
            /call AddComp "@Component(@i)" @i
        /next i 
        /call DoCombine 
        /goto :Begin 
    /return 

Sub readIni(RecipeName) 
    /echo Running @RecipeName recipe
    
    /if "$ini("recipes.ini","@RecipeName")"=="" { 
        /echo Recipe @RecipeName not found  
        /endmacro 
    } 
    
    /varset Container "$ini("recipes.ini","@RecipeName","Cont")" 
    /for i 0 to 7 
        /if "$pack(@i,name)"=="@Container" /varset Container "pack @i"
    /next i 

    /if "@Container"=="Enviro" {
        /varset PackCode "e"
    } else {
        /varset PackCode $right(1, @Container)
    }
    
    /for i 0 to 9 
        /varset Component(@i) "$ini("recipes.ini","@RecipeName","Comp@i")"  
    /next i 
    /return 

sub ClearCursor 
    :Loop 
        /if $cursor()==NULL /return 
        /autoinv 
        /delay 2
        /doevents 
        /goto :Loop 
    /return 

sub DoCombine 
    :Loop 
        /click left @Container combine experiment
        /delay 5
        /doevents 
        /if $pack(@PackCode,empty)==FALSE /goto :Loop
    /delay 5
    /return 

sub AddComp(CompName, PackSlot) 
    /if "@CompName"=="NOTFOUND" /return 
    
    /sendkey down ctrl  

    :Loop 
        /finditem "@CompName"   
        /if $find()==FALSE {
            /echo Could not find @CompName in inventory 
            /beep
            /sendkey up ctrl 
            /endmacro 
        }
        /if $cursor()==NULL /goto :Loop 

    /click left @Container @PackSlot experiment 
    /sendkey up ctrl    
    /return 

Sub Event_CombineError  
    /endmacro 
    /return 

Sub Event_FullInventory 
    /endmacro 
    /return 
Here is an example recipe.ini file

Code: Select all

------------- Haversack ------------

[AcornOil]
Cont=Enviro
Comp0=Misty Acorn
Comp1=Water Flask

[InfusedPT]
Cont=Enviro
Comp0=Celestial Temper
Comp1=Platinum Thread

[CelestialTemper]
Cont=Enviro
Comp0=Blue Diamond Powder
Comp1=Purified Water

[BlueDiamondPowder]
Cont=Enviro
Comp0=Blue Diamond
Comp1=Jar Of Acid

[PurifiedWater]
Cont=Enviro
Comp0=Celestial Essence
Comp1=Water Flask
Comp2=Water Flask

[CE]
Cont=Mortar And Pestle
Comp0=Celestial Solvent
Comp1=The Scent Of Marr

[WovenFur]
Cont=Vale Sewing Kit
Comp0=Patch of Dire Wolf Fur
Comp1=Patch of Dire Wolf Fur
Comp2=Patch of Dire Wolf Fur
Comp3=Embroidering Needle

[PatchFur]
Cont=Vale Sewing Kit
Comp0=Tuft of Dire Wolf Fur
Comp1=Tuft of Dire Wolf Fur
Comp2=Tuft of Dire Wolf Fur
Comp3=Embroidering Needle

------------- Steel Arrow ------------

[steelarrow]
Cont=Surefall Fletching Kit
Comp0=Small Groove Nocks
Comp1=Steel Arrowheads
Comp2=Steel Arrowshafts
Comp3=Steel Fletch

[steelshaft]
Cont=Enviro
Comp0=Arrow Shaft Mold
Comp1=Large Brick Of Steel
Comp2=File
Comp3=Mark of Karana
Comp4=Water Flask

[steelfletch]
Cont=Enviro
Comp0=Small Brick Of Steel
Comp1=Steel Working Knife
Comp2=Mark of Karana

[steelarrowhead]
Cont=Enviro
Comp0=Small Brick Of Steel
Comp1=File
Comp2=Water Flask
Comp3=Mark of Karana

[bits]
Cont=Enviro
Comp0=Small Piece Of Ore
Comp1=Small Piece Of Ore
Comp2=Water Flask

Gee, guess what race/class play :)

draco
a ghoul
a ghoul
Posts: 145
Joined: Thu Jan 29, 2004 7:06 pm
Contact:

Post by draco » Wed Mar 10, 2004 5:39 pm

Nice! I'll try this tonight.
One thing I wish there was a way to list all possible containers.
I'm thinking in the recipe.ini

Code: Select all

cont1={...}
cont2={...}
etc. then the script would just loop through and find which you have. and error out if you don't have any. Just a pet pieve. I'm tired of having to edit recipe.ini's to the containers my particular chars have.