Code: Select all
|Tradeskill.mac
| by Zeus
|
| *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 Minotaur Hero Brew**
#event Fail "You lacked the skills"
#event Hands "Your hands"
#event Full "There was no place to put that"
|Statistics variables
#define StartValue v21
#define EndValue v22
#define AttemptsCount v23
#define SuccessCount v24
#define FailureCount v25
#define SuccessRate v26
#define SkillUps v27
#define CombinesPerSkill v28
|Program Variables
#define DelayValue v30
#define Components v40
#define DestroyedItemsCount v41
#define SkillCap v70
#define SkillName v71
#define ContainerSlot v80
#define CombineBag v91
Sub Main
|Initialize Program variables
/varset Components 5
/varset DelayValue 1
/varset SkillName "Brewing"
/varset SkillCap 248
/varset CombineBag "enviro"
|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) "Water Flask"
/varset a(1,2) "Short Beer"
/varset a(1,3) "Malt"
/varset a(1,4) "Yeast"
/varset a(1,5) "Cask"
/varset a(1,6) " "
/varset a(1,7) " "
/varset a(1,8) " "
/varset a(1,9) " "
/varset a(1,10) " "
|Set Item Quantities
/varset a(2,1) 2
/varset a(2,2) 2
/varset a(2,3) 3
/varset a(2,4) 1
/varset a(2,5) 1
/varset a(2,6) 0
/varset a(2,7) 0
/varset a(2,8) 0
/varset a(2,9) 0
/varset a(2,10) 0
|Set Items to Destroy
/varset a(3,1) "Bottle"
/varset DestroyedItemsCount 1
/sendkey down ctrl
|Turn fast item destroy on
|Clean container before starting
/call CleanContainer
:CombineLoop
|check if at skill cap
/if n $char(skill,$Skill)==$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
/sendkey down shift
/for v1 0 to 9
/click left $CombineBag $v1
/delay $DelayValue
/click left auto
/next v1
/sendkey up shift
/return
Sub GetItem
/for v1 1 to $p1
/finditem "$p0"
/delay $DelayValue
/if $cursor()!=True {
/echo Out of $p0
/return 0
}
:ReClick
/click left $p2 $ContainerSlot
/delay $DelayValue
/if "$cursor(name)"=="p0" /goto :ReClick
/varadd ContainerSlot 1
/next v1
/return 10
Sub ClearCursor
|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 Sucess 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
Ps: Anyone know how to turn fast item destroy on/off by text?
EDIT: Smileys fixed :P



