Help neeeded with renderer script
I'm a Maxscript beginner. I wanted write a script to to Disable all lights, switch to Mental Ray & and create an Ambient Occlusion material. I do this quite a bit and I thought it would be nice to script it. The problem is I can't get the script to check the current active renderer before it switches to Mental Ray. My if statement won't test true. See I wanted it do maybe do or say something else if the renderer is already set to MR. Hope this makes sense.
mental = mental_ray_renderer()
scan = default_scanline_renderer()
if renderers.current == scan then
lights.enabled = false
renderers.current = mental
mental.FinalGatherEnable2 = false
meditMaterials.name = "AO"
meditMaterials.selfillumMap = Ambient_Reflective_Occlusion__3dsmax ()
meditMaterials.useSelfIllumColor = on
mental.Enable_Material_Override = true
mental.Override_Material = meditmaterials
else messagebox "Error"