Moderator: MacroQuest Developers
Code: Select all
/if "$UCASE($cursor(name))"~~"@DontDestroy" {
/autoinv
/delay @dly
} else {
/click left destroy
/delay @dly
} Code: Select all
#define INIPATH "recipes.ini"Code: Select all
sub ClearCursor
| Maestro: I left the original code intact since I'm a noob and don't quite grok it.
| In looking at it, I wonder if it might already be trying to save tools
| I inserted a check before the destroy to see if the item is on the component list
| If so, it auto's it instead.
/declare loop local | loop counter
/declare keep local | when set to 1 will not destroy item on cursor
/declare curse local | item on cursor
/declare comp local | item to compare against
/declare l0 local
/declare l1 local
/declare l2 local
:Loop
/delay @dly
/if $cursor()!=NULL {
| /echo cursor is $cursor()
/if "@Param0"=="DESTROY" {
/varset l0 0
:SubLoop | Maestro: Don't know what this does so leaving it
/if "@a(@l0)"~~"#" {
/varset l1 "$right($calc($strlen("@a(@l0)")-1),"@a(@l0)")"
/varset l2 0
} else {
/varset l1 "@a(@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 | Maestro: end of something
} else { | Maestro: Set flag to 0, Loop through ini, set keep to 1 if item found
/varset keep 0
/for loop 0 to 9
/varset comp "$ucase("$ini("INIPATH","@recipeName","Comp@loop")")"
/varset curse "$cursor(name)"
/varset curse "$ucase("@curse")"
/if "@comp"~~"@curse" {
/echo Saving $cursor(name)
/varset keep 1
}
/if "@currentComp"=="NOTFOUND" {
/goto :forBreak
}
/next loop
:forBreak
/if n @keep==0 {
/click left destroy
/delay @dly
} else {
/click left auto
/delay @dly
}
}
}
} else {
/click left auto
/delay @dly
}
}
/if $cursor()!=NULL /goto :Loop
/return
Code: Select all
dontdestroy="x,y,z"
Code: Select all
sub ClearCursor
/declare l0 local
/declare l1 local
/declare l2 local
:Loop
/delay @dly
/if $cursor()!=NULL {
| /echo cursor is $cursor()
/if "@Param0"=="DESTROY" {
/varset l0 0
:SubLoop
/if "@a(@l0)"~~"#" {
/varset l1 "$right($calc($strlen("@a(@l0)")-1),"@a(@l0)")"
/varset l2 0
} else {
/varset l1 "@a(@l0)"
/varset l2 1
}
/if n @l2==0 /if "$cursor(name)"~~"@l1" {
/autoinv
/delay @dly
} else /if n @l2==1 /if "$cursor(name)"=="@l1" {
/autoinv
/delay @dly
}
/if "$cursor()"!="NULL" {
/if n @l0< $calc(@TotalComp-1) {
/varadd l0 1
/goto :SubLoop
} else /if "$UCASE($cursor(name))"~~"@DontDestroy" {
/autoinv
/delay @dly
} else {
/destroy
/delay @dly
}
}
} else {
/autoinv
/delay @dly
}
}
/if $cursor()!=NULL /goto :Loop
/return
