• if ($did == 2) { $walias(visuals,Join,$iif($did(2).state,On,Off)) }

Although you might like to use
  • if ($did == 2) { $walias(visuals,Join,$did(2).state) }
which would make the entry 0 (Off) or 1 (On)
[visuals]
Join=0
Part=1

Then in the init you can use this simpler code.
  • if $ralias(visuals,Join) { did -c $dname 2 }
    if $ralias(visuals,Part) { did -c $dname 3 }

Code:
ralias [color:tomato]return[/color] $readini([color:red]dat\ini\[/color]test.ini,$1,$2)