i tried to modify this smithing macro to just combine items past the 115 mark so i could just buy a lot and let it combine em for me. but i keep getting the message
flow ran into another subroutine
smithing.mac@75 (readini(RecipeName)): sub readini(RecipeName)
the current macro has ended
here is my macro
Code: Select all
#event CombineError "#*#There was no place to put that#*#"
#event CombineError "#*#You cannot combine these items in this container type!#*#"
#event CombineError "#*#did not accept these items#*#"
#event ContUsed "#*#Someone else is using that. Try again later.#*#"
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc
Sub Main
/declare OldSkill int outer
/declare SkillMaxWanted int outer
/declare PackCode string outer
/declare Component[10] string outer
/declare i int outer
/declare CompA item outer
/declare CompB item outer
/declare CompC item outer
/declare CombItemName string outer
/declare ItemTo string outer
/declare EndingVar int outer
/declare Levelname int outer
/varset OldSkill ${Me.Skill[Blacksmithing]}
/varset SkillMaxWanted 210
:start
/echo Blacksmithing is at ${Me.Skill[Blacksmithing]}
/if (${Me.Skill[Blacksmithing]}>=${SkillMaxWanted}) {
/echo Blacksmithing is at ${SkillMaxWanted}. Quiting!
/endmacro
}
/if (${Me.Skill[Blacksmithing]}<210) {
/varset CompA "coldain velium temper"
/varset CompB "small piece of velium"
/varset CompC "spell: enchant velium"
/varset CombItemName "EV"
/varset ItemTo "enchanted velium bits"
}
/call GotoForge
/look
/delay 1s
/nomodkey /click left item
/delay 2s
/doevents
/delay 1s
/call OpenPacks
/delay 2s
/call readIni "${CombItemName}"
:Begin
/if (${EndingVar}==1) /call ClearCursor
/for i 1 to 10
/if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i}
/next i
/if (${EndingVar}==1) /call DoCombine
/if (${EndingVar}==1) /goto :Begin
/delay 1s
/call ClosePacks
/nomodkey /keypress esc
Sub readIni(RecipeName)
/declare Container string
/echo Running ${RecipeName} recipe
/if (${Ini["smithing.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container ${Ini[smithing.ini,${RecipeName},Cont,Enviro]}
/if (${Container.Equal[Enviro]}) {
/varset PackCode Enviro
} else {
/varset PackCode ${FindItem[=${Container}].InvSlot}
/if (${PackCode.Equal[NULL]}) {
/echo Could not find container ${Container}
/varset EndingVar 2
/return
}
| pack1 = 22, ... , pack8 = 29
/varset PackCode pack${Math.Calc[${PackCode}-21].Int}
}
/call cleanPack ${Container}
/for i 1 to 10
/varset Component[${i}]
${Ini[smithing.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
| /autoinv
/destroy
/delay 5
/doevents
/goto :Loop
/return
sub DoCombine
:Loop
/combine ${PackCode}
/delay 1s
/if (${PackCode.Equal[Enviro]}) /delay 1s
/doevents
/if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop
/delay 5
/if (${Me.Skill[Blacksmithing]}>${OldSkill}) {
/echo Your Blacksmithing Went Up!! It's now ${Me.Skill[Blacksmithing]}!
/varset OldSkill ${Me.Skill[Blacksmithing]}
}
/return
sub AddComp(CompName, PackSlot)
/if (${CompName.Equal[NOTFOUND]}) /return
/if (!${FindItem[=${CompName}].ID}) {
/echo Could not find ${CompName} in inventory
/beep
/varset EndingVar 2
/return
}
:Loop
/nomodkey /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup
/if (!${Cursor.ID}) {
/delay 1
/goto :Loop
}
/if (${PackCode.Equal[Enviro]}) {
/nomodkey /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup
} else {
/nomodkey /itemnotify in ${PackCode} ${PackSlot} leftmouseup
}
/return
Sub Event_CombineError
/varset EndingVar 2
/return
Sub Event_ContUsed
/echo Container in use. Waiting 30 seconds and trying again.
/delay 30s
/itemtarget "Forge"
/delay 1s
/nomodkey /click left item
/delay 2s
/doevents
/return
Sub GoToForge
:forge
/itemtarget "Forge"
/if (${Me.State.Equal[SIT]}) /stand
/face
/if (${Target.Distance}>10) /nomodkey /keypress forward hold
/if (${Target.Distance}<=10) {
/nomodkey /keypress forward
/goto :end
}
:end
/return
and here is my .ini file
Code: Select all
[BM]
Cont=Enviro
Comp0=mail sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=sheet metal
Comp4=water flask
[BG]
Cont=Enviro
Comp0=gorget mold
Comp1=sheet metal
Comp2=water flask
[BC]
Cont=Enviro
Comp0=cloak sectional mold
Comp1=sheet metal
Comp2=sheet metal
Comp3=water flask
[EV]
Cont=Enviro
Comp0=coldain velium temper
Comp1=small piece of velium
Comp2=small piece of velium
Comp3=spell: enchant velium


