The Code is meant to save current subtool so if I change subtools and press the button for a 2nd time it will go back. But the script give the following error on Cycle1.
Not sure how to get it to not forget the toolID for the 2nd press of the button
“SCRIPT: Test.TXT
ERROR: toolID
IN:[ISet,Tool:Item Info,toolID]”
CODE
[RoutineDef,Test,
//Create Memory Block to store which cycle the macro is on
[If,[MemGetSize,MP_MaskCycleMemBlock],
//Create and then set to 0
[MVarDef,MP_MaskCycleMemBlock,1,0]
[MVarSet,MP_MaskCycleMemBlock,0,0] //CurrentCycle
]
[VarSet,CurrentCycle,[MVarGet,MP_MaskCycleMemBlock,0]]
[Note,[StrMerge,"CurrentCycle is ",CurrentCycle],.5]
//Get Subtool
[If,CurrentCycle==0,
[VarSet,toolID,[IGet,Tool:Item Info]]
,]
//Go To Subtool
[If,CurrentCycle==1,
[ISet,Tool:Item Info,toolID]
,]
[If,CurrentCycle>=1,
[VarSet,CurrentCycle,0]
[MVarSet,MP_MaskCycleMemBlock,0,CurrentCycle]
,
[MVarSet,MP_MaskCycleMemBlock,0,CurrentCycle+1]
]
]//Routine Test
[IButton,???,“Toggles to Subtool. (Hotkey for best use!)”,
[IShowActions,0]
[IConfig,4.73]
//[IFreeze,
[RoutineCall,Test]
//]
,1,]