Here is the entire macro, the offending portion is under :skillcheck I would assume...
Thanks to all that inspired this and posted their ideas in macro depot to give me material to work with.
Code: Select all
| jewelc.mac
| by greggor (with alot of borrowed ideas)
|
|
| based on
| PowerArrows.mac
| Original by macrotoon
|
| Also contains parts from metalrings.mac Created by Wassup
|
| I hope you two don't hate me too much for what I did to your original code :)
|
| Also probably contains parts from other macro and ideas generated from
| them that I have not forgotton the source.
|
|
| 1. Put your Jeweling kit in your FIRST inventory slot
| 2. Target the merchant you wish to use but do not open merchant...
|
|
| DO NOT AFK MACRO
|
#turbo
#define DelayValue v40
#define curjewelskill v1
#define LastFail v4
#define LastSuc v5
#define CombinerID v88
#define curbar v7
#define curgem v9
#event ErrorCombine "You cannot combine these items in this container type!"
#event FailedCombine "You lacked the skills to fashion the items together."
#event SuccessCombine "You have fashioned the items together to create something new!"
#event triv "You can no longer advance
Sub Main
/varset DelayValue 1
/varset CombinerID 99
/if "$pack(0,combine)"=="Jewelry Making" /varset CombinerID 0
/if n $CombinerID==99 {
/echo The jewelry kit *MUST* be in the first inventory slot
/return
/endmacro
}
:SkillCheck
/varset curjewelskill $char(skill,"Jewelry making")
/echo $curjewelskill
/if n $curjewelskill<44 /varset curbar "Silver Bar"
/if n $curjewelskill<119 /if n $curjewelskill>=45 /varset curbar "Electrum Bar"
/if n $curjewelskill<199 /if n $curjewelskill>=119 /varset curbar "Gold Bar"
/if n $curjewelskill<22 /if n $curjewelskill>=0 /varset curgem "hematite"
/if n $curjewelskill<26 /if n $curjewelskill>=22 /varset curgem "bloodstone"
/if n $curjewelskill<28 /if n $curJewelskill>=26 /varset curgem "onyx"
/if n $curJewelskill<30 /if n $curJewelskill>=28 /varset curgem "jasper"
/if n $curJewelskill<32 /if n $curJewelskill>=30 /varset curgem "carnelian"
/if n $curJewelskill<35 /if n $curJewelskill>=32 /varset curgem "amber"
/if n $curJewelskill<40 /if n $curJewelskill>=35 /varset curgem "Jade"
/if n $curJewelskill<42 /if n $curJewelskill>=40 /varset curgem "Pearl"
/if n $curJewelskill<44 /if n $curJewelskill>=42 /varset curgem "topaz"
/if n $curJewelskill<74 /if n $curJewelskill>=44 /varset curgem "Malachite"
/if n $curJewelskill<82 /if n $curJewelskill>=74 /varset curgem "Hematite"
/if n $curJewelskill<87 /if n $curJewelskill>=82 /varset curgem "bloodstone"
/if n $curJewelskill<90 /if n $curJewelskill>=87 /varset curgem "onyx"
/if n $curJewelskill<92 /if n $curJewelskill>=90 /varset curgem "jasper"
/if n $curJewelskill<95 /if n $curJewelskill>=92 /varset curgem "carnelian"
/if n $curJewelskill<100 /if n $curJewelskill>=95 /varset curgem "amber"
/if n $curJewelskill<106 /if n $curJewelskill>=100 /varset curgem "Jade"
/if n $curJewelskill<108 /if n $curJewelskill>=106 /varset curgem "Pearl"
/if n $curJewelskill<111 /if n $curJewelskill>=108 /varset curgem "topaz"
/if n $curJewelskill<114 /if n $curJewelskill>=111 /varset curgem "Peridot"
/if n $curJewelskill<116 /if n $curJewelskill>=114 /varset curgem "Emerald"
/if n $curJewelskill<119 /if n $curJewelskill>116 /varset curgem "Opal"
/if n $curJewelskill<146 /if n $curJewelskill>=119 /varset curgem "Malachite"
/if n $curJewelskill<154 /if n $curJewelskill>=146 /varset curgem "Hematite"
/if n $curJewelskill<159 /if n $curJewelskill>=154 /varset curgem "bloodstone"
/if n $curJewelskill<162 /if n $curJewelskill>=159 /varset curgem "onyx"
/if n $curJewelskill<164 /if n $curJewelskill>=162 /varset curgem "jasper"
/if n $curJewelskill<167 /if n $curJewelskill>=164 /varset curgem "carnelian"
/if n $curJewelskill<172 /if n $curJewelskill>=167 /varset curgem "amber"
/if n $curJewelskill<178 /if n $curJewelskill>=172 /varset curgem "Jade"
/if n $curJewelskill<180 /if n $curJewelskill>=178 /varset curgem "Pearl"
/if n $curJewelskill<183 /if n $curJewelskill>=180 /varset curgem "topaz"
/if n $curJewelskill<186 /if n $curJewelskill>=183 /varset curgem "Peridot"
/if n $curJewelskill<188 /if n $curJewelskill>=186 /varset curgem "Emerald"
/if n $curJewelskill<191 /if n $curJewelskill>188 /varset curgem "Opal"
/if n $curJewelskill<196 /if n $curJewelskill>191 /varset curgem "Fire Opal"
/if n $curJewelskill<199 /if n $curJewelskill>191 /varset curgem "Star ruby"
/echo $curgem
/echo $curbar
/call makeitem
/if n $curJewelskill>=199 {
/echo Your skill cannot be increased more than 199 with this script If you wish to raise skill higher you can change the script to do so.
/cleanup
/endmacro
}
/goto :SkillCheck
Sub makeitem
/call BuyItemSingle "$curgem" 0
/call findbar
/call Makejewel
/call SellItem $curbar
/return
Sub BuyitemSingle
/press u
/delay 20
/if "$item($CombinerID,$p1,name)"=="$p0" /return
/selectitem "$p0" merchant
/delay 1
/sendkey up shift
/buyitem 1
:WaitBuy
/delay 1
/if "$item($CombinerID,$p1,name)"!="$p0" /goto :WaitBuy
/click left merchant done
/delay 1
/return
Sub Makejewel
/if $pack($CombinerID,closed)==TRUE {
/echo You *MUST* have your Jewelry kit open..
/endmacro
}
/varset LastFail 0
/varset LastSuc 0
/click left pack $CombinerID combine
:WaitForCombine
/delay 1
/if $pack($CombinerID,empty)==FALSE /goto :WaitForCombine
/for v75 1 to 10
/delay 1
/doevents
/if n $LastFail==1 /return
/if $cursor()==TRUE /goto :PutAwayArrows
/next v75
:PutAwayArrows
/click left auto
:WaitDrop
/delay 1
/if $cursor()==TRUE /goto :WaitDrop
/return
Sub SellItem
/doevents
/if n $LastFail==1 /return
/finditem similar "$curgem"
/for v75 1 to 10
/delay 1
/doevents
/if n $LastFail==1 /return
/if n $LastSuc==1 /goto :DoSellItem
/next v75
/if $getlasterror==FIND_NOTFOUND /return
:DoSellItem
/sendkey down shift
/delay 1
| This check is to make sure the items actually landed in the inventory and not
| somewhere else.
/if "$item($CombinerID,0,name)"~~"$curgem" /click left merchant buy
|
|
:WaitForSale
/if "$item($CombinerID,0,name)"~~"$curgem" {
/delay 1
|/echo $item($CombinerID,0,name)
/goto :WaitForSale
}
/sendkey up shift
/click left merchant done
/return
Sub Event_ErrorCombine
/endmacro
/return
Sub Event_FailedCombine
/varset LastFail 1
|/echo Detected Fail
/return
Sub Event_SuccessCombine
/varset LastSuc 1
|/echo Detected Combine
/press u
/delay 20
/return
sub findbar
/sendkey down ctrl
/finditem similar "$curbar"
/delay $DelayValue
/if $cursor()!=True /goto :EndIt
:ReClick1
|Place Jewel
/click left pack 0 1
/delay $DelayValue
/if "$cursor(name)"~~"$curbar" /goto :ReClick1
/sendkey up ctrl
/return
sub event_triv
/endmacro
/return
Thanks in advance for any help :)
edit: Valerian likes code brackets


