Code: Select all
|Tradeskill.mac
| by Zeus
| updated for new MQ by Spectre
|
| *Based on Wassup combine routines
|
| Adjust DelayValue according to the spped of your computer,
| connection ad screen lag, minimun value is one
|
| Components = Number of components the recipe uses
| SkillCap = Where the reciple trivializes or where you want to get
| Skill = Skill
|
| Item Names in array 1 and quantity of matching items in array 2
| Example: Recipe uses 3 water flasks
| /varset a(1,1) "Water Flask"
| /varset a(2,1) 3
|
| Byproducs that you want to destroy after the combine go in array 3
|
| Remember to have all your bags and the enviroemtnal container if any open
|
| Todo: Find text command to turn fast item destroy on
|
| **Example for Heady Koila**
#turbo
#event Fail "You lacked the skills"
#event Hands "Your hands"
#event Full "There was no place to put that"
Sub Main
|Statistics variables
/declare StartValue global
/declare EndValue global
/declare AttemptsCount global
/declare SuccessCount global
/declare FailureCount global
/declare SuccessRate global
/declare SkillUps global
/declare CombinesPerSkill global
|Program Variables
/declare DelayValue global
/declare Components global
/declare DestroyedItemsCount global
/declare SkillCap global
/declare SkillName global
/declare ContainerSlot global
/declare CombineBag global
/declare a array2
/declare v5 local
|Initialize Program variables
/varset Components 2
/varset DelayValue 1
/varset SkillName "Jewel Craft"
| if using this macro for skillups, put the trivial for this combine on the next line
/varset SkillCap 999
/varset CombineBag "Planar jewellers kit"
|Initialize Statistical variables
/varset StartValue $char(skill,"@SkillName")
/varset AttemptsCount 0
/varset SuccessCount 0
/varset FailureCount 0
/varset SuccessRate 0
/varset SkillUps 0
/varset CombinesPerSkill 0
|Set Item Names
/varset a(1,1) "Cat's Eye Agate"
/varset a(1,2) "Enchanted Silver Bar"
/varset a(1,3) " "
/varset a(1,4) " "
/varset a(1,5) " "
/varset a(1,6) " "
/varset a(1,7) " "
/varset a(1," "
/varset a(1,9) " "
/varset a(1,10) " "
|Set Item Quantities
/varset a(2,1) 1
/varset a(2,2) 1
/varset a(2,3) 0
/varset a(2,4) 0
/varset a(2,5) 0
/varset a(2,6) 0
/varset a(2,7) 0
/varset a(2, 0
/varset a(2,9) 0
/varset a(2,10) 0
|Set Items to Destroy
|/varset a(3,1) "Unfired Opal Encrusted Stein"
/varset DestroyedItemsCount 0
/sendkey down ctrl
|Turn fast item destroy on
|Clean container before starting
/call CleanContainer
:CombineLoop
|check if at skill cap
/if n $char(skill,"@Skillname")==@SkillCap {
/echo "Skill Maxed"
/return
}
|Set Slot to first
/varset ContainerSlot 0
|Put Components in container
/for v5 1 to @Components-1
/call GetItem "@a(1,@v5)" "@a(2,@v5)" "@CombineBag"
/doevents Hands
/if n $return==0 /call End
/next v5
|Click the Combine button
/click left @CombineBag combine
/delay 10
/varadd AttemptsCount 1
/doevents Fail
/call ClearCursor
/goto :CombineLoop
/return
|Clear enviromental container routine
Sub CleanContainer
/declare v1 local
/for v1 0 to 9
/click left @CombineBag @v1
/delay @DelayValue
/click left auto
/next v1
/return
Sub GetItem(ItemType, ItemCount, ItemContainer)
/declare v1 local
/for v1 1 to @ItemCount
/finditem "@ItemType"
/delay @DelayValue
/if $cursor()!=True {
/echo Out of @ItemType
/return 0
}
:ReClick
/click left @ItemContainer @ContainerSlot
/delay @DelayValue
/if "$cursor(name)"=="@ItemType" /goto :ReClick
/varadd ContainerSlot 1
/next v1
/return 10
Sub ClearCursor
/declare v3 local
|Drop everything in auto equip
:AutoDrop
/if $cursor()==True {
/for v3 1 to @DestroyedItemsCount
/if "@a(3,@v3)"=="@cursor(name)" {
/click left destroy
/goto :AutoDrop
}
/next v3
/click left auto
/delay @DelayValue
/goto :AutoDrop
}
/return
Sub End
/sendkey up ctrl
|Turn fast item destroy off
/call CleanContainer
/call Stats |Comment this line if you dont want statistics
/cleanup
/zapvars
/endmacro
/return
Sub Stats
/if n @AttemptsCount>0 {
/varset EndValue $char(skill,"@SkillName")
/varcalc SuccessCount @AttemptsCount - @FailureCount
/varcalc SuccessRate @SuccessCount/@AttemptsCount * 100
/varcalc SkillUps @EndValue - @StartValue
/if n @SkillUps>0 /varcalc CombinesPerSkill @AttemptsCount/@SkillUps
/echo @SkillName Report
/echo Skill Range: @StartValue - @EndValue, @SkillUps skill increases
/echo @AttemptsCount Attempts: @SuccessCount Success, @FailureCount Failures
/echo Success Rate of @SuccessRate%
/if n @SkillUps>0 /echo Average of @CombinesPerSkill Combines per skill increase
} /else {
/echo No attempts made
}
/return
Sub Event_Fail
/varadd FailureCount 1
/delay @DelayValue
/doevents flush
/return
Sub Event_Hands
/call ClearCursor
/call CleanContainer
/doevents flush
/return
Sub Event_Full
/call End
/return 
