Code:
alias call.popusn
  set %Relay2 $iif($did(14).state == 1, on, off)
  set %relay1 $iif($did(15).state == 1, on, off)
  set %relay $iif($did(16).state == 1, on, off)
  set %relay3 $iif($did(17).state == 1, on, off)
  set %longnick $iif($did(18).state == 1, on, off)
  set %quitpart $iif($did(19).state == 1, on, off)
  set %flood $iif($did(20).state == 1, on, off)
  set %dcc. $iif($did(21).state == 1, on, off)
  set %ctcp. $iif($did(22).state == 1, on, off)
  set %query. $iif($did(23).state == 1, on, off)
  set %opsjoin. $iif($did(24).state == 1, on, off)
  set %join $iif($did(25).state == 1, on, off)
  set %letter $iif($did(26).state == 1, on, off)
  set %word $iif($did(27).state == 1, on, off)
  set %cnt $iif($did(28).state == 1, on, off)
  set %door $iif($did(29).state == 1, on, off)
  set %bot $iif($did(30).state == 1, on, off)
  set %drone $iif($did(31).state == 1, on, off)
  set %drones $iif($did(32).state == 1, on, off)
  set %quit $iif($did(33).state == 1, on, off)
  set %away $iif($did(34).state == 1, on, off)
  set %name $iif($did(35).state == 1, on, off)
  set %notice $iif($did(36).state == 1, on, off)
  set %notice. $iif($did(37).state == 1, on, off)
  set %bnn $iif($did(38).state == 1, on, off)
  set %slap $iif($did(39).state == 1, on, off)
  set %op.nopsenseSW $iif($did(40).state == 1, on, off)
  set %CTCPREPLY $iif($did(41).state == 1, on, off)
  set %op.random $iif($did(42).state == 1, on, off)
  set %spy.counter $iif($did(43).state == 1, on, off)
  set %deop  $iif($did(44).state == 1, on, off)
  set %rawmode $iif($did(45).state == 1, on, off)
  set %unban $iif($did(46).state == 1, on, off)
  set %part.counter $iif($did(47).state == 1, on, off)
  set %topic.counter $iif($did(48).state == 1, on, off)
  set %kick.counter $iif($did(49).state == 1, on, off)
  set %join.counter $iif($did(50).state == 1, on, off)
  set %nick.counter $iif($did(51).state == 1, on, off)
  set %quit.counter $iif($did(52).state == 1, on, off)
  set %sticky.ban $iif($did(53).state == 1, on, off)
  set %ban $iif($did(54).state == 1, on, off)
}

is the messy-cleanup.

The loopy-way using a token-list of hash table would be neater still, using this sort of concept:
Code:
alias call.popusn {
  var %settings = relay2#14 relay1#15 relay#16 relay3#17 longnick#18 quitpart#19 ....
  var %count = 1
  while ($gettok(%settings, %count, 32)) {
    var %var = $gettok($v1, 1,  35)
    var %num = $gettok($v1, 2,  35)
    set $+(%, %var) = $iif($did(%num).state == 1, on, off)
    inc %count
  }
}

Doing it in reverse for the 'did -c' is also possible, using the same '%settings' string for complete coverage.

Last edited by Bekar; 11/06/07 01:59 AM.