Assuming I have a callback for switches selecting a sample group.
If I was to switch samples/groups how do I keep this persistent if the script is reset (panic reset)?
Below is a snippet of what I am doing (as an example) 
function callback
 set_control_par(%ID[$original],$CONTROL_PAR_VALUE,0)
 set_control_par(%ID[$selected],$CONTROL_PAR_VALUE,1)
 $original := $selected
 end function
on ui_control($switch)
  $selected:= 0
  $group := 0
  call callback
  end on
on persistence_changed
  call callback
  end on
I'm allowing and disallowing 'on note' 
Any pointers appreciated :) 
Thank you