Code: Select all
| Combine.mac by Groo Apr 29, 2004
#event CombineError "There was no place to put that"
#event CombineError "You cannot combine these items in this container type!"
#event CombineError "did not accept these items"
#chat tell
Sub Main
/declare PackCode string outer
/declare Component[10] string outer
/declare i int outer
/if (!${Defined[Param0]}) {
/echo No recipe name given
/endmacro
}
/call readIni "${Param0}"
:Begin
/call ClearCursor
/for i 1 to 10
/call AddComp "${Component[${i}]}" ${i}
/next i
/call DoCombine
/goto :Begin
/return
Sub readIni(RecipeName)
/declare Container string
/echo Running ${RecipeName} recipe
/if (${Ini["recipes.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container ${Ini[recipes.ini,${RecipeName},Cont,Enviro]}
/if (${Container.Equal[Enviro]}) {
/varset PackCode Enviro
} else {
/varset PackCode ${FindItem[=${Container}].InvSlot}
/if (${PackCode.Equal[NULL]}) {
/echo Could not find container ${Container}
/endmacro
}
| pack1 = 22, ... , pack8 = 29
/varset PackCode pack${Math.Calc[${PackCode}-21].Int}
}
/for i 1 to 10
/varset Component[${i}] ${Ini[recipes.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
/autoinv
/delay 5
/doevents
/goto :Loop
/return
sub DoCombine
:Loop
/combine ${PackCode}
/delay 1s
/if (${PackCode.Equal[Enviro]}) /delay 1s
/doevents
/if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop
/delay 5
/return
sub AddComp(CompName, PackSlot)
/if (${CompName.Equal[NOTFOUND]}) /return
/if (!${FindItem[=${CompName}].ID}) {
/echo Could not find ${CompName} in inventory
/beep
/endmacro
}
:Loop
/ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup
/if (!${Cursor.ID}) {
/delay 1
/goto :Loop
}
/if (${PackCode.Equal[Enviro]}) {
/itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup
} else {
/itemnotify in ${PackCode} ${PackSlot} leftmouseup
}
/return
Sub Event_CombineError
/endmacro
/return
Code: Select all
------------- Ethereal Sheet of Metal ------------
[EthSheet]
Cont=Enviro
Comp0=Brick of Ethereal Energy
Comp1=Brick of Ethereal Energy
Comp2=Ethereal Temper
Comp3=Tanaan Smithing Hammer
[EthTemper]
Cont=Enviro
Comp0=Celestial Essence
Comp1=Celestial Essence
Comp2=Emerald Tea Leaf
Comp3=Soda
[CE]
Cont=Mixing Bowl
Comp0=Celestial Solvent
Comp1=The Scent Of Marr



