If you know an item -will- be returned, or have a high chance of being returned upon a combine (or failed combine), those items are recommended to be listed as the first items on the list of components. This saves the macro from cycling through the array more than necessary, thereby taking up less ressources and less time.
Edit:
Added the new Argument Parsing routines I have been working on, wich now makes it possible to change all settings from within EverQuest, or merely let it use its hardcoded defaults.
Type:
/macro ts help
in-game for more help (beware, it produces a lot of text).
I didn't want to make a new thread with this, calling it sisits (/tease fryfrog thanks for all your awesome additions), cause all scripts evolve, no reason to start new threads, just give them new version numbers ;) (mine is oddly enough still version unknown, I just add features as I find the time, and need).
As allways, use at your own risk, I take no responsibility for accidently destroyed items etc. (trust me I have been there during the making of some of my macros ;).
Please post any changes, bugs, or bugfixes on this thread, I will edit the original post (this one) with the changes, as well as proper credits ;)
Have fun tradeskilling without spraining your wrist :)
Code: Select all
| ts.mac (tradeskill.mac)
| -----------------------
| *** DESCRIPTION ***
| ts.mac is a versatile Tradeskilling Macro, made for the purpose of lessening the strain
| on our wrists and fingers.
|
| A quick list of some of it's features.
|
| - Can combine up to 10 items in the selected combiner.
|
| - Can be set to destroy the end-combine (good for when skilling up) rather than keep it.
| (Thanks to pita for fixing this)
|
| - Pause script by targeting self.
| (Thanks to fryfrog)
|
| - Combine X number of successes, or unlimited.
| (Thanks to fryfrog)
|
| - Turn on/off display of statistics.
| (Thanks to fryfrog for implementing, thanks to pita for minor cosmetic fix)
|
| - Statistics about combines such as trivial combines, successes, failures, skillups, % of
| successes and % of skillups.
| (Thanks to fryfrog)
|
| - Trivial warning.
| (Thanks to fryfrog)
|
| - Failed combine recovery, cleans pack and retries 2 times.
| (Thanks to fryfrog for implementing, thanks to Kagonis for minor fix)
|
| - Can use wildcard matching on both combiner and components. Ie: "#ore" matches
| "small brick of high quality ore", and "#sewing" matches "Collapsible Sewing Kit" etc.
| (Thanks to Serberus for initial idea, Kagonis for cleanup)
|
| - Can change all settings from within EverQuest, thanks to the new arugment parsing
| routines.
| (Thanks to Kagonis)
|
| A few things to note before starting to use this..
| 1. Open ALL container windows and your Inventory window, as well as any enviromental
| combiners needed such as forge, pottery wheel etc.
| 2. Place all so none of the windows are hidden beneath another window.
| 3. Make sure to close all container windows if you moved them since opening them, then
| open them, this is to save their positions, so the Macro can find the right slots.
|
| In game, type the following for more help..
| /macro ts help
|
|
| *** SYNTAX ***
| /macro ts <"various options here"> <"combiner"> <"component"> ["component"]...
|
|
| *** EXAMPLE ***
| /macro ts "default" "Mortar and Pestle" "Celestial Solvent" "The Scent of Marr"
|
|
| *** CREDITS ***
| These are the persons I know I borrowed code from, I'm sure I forgot some..
| In no particular order..
| --
| Gengis, Pigeon, Serberus, fryfrog, pita.
|
|
| *** TODO ***
| - Ini file support.
| Save recipes in an ini file, and call them by their recipe name.
| /macro ts "default" "ini" "Celestial Essence"
|
| [Celestial Essence]
| comb1=Mortar and Pestle
| comb2=Collabisble Mortar and Pestle
| comp1=Celestial Solvent
| comp2=The Scent of Marr
|
| It should be possible to give it multiple choices of comb(iners), the script should then
| just select, and use the first comb(iner) found.
|
#turbo
#define CombStr v1
#define CombInt v2
#define TotalComp v3
#define dly v4
#define abt v5
#define cbe v6
#define SkillFailCounter v50
#define SkillSuccessCounter v51
#define SuccessRate v53
#define TotalAttempts v54
#define SkillUpCounter v55
#define SkillUpRate v56
#define ShowStats v57
#define CombineErrorCounter v58
#define SkillTrivialCounter v59
#define FinishedProduct v60
#define ErrorAtCombine v61
#define DesiredSuccesses v62
#define EndOnTrivial v63
#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
Sub Main
/call SetDefaults
/if "$p0"=="" /call ExecError
/if "$p0"=="help" /call ShowHelp
/call ParseArgs "$p0"
/varset ErrorAtCombine 0
/varset CombineErrorCounter 0
/varset SkillTrivialCounter 0
/varset SkillFailCounter 0
/varset SkillSuccessCounter 0
/varset SuccessRate 0
/varset TotalAttempts 0
/varset SkillUpRate 0
/varset SkillUpCounter 0
/call CombFind "$p1"
/if $CombInt<=7 /varset CombStr "pack $CombInt"
/if $CombInt==8 {
/varset CombInt e
/varset CombStr enviro
}
/if $CombInt>=98 /if $CombInt<=99 {
/if n $CombInt==99 /echo Cannot find container << $p1 >>
/if n $CombInt==98 /echo Too far away from << $p1 >>
/endmacro
}
/varset TotalComp 0
/call ClearCursor $FinishedProduct
:CountComponents
/varset a(1,$TotalComp) "$p$int($calc($TotalComp+2))"
/varadd TotalComp 1
/if n $int($TotalComp)>10 /call ExecError
/echo Component $int($TotalComp): $p$int($calc($TotalComp+1))
/if "$p$int($calc($TotalComp+2))"~~"$" {
/goto :DestroyCheck
} else /if "$p$int($calc($TotalComp+2))"=="" {
/goto :DestroyCheck
} else {
/goto :CountComponents
}
:DestroyCheck
/if $FinishedProduct=="DESTROY" {
/beep
/press F1
/echo This macro is currently set to destroy successful combines!!!!
}
:Begin
/call ClearCursor $FinishedProduct
/doevents
/if "$target(name,clean)"=="$char(name)" {
/echo Pausing!! To resume, type /target clear or target something
else.
:HoldingPattern
/delay 2s
/if "$target(name,clean)"=="$char(name)" /goto
:HoldingPattern
}
/if n $DesiredSuccesses!=0 /if n $DesiredSuccesses<=$SkillSuccessCounter {
/echo Created $int($DesiredSuccesses) items as requested!
/call EndCombines
}
/for l0 0 to $int($calc($TotalComp-1))
/call AddComp "$a(1,$l0)" $l0
/next l0
:Combine
/doevents
/call DoCombine
:ClearCursor
/doevents
/call ClearCursor $FinishedProduct
}
/goto :Begin
/return
Sub SetDefaults
/varset ShowStats 1
/varset EndOnTrivial 0
/varset dly 2
/varset abt 0
/varset FinishedProduct "keep"
/varset DesiredSuccesses 0
/return
Sub CheckOptions
/if "$p1"=="" {
/echo Syntax: /call CheckOptions "option" "value"
/endmacro
}
/if "$p0"=="combines" /varset DesiredSuccesses $int($p1)
/if "$p0"=="cursor-delay" /varset dly $int($p1)
/if "$p0"=="end-on-trivial" /varset EndOnTrivial $int($p1)
/if "$p0"=="abort-on-tell" /varset abt $int($p1)
/if "$p0"=="destroy" /if n $p1==1 /varset FinishedProduct "destroy"
/if "$p0"=="show-stats" /varset ShowStats $int($p1)
/return
Sub ParseArgs
/if "$p0"=="" {
/echo Syntax: /call ParseArgs "space seperated string of arguments"
/endmacro
}
/if "$p0"~~"default" {
/call SetDefaults
/goto :EndOptions
}
/varset l0 "$p0"
/call CountArgs "$l0"
/varset l1 $int($return)
/for l2 1 to $l1
/if n $l1>1 /varset l0 "$arg($int($l2),"$p0")"
/varset l3 $left($instr("=","$l0"),"$l0")
/varset l4 $right($calc($strlen("$l0")-$instr("=","$l0")-1),"$l0")
/call CheckOptions "$l3" "$l4"
/next l2
:EndOptions
/return
Sub CountArgs
/if "$p0"=="" {
/echo Syntax: /call CountArgs "space seperated string of arguments"
/endmacro
}
/varset l0 1
/varset l1 1
:Loop
/if "$mid($int($l1),1,"$p0")"==" " /varadd l0 1
/varadd l1 1
/if n $l1<$strLen("$p0") /goto :Loop
/return $int($l0)
Sub ExecError
/echo Syntax error.
/echo Type the following for more help:
/echo /macro ts "help"
/endmacro
/return
Sub ShowHelp
/echo Syntax: /macro ts <options> <CombinerName> <Component> [Component]...
/echo Example: /macro ts "show-stats=0 destroy=0 abort-on-tell=0 end-on-trivial=0"
"Sewing Kit" "Spider Silk" "Spider Silk"
/echo -
/echo MAKE SURE THAT:
/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.
/endmacro
/return
Sub CleanPack
/press ctrl
/sendkey down shift
/if "$CombStr"=="enviro" {
/varset l0 10
} else {
/varcalc l0 $pack($CombInt,slots)-1
}
/for l1 0 to $l0
/click left $CombStr $l1
/delay $dly
/click left auto
/delay $dly
/next l1
/sendkey up shift
/press shift
/return
sub ClearCursor
:Loop
/delay $dly
/if $cursor()!=NULL {
/if "$p0"=="DESTROY" {
/varset l0 0
:SubLoop
/if "$a(1,$l0)"~~"#" {
/varset l1
"$right($calc($strlen("$a(1,$l0)")-1),"$a(1,$l0)")"
/varset l2 0
} else {
/varset l1 "$a(1,$l0)"
/varset l2 1
}
/if n $l2==0 /if "$cursor(name)"~~"$l1" {
/click left auto
/delay $dly
} else /if n $l2==1 /if "$cursor(name)"=="$l1" {
/click left auto
/delay $dly
}
/if "$cursor()"!="NULL" {
/if n $l0< $calc($TotalComp-1) {
/varadd l0 1
/goto :SubLoop
} else {
/click left destroy
/delay $dly
}
}
} else {
/click left auto
/delay $dly
}
}
/if $cursor()!=NULL /goto :Loop
/return
sub DoCombine
:Loop
/click left $CombStr combine
/doevents
/delay $dly
/if $pack($CombInt,empty)==FALSE /goto :Loop
/return
sub AddComp
/press shift
/sendkey down ctrl
/if "$p0"~~# {
/finditem similar "$right($calc($strlen("$p0")-1),"$p0")"
} else {
/finditem "$p0"
}
/if $find()==FALSE /goto :NoComp
/delay $dly
/click left $CombStr $p1
/goto :End
:NoComp
/echo Could not find << $p0 >>
/call EndCombines
:End
/sendkey up ctrl
/press ctrl
/return
Sub CombFind
/varset CombInt 99
/if "$p0"~~"#" {
/varset l1 "$right($calc($strlen("$p0")-1),"$p0")"
/varset l2 0
} else {
/varset l1 "$p0"
/varset l2 1
}
/for l3 0 to 7
/if n $l2==0 /if "$pack($l3,name)"~~"$l1" /varset CombInt $l3
/if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset CombInt $l3
/next l3
/if n $CombInt==99 {
/if "$l1"=="enviro" /varset CombInt 8
/if n $CombInt!=8 /itemtarget $p0
/if n $CombInt!=8 /if n $ground(id)==0 /varset CombInt 99
/if n $CombInt!=8 /if n $distance(item)>20 /varset CombInt 98
/if n $CombInt!=8 /if n $ground(id)>0 /if n $distance(item)<=20 /varset
CombInt 8
}
/return $CombInt
Sub DisplayStats
/echo Combine Statistics - Successes: $int($SkillSuccessCounter), Failures:
$int($SkillFailCounter), Trivial: $int($SkillTrivialCounter)
/varcalc TotalAttempts $SkillFailCounter + $SkillSuccessCounter
/if $TotalAttempts>0 {
/varcalc SuccessRate $SkillSuccessCounter / $TotalAttempts * 100
/varcalc SkillUpRate $SkillUpCounter / $TotalAttempts * 100
/echo Successes Rate: $int($SuccessRate) % out of $int($TotalAttempts) attempts
} else {
/echo Unable to complete a combine. No Stats to report
}
/if n $SkillUpCounter>0 /echo Skill Ups: $int($SkillUpCounter) , Skill Rate:
$int($SkillUpRate) % out of $int($TotalAttempts) attempts
/if n $SkillTrivialCounter>0 /echo THIS ITEM IS OR HAS GONE TRIVIAL!
/return
Sub EndCombines
/call CleanPack
/if n $ShowStats==1 /call DisplayStats
/endmacro
/return
Sub Event_Chat
/if "$abt"=="TRUE" {
/echo Got a tell, pausing.
/press F1
}
/return
Sub Event_CombineError
/varcalc ErrorAtCombine $SkillFailCounter + $SkillSuccessCounter
/varadd CombineErrorCounter 1
/if n $CombineErrorCounter<=1 {
/echo Attempting to recover from failed combine!
/call CleanPack
} else {
/echo Failed to recover from failed combine!
/call EndCombines
}
/return
Sub Event_FullInventory
/echo Your inventory is full, ending macro.
/call EndCombines
/return
Sub Event_SkillFailure
/varadd SkillFailCounter 1
/if n $CombineErrorCounter>=1 /varset CombineErrorCounter 0
/return
Sub Event_SkillSuccess
/varadd SkillSuccessCounter 1
/if n $CombineErrorCounter>=1 /varset CombineErrorCounter 0
/return
Sub Event_SkillUp
/varadd SkillUpCounter 1
/echo $int($SkillUpCounter) skill ups in
$int($calc($SkillFailCounter+$SkillSuccessCounter)) attempts!
/return
Sub Event_SkillTrivial
/varadd SkillTrivialCounter 1
/if n $ShowStats==1 /if n $SkillTrivialCounter==1 /echo THIS ITEM IS OR HAS GONE
TRIVIAL!
/if n $EndOnTrivial==1 /if n $SkillTrivialCounter==1 /call EndCombines
/return


