khiTS is a macro for automatically doing tradeskill combines using recipes saved in an ini file.
Notes:
This is a beta macro and should be treated as such. Your valuable items might get deleted, your email address might be posted on a gay dating site, your girlfirend/boyfriend/dog might fall in love with this code and leave you for it, this code may ruin your credit rating, cause you to get an F in Macro Economics, date your grandmother, etc. In other words use it at your own risk. The shit works for me, hope it does for you, send me a shout if it doesn't.
None of that is likely, likely mind you, to happen but I just want to impress upon you that I have only tested this macro on my system with my specific needs in mind.
Right now MQ2 is in serious flux, so expect this macro to change as I learn about the updated commands, and as the command structures change.
Please post any problems you have and I'll try to fix them as quickly as possible, usually the bugs that directly affect me are the ones that get fixed first.
I can only vouch for the performance of this on my system, which is fairly highend. You may need to tone it down by chainging the #turbo number.
Credits:
Thanks go out to DKAA for the insperation to write this, my original was strongly based on his tradeskill combine macro. Also thanks to Diggler for the creation of the original ini file format and his wife for the hard work she put in entering a large number of recipes, and finally to everyone that has entered thier own recipes on my website.
Setup:
Save the recipes.ini file to your macro directory. I will be updating that to use item id's shortly to avoid duplicates, but will allow aliases so you can call a recipe whatever you want.
Usage:
/macro khits "RecipieName" ["options"]
Updates:
26 Apr 04 : 15:56
Took out the #turbo command, works great now, still a rare problem somethimes with failed combine, but I'm working on that
25 Apr 04 : 11:37 EST
Updated to use more /itemnotify's and also added some checking to when doing combines for empty combine slots.
24 Apr 04
Updated /autoinv to /notify InventoryWindow IW_CharacterView leftmouseup (Thanks to DKAA for info)
Save as khiTS.mac in your macro directory:
Code: Select all
|**
khiTS.mac
Author: Kaitain Heavy Industries
Date: 24 Apr 04
Version: B2.1.0.0 (B as in Beta)
Description:
Performs tradeskill combines using recipes supplied in an ini file
Credits:
Inspired by Dont_Know_At_All's Trade Skills macro - The status report idea is completely stolen from him (but rewritten by me)
Ini file uses the format created by Diggler (this will eventually being changed to a new format using item id's)
Notes:
* This is a complete overhaul of the whole macro in addition changing it to work with the new MQ2Data structures.
* You should be able to simply rename "sub main" to "sub khiTS" if you want to use this as an included file.
* No longer destroys tools or components used to do combines when destroy-results is enabled.
* This is a BIG macro and may be slow as hell on older computers.
Usage:
/macro khits <recipe_name> <options>
Example:
/macro khits bits "show-stats=0 destroy=0 abort-on-tell=0 end-on-trivial=0 silent-mode=0"
**|
#event SkillTrivial "You can no longer advance your skill from making this item"
#event SkillUp "You have become better at"
#event SkillFailure "You lacked the skills"
#event SkillSuccess "You have fashioned the items together to create something new"
#event FullInventory "There was no place to put that"
#event CombineError "You cannot combine these items in this container type!"
#chat tell
#define INIPATH "recipes.ini"
| ***** Tweek this to your computer, I use 7
#define COMBINE_DELAY 10
| Main entry point
sub Main
/echo
/echo
/echo *****************************************
/echo khiTs: Tradeskills running : ${Time}
/echo *****************************************
/echo
| Check for no parameters or help
/if (${Defined[Param0]}==FALSE || ${String[@Param0].Upper.Equal[HELP]}) {
/call displayHelp
/call clearCursor @destroyResults
/endmacro
}
| Variable declarations
| Recipe info
/declare recipeName local | The name of the combination being done, this is used to look up the recipe in the recipe.ini file
/declare containerName local | container in which the recipe will be made
/declare compCount local | Loop variable, which component we are getting the name of
/declare currentComp local | The name of the current component we're getting
/declare recipeCheck local | Make sure we have that recipe in the ini file
| Settings : "abort-on-tell=0 destroy-results=0 end-on-trivial=0 show-stats=0 silent-mode=0"
/declare abortOnTell local | Stops the macro if someone sends you a tell
/declare makeThisMany local | How many itmes the user has requested be made
/declare showStats local | Display when you succed, get skillups, fail, etc.
/declare silentMode local | Keeps MQ window spam to a minimum
| GenPurpParms
/declare slotNumber local | For looping through containers
| Only declare global variables once, this is in case you use this as an include
/if (${Defined[components]}==FALSE) {
| Recipe info
/declare components array | Array of components used to make the recipe
/declare containerNum global | Container in which the recipe will be made
/declare kludgeContNum global | This var really angers me, it's a fix for programmers that can't make up their mind if indexes start at 0 or 1 (hint for the short bus bunch, it's 0)
| Settings
/declare destroyResults global | Destroys the results of a combine (but not the ingredients
/declare endOnTrivial global | Stops the macro when you can no longer get skillups from doing the combine
| Skillup info
/declare skillAttempts global | How many times you've tried a combination
/declare skillSuccess global | How many times it worked
/declare skillFailure global | How many times it didn't work
/declare skillUps global | How many skill points you have received
} else {
| Clean out the last components used, this is in case we have not cleared the variables or are using this as an include
/varset compCount 0
:khiTSCleanComponentsLoop
/if (${String[components[@compCount]].Equal[UNDEFINED-ARRAY-ELEMENT]}) {
/varset components[@compCount] "UNDEFINED-ARRAY-ELEMENT"
/varadd compCount 1
/goto :khiTSCleanComponentsLoop
}
}
| Read the settings
|Get requested recipe's name
/varset recipeName "@Param0"
| If there is only one parameter, then there are no options
/echo khiTS: Reading parameters
/if (${Defined[Param1]}==TRUE) {
/call parseArguments "abort-on-tell" "@Param1"
/varset abortOnTell ${Macro.Return}
/call parseArguments "destroy-results" "@Param1"
/varset destroyResults ${Macro.Return}
/call parseArguments "end-on-trivial" "@Param1"
/varset endOnTrivial ${Macro.Return}
/call parseArguments "make-this-many" "@Param1"
/varset makeThisMany ${Macro.Return}
/call parseArguments "show-stats" "@Param1"
/varset showStats ${Macro.Return}
/call parseArguments "silent-mode" "@Param1"
/varset silentMode ${Macro.Return}
} else {
| Default settings
/varset abortOnTell 0
/varset destroyResults 0
/varset endOnTrivial 0
/varset showStats 0
/varset silentMode 0
}
| *** Get recipe container and ingredients
| Make sure the recipe file exists
/varset recipeCheck "${Ini[INIPATH]}"
/if (${String[@recipeCheck].Equal[NULL]}) {
/echo khiTS Error: Recipe file not found
/echo Path = INIPATH\recipe.ini
/goto :khiTSCleanUpMacro
}
| Make sure this recipe exists in the recipe.ini file
/varset recipeCheck "${Ini[INIPATH,@recipeName]}"
/if (${String[@recipeCheck].Equal[NULL]}) {
/echo khiTS Error: Recipe not found
/echo Recipe name = @recipeName
/goto :khiTSCleanUpMacro
}
| Get the container name
/varset containerName "${Ini[INIPATH,@recipeName,Cont]}"
/if (${String[@containerName].Equal[NULL]}) {
/echo khiTS Error: Error in ini file for this recipe, no container is specified
/echo Recipe name = @RecipeName
/goto :khiTSCleanUpMacro
}
| Read the ingredients for the recipe from the ini file
/varset compCount 0.00
:khiTSReadComponentsLoop
/varset currentComp "${Ini[INIPATH,@recipeName,Comp${String[@compCount].Arg[0,.]}]}"
/if (${String[@currentComp].NotEqual[NULL]}) {
/varset components(@compCount) "@currentComp"
/varadd compCount 1
/goto :khiTSReadComponentsLoop
}
| Find the combine container number
/if (${String[Enviro].Equal[@containerName]}) {
/if (${Window[Enviro].Open}==FALSE) {
/echo khiTS Error: You must have the enviromental container open first (${Window[Enviro].Open})
/goto :khiTSCleanUpMacro
}
/varset containerNum "e"
} else {
| Not an enviromental container so find the container's pack number, this is how we will refer to it from now on
/for containerNum 1 to 8
/if (${String[${Me.Inventory[Pack@containerNum]}].Equal[@containerName]}) {
/varcalc kludgeContNum @containerNum-1
| /echo kludgeContNum = @kludgeContNum
| /mqpause
/goto :khiTSFoundContainerNum
}
| Open all packs if they aren't already - you have to handle arranging them and you have to have "use ctrl-r-click" set properly
/if (${Window[Pack@containerNum].Open}==FALSE) {
/itemnotify pack@containerNum rightmouse
}
/next containerNum
| Didn't find the container
/echo khiTS Error: Could not find container in your inventory (x)
/echo Contanier name = @containerName
/goto :khiTSCleanUpMacro
}
:khiTSFoundContainerNum
| Open inventory if not open
/echo khiTS: Opening inventory and containers
/if (${Window[Inventory].Open}==FALSE) {
/windowstate inventory open
}
| Open all packs if they aren't already - you have to handle arranging them and you have to have "use ctrl-r-click" set properly - for now
/for slotNumber 1 to 8
/if (${Window[Pack@slotNumber].Open}==FALSE) {
/itemnotify pack@slotNumber rightmouseup
}
/next slotNumber
| Remove anything from the cursor if needed
/call clearCursor @destroyResults
| Clear the combine pack
/call cleanPack @containerNum
| If you can't clean out the pack - exit
/if (${Macro.Return}==FALSE) {
/echo khiTS Error: Please make sure you have enough space in your inventory
/return
}
| Delete or Save items depending on settings
/call clearCursor @destroyResults
:khiTSCombineLoop
/echo khiTS: Making a(n) @recipeName
| Move ingredients to container
/call addComponents
/if (${Macro.Return}==FALSE) {
/echo khiTS Error: Component not found
/goto :khiTSCleanUpMacro
}
| Combine
/if (${String[@containerNum].Equal[e]}) {
/click left enviro combine
} else {
/click left pack @kludgeContNum combine
}
| needs this delay here to make sure the combine is finished, you may need to tweek this to your computer/connection 10 should be safe, I can get away with 7
/delay COMBINE_DELAY
| Delete or Save items depending on settings
/call clearCursor @destroyResults
| Keep track of what we've done - these events are called individually so they do not conflict with a parent macro if this macro is used as an included file
/doevents SkillTrivial
/doevents SkillUp
/doevents SkillFailure
/doevents SkillSuccess
/doevents CombineError
/doevents FullInventory
/doevents tell
| See if we have made enough
/if (${String[@makeThisMany].Equal[@skillSuccess]}) {
/goto :khiTSCleanUpMacro
}
/goto :khiTSCombineLoop
| The macro is ending, clean up
:khiTSCleanUpMacro
| /mqpause
| Delete or Save items depending on settings - Just in case
/call clearCursor @destroyResults
/call cleanPack @containerNum
/call DisplayStats
/endmacro
/return
| Removes anything on the cursor. If DestroyResults is 1, then it will destroy anything not in the components array
sub clearCursor(DestroyResults)
:khiTSClearCursorLoop
| Is there anything on the cursor?
/if (${String[${Cursor}].NotEqual[Null]}) {
/if (@DestroyResults==0) {
/notify InventoryWindow IW_CharacterView leftmouseup
| /delay 4
} else {
| Make sure the item on the cursor is not something we want to save
/for saveCount 0 to 9
/if (${String[components(@compCount)].Equal[${Cursor.Name}]) {
/notify InventoryWindow IW_CharacterView leftmouseup
| /delay 4
| /goto :khiTSClearCursorLoop
}
/next saveCount
| Whatever is on the cursor wasn't in the save list
/destroy
}
/delay 3
/goto :khiTSClearCursorLoop
}
| /echo clearcursor done (${String[${Cursor}]})
| /mqpause
/delay 4
/return
| Finds the value of an argument in a parameter string
sub parseArgument(Argument,Parameters)
/declare argValue local | Will be 0 or 1, depending on if the argument is found, defaults are 0
/declare parmIndex local | Where, if at all, the argument is located in the parameter string
/varset argValue 0
| Look for the argument in the parameters
/varset parmIndex $instr(@Argument,@ParameterString)
/if n @parmIndex!=-1 {
| Simple kludge to make sure their is always an ending space
/if $right(1,"@Parameters")!=" " {
/varset Parameters "@Parameters "
}
/declare argLength local | How many characters long the argument string is
/declare valueIndex local | Where the value is located in the parameter string
/declare valueLength local | How many characters long the value is
/declare subParmString local | The right half of the parameter string after the argument, this would be unneeded if $instr allowed you to say where to specify and index at which to start looking
/declare subParmStringLength local | How many characters long the subParmString is
| how long is the argument?
/varset argLength $strlen(@Argument)
| Get the right side of the parameter string, after the argument and the "=" sign
/varcalc valueIndex @parmIndex+@argLength+1
/varcalc subParmStringLength $strlen("@Parameters")-@valueIndex
/varset subParmString $right(subParmStringLength,"@Parameters")
| Find the first space after the argument
/varcalc valueLength $instr(" ","@subParmString")
| And Finally get the value of the argument
/varset argValue $left(@valueLength,"@subParmString")
}
/return argValue
Sub DisplayStats
/echo khiTS: Stat display not done yet
/return
Sub Event_Chat
/if ($String[@abt].Equal[TRUE]}) {
/echo khiTS: Got a tell, pausing.
/press mqpause
}
/return
Sub Event_CombineError
/return
Sub Event_FullInventory
/echo khiTS Error: Your inventory is full, ending macro.
/call DisplayStats
/call cleanPack @containerNum
/call clearCursor @destroyResults
/endmacro
/return
Sub Event_SkillFailure
/return
Sub Event_SkillSuccess
/return
Sub Event_SkillUp
/return
Sub Event_SkillTrivial
/echo khiTS: Skill is trivial
/if (@endOnTrivial==1) {
/call DisplayStats
/call cleanPack @containerNum
/call clearCursor @destroyResults
/endmacro
}
/return
| Explain to the user how to use the macro
sub displayHelp
/echo Syntax: /macro khiTS "<recipe name>" "<options>"
/echo Example: /macro khiTS "bits" "show-stats=0 destroy=0 abort-on-tell=0 end-on-trivial=0"
/echo -
/echo MAKE SURE THAT
/echo * Recipe.ini is in your macro folder, or INIPATH points to your recipe.ini file
/echo * Inventory is open.
/echo * All your containers are open.
/echo * Nothing crosses over each other, all windows (bags, inventory, buttons) must be free.
/echo * Your windos positions are saved (by closing them and opening them again after they have been moved).
/echo -
/echo Options:
/echo --------
/echo * show-stats
/echo -- Syntax: show-stats=1|0
/echo -- Example: show-stats=0
/echo -- Shows combine statistics.
/echo -- Set to 1 for show showing stats, 0 to leave out the stats.
/echo -- Default set to 1 (show stats).
/echo -
/echo * destroy
/echo -- Syntax: destroy=1|0
/echo -- Example: destroy=1
/echo -- Tells the macro wether end-result is destroyed or kept.
/echo -- Set to 1 for destroying end-result, 1 to keep end-result.
/echo -- Default set to 0 (keep end-result).
/echo -
/echo * abort-on-tell
/echo -- Syntax: abort-on-tell=1|0
/echo -- Example: abort-on-tell=1
/echo -- Tell the macro wether it should /endmacro when recieving a tell.
/echo -- Set to 1 for ending macro on tells, 0 to ignore tells.
/echo -- Default set to 0 (ignore tells).
/echo -
/echo * end-on-trivial
/echo -- Syntax: end-on-trivial=1|0
/echo -- Example: end-on-trivial=1
/echo -- Tell the macro wether it should stop combines when recieving a trivial message.
/echo -- Set to 1 for ending macro on trivial, 0 to ignore trivial.
/echo -- Default set to 0 (ignore trivial).
/echo -
/echo * cursor-delay
/echo -- Syntax: cursor-delay=#
/echo -- Example: cursor-delay=4
/echo -- The delay between mouse commands in the macro.
/echo -- Increase this number to make the macro combine slower, but more safely. Decrease the number to combine faster, but more prone to errors.
/echo -- Default set to 2 (this is as fast as it has been tested to be able to go)
/echo -
/echo * combines
/echo -- Syntax: combine=#
/echo -- Example: combine=100
/echo -- The number of successfull combines you want made (or till no more components are available).
/echo -- Set to 0 for unlimited combines (or till no more components are available), or to the wanted amount.
/echo -- Default set to 0 (unlimited).
/echo -
/echo * default
/echo -- Syntax: default
/echo -- Tell the macro to use all default settings, any other options set will be ignored and defaults will be used.
/return
| Allow you to turn off echos for less spam on the MQ window
sub echoText(Text)
/if n silentMode!=1 /echo @Text
/return
| Return the number of free slots in your inventory or a container
sub freeInventory(PackNumber,ItemName)
/declare freeSlots local | How many slots are available
/declare iPack local | Used for looping through inventory pack nunbers
/declare iSlot local | Used for looping through pack slots
/declare startSlot local | Used with iPack to limit checking the contents of just one pack
/declare endSlot local | Used with iPack to limit checking the contents of just one pack
/varset freeSlots 0
/varset startSlot 1
/varset endSlot 8
| If no pack number is defined, we need to define it and set it to null
/if (${Defined[PackNumber]}) {
| /echo PackNumber defined
} else {
/declare PackNumber local
/varset PackNumber NULL
}
| Are we looking at an enviromental container or in our inventory
/if (${String[@PackNumber].Equal[e]}) {
/if (${Window[Enviro].Open}==NULL) {
/echo freeInventory Error: You must have the enviromental container open before testing it for available space
/return -1
}
/if (${Defined[ItemName]}) {
/echo freeInventory Error: Currently this sub does not support checking for stackable ItemName space in an enviromental container
/return -1
}
|This is REALLY crappy and slow, but right now there is no way (that I know of) to examine the contents of an enviromental container
/for iPack 0 to 9
/shiftkey /click left enviro @iPack
/if (${Cursor.ID}==NULL) {
/varadd freeSlots 1
} else {
/click left enviro @iPack
}
/next iPack
} else {
| Not enviromental container
/if (${String[@PackNumber].NotEqual[Null]}) {
/varset PackNumber ${String[@PackNumber].Arg[0,.]} | Just in case it got mangled into a float
/varset startSlot @PackNumber
/varset endSlot @PackNumber
}
/for iPack @startSlot to @endSlot
| /echo iPack = @iPack
| Check to see if there is a bag in this slot
/if (${Me.Inventory[Pack@iPack].Container}==0) {
| No bag, see if there is anything
/if (${String[${Me.Inventory[21+@iPack]}].Equal[Me]}) {
| Nothing in this slot
/if (${Defined[ItemName]}) {
| /echo Empty Pack slot
/varadd freeSlost 20
} else {
/varadd freeSlots 1
}
} else {
| See if this ItemName is what we are looking for, and see if there is free stackable space
/if (${Defined[ItemName]}) {
| /echo Name = ${Me.Inventory[21+@iPack].Name} : iPack = @iPack
if (${Me.Inventory[21+@iPack].Name.Equal[@ItemName]}) {
| See how many stackable slots are available
/if (${Me.Inventory[21+@iPack].Stackable}) {
/varcalc freeSlots @freeSlots+(20-${Me.Inventory[21+@iPack].Stack})
}
}
}
}
} else {
| This is a bag
| Are we looking for item space or just free space
/if (${Defined[ItemName]}) {
/for iSlot 1 to ${Me.Inventory[Pack@iPack].Container}
| /echo Looking at item: ${Me.Inventory[Pack@iPack].Item[@iSlot].Name}
| /echo ItemName = @ItemName
/if (${Me.Inventory[Pack@iPack].Item[@iSlot].Name.Equal[@ItemName]}) {
| /echo Found item @ItemName
| Make sure it's stackable
/if (${Me.Inventory[Pack@iPack].Item[@iSlot].Stackable}) {
/varcalc freeSlots @freeSlots+(20-${Me.Inventory[Pack@iPack].Item[@iSlot].Stack})
}
} else {
/if (${String[${Me.Inventory[Pack@iPack].Item[@iSlot]}].Equal[null]}) {
/varadd freeSlots 20
}
}
/next iSlot
} else {
| This is a bag, but item name is not given
/varcalc freeSlots @freeSlots+(${Me.Inventory[Pack@iPack].Container}-${Me.Inventory[Pack@iPack].Items})
}
}
/next iPack
}
/return @freeSlots
| Remove everything from a pack and puts in in your inventory
sub cleanPack(PackNumber)
/echo khiTS: Cleaning out pack
/declare iSlot local | Used for looping through pack slots
/declare iCount local | How many freeslots are in the bag
/if (${String[@PackNumber].Equal[e]}) {
|This is REALLY crappy and slow, but right now there is no way (that I know of) to examine the contents of an enviromental container
/for iSlot 0 to 9
/shiftkey /click left enviro @iSlot
/if (${Cursor.ID}!=NULL) {
/notify InventoryWindow IW_CharacterView leftmouseup
}
/next iSlot
} else {
| Can't empty a non-pack duh!
/if (${Me.Inventory[Pack@PackNumber].Container}==0) {
/return
}
/for iSlot 1 to ${Me.Inventory[Pack@PackNumber].Container}
| Quit if the pack is empty
/if (${Me.Inventory[Pack@PackNumber].Container}==0) {
/return TRUE
}
/if (${Me.Inventory[Pack@PackNumber].Item[@iSlot].ID}!=NULL) {
/varset iCount ${Me.Inventory[Pack@PackNumber].Items}
/shiftkey /itemnotify in pack@PackNumber @iSlot leftmouseup
/delay 2
/notify InventoryWindow IW_CharacterView leftmouseup
/delay 2
| Make sure we aren't just putting it back in the same bag
/if (${Me.Inventory[Pack@PackNumber].Items}==@iCount) {
/echo CleanPack Error: Unable to empty pack.
/return FALSE
}
}
/next iSlot
}
/delay 3
/return TRUE
| Put the components needed into the container
sub addComponents
/echo khiTS: Adding Components
/delay 2
/declare iPack local | Used for looping through inventory pack nunbers
/declare iSlot local | Used for looping through pack slots
/declare compNum local | Loop integer
/declare combSlot local | The slot number in the combine container to put the next item
/varset combSlot 1
/for compNum 0 to 9
/if (${String[@components(@compNum)].Equal[UNDEFINED-ARRAY-ELEMENT]}) {
| Didn't fail, so must have passed
/return TRUE
}
| Find the item (/finditem currently does not work with /shiftkey)
/for iPack 1 to 8
| Don't look in the container we are using to do the combine
/if (${String[@iPack].NotEqual[@containerNum]}) {
| Look inside bags
/if (${Me.Inventory[Pack@iPack].Container}>0) {
/for iSlot 1 to ${Me.Inventory[Pack@iPack].Container}
| Does this item match the component
/if (${String[@components(@compNum)].Equal[${Me.Inventory[Pack@iPack].Item[@iSlot].Name}]}) {
/call AddComp ${Me.Inventory[Pack@iPack].Item[@iSlot].InvSlot} @containerNum @combSlot
/if (!${Macro.Return}) {
/return FALSE
}
/varadd combSlot 1
/goto :FoundItem
}
/next iSlot
} else {
| Handle stuff not in bags
/if (${String[${Me.Inventory[21+@iPack]}].Equal[@components(@compNum)]}) {
/call AddComp (21+@iPack) @containerNum @combSlot
/if (!${Macro.Return}) {
/return FALSE
}
/varadd combSlot 1
/goto :FoundItem
}
}
}
/next iPack
| Didn't find the item
/echo khiTS addComponents: Couldn't find component: @components(@compNum)
/return FALSE
:FoundItem
/next compNum
/return TRUE
sub AddComp(InvSlot,CombinePackNumber,CombineSlotNumber)
| InvSlot - The slot in which the item exists
| CombinePackNumber - Destination pack number, e for enviro
| CombineSlotNumber - Destination slot number
/if (!${Defined[InvSlot]} || !${Defined[CombinePackNumber]} || !${Defined[CombineSlotNumber]}) {
/echo AddComp Error: You must specify the component, the container number, and the container slot in which to put the compents
/echo Syntax: /call AddComp "<Component Name>" <Pack Number> <Slot Number in Pack>
/return FALSE
}
| Check container to see if it is full
/if (${String[@CombinePackNumber].Equal[e]}) {
| No way I know of to check enviro containers for space - but I'm ignorant so...
} else {
/if (${Me.Inventory[pack@CombinePackNumber].Container}-${Me.Inventory[pack@CombinePackNumber].Items}==0) {
/echo AddComp Error: Unable to add this item to the container, it is full
/return FALSE
}
}
:FindEmptySlot
| /echo CombineSlot = @CombineSlotNumber
/if (${String[@CombinePackNumber].Equal[e]}) {
/if (@CombineSlotNumber>10) {
/echo AddComp Error: Unable to add this item to the container, it is full
/return FALSE
}
} else {
/if (@CombineSlotNumber>${Me.Inventory[pack@CombinePackNumber].Container}) {
/echo AddComp Error: Unable to add this item to the container, it is full
/return FALSE
}
}
| See if there's anything in the slot we are trying to put stuff
/if (${String[@CombinePackNumber].Equal[e]}) {
/itemnotify in enviro @CombineSlotNumber leftmouseup
| Make sure the cursor is clear, otherwise something was in that slot
/if (${Cursor.ID}!=NULL) {
/itemnotify in enviro @CombineSlotNumber leftmouseup
/varadd CombineSlotNumber 1
/varset CombineSlotNumber ${String[@CombineSlotNumber].Arg[0,.]}
/goto :FindEmptySlot
}
} else {
/if (${Me.Inventory[pack@CombinePackNumber].Item[@CombineSlotNumber].ID}!=NULL) {
/varadd CombineSlotNumber 1
/varset CombineSlotNumber ${String[@CombineSlotNumber].Arg[0,.]}
/goto :FindEmptySlot
}
}
| Slot is empty, so go ahead and put item into it
| Found it, pick it up and move it to the combine container
/ctrlkey /itemnotify @InvSlot leftmouseup
| /echo ComponentName = @ComponentName
| /echo CombinePackNumber = @CombinePackNumber
/if (${String[@CombinePackNumber].Equal[e]}) {
/itemnotify in enviro @CombineSlotNumber leftmouseup
} else {
/itemnotify in pack@CombinePackNumber @CombineSlotNumber leftmouseup
}
/return TRUE


