Can someone help to use this code with this dialog please?

Code:
dialog aww {
  title "Bad Away Protection"
  size -1 -1 146 168
  option dbu
  combo 1, 9 20 126 105, sort, size, vsbar
  button "Add", 2, 4 150 25 11, flat
  button "Delete", 3, 32 150 25 11, flat
  box "Enter Bad Away Text To Ban.", 5, 5 5 137 140
  text "This trigger will set ban on bad away msg.", 6, 4 130 138 8, center
  button "Ok", 7, 116 150 25 11, flat ok
  button "ON", 8, 88 150 25 11, flat
  button "OFF", 9, 60 150 25 11, flat
}

on 1:dialog:aww:sclick:8: { set %aww $+ $active 1 | echo -ta * 10Bad Away Protection Is Now 154Enable15 }
on 1:dialog:aww:sclick:9: { set %aww $+ $active 0 | echo -ta * 10Bad Away Protection Is Now 154Disable15 }

 
on *:dialog:aww:*:*: {
  if ($devent == init) {
    did -b $dname 3
    var %x = 1
    while (%x <= $lines(sys/aww.mrc)) {
      did -a $dname 1 $read(sys/aww.mrc,%x)
      inc %x
    }
  }
  if ($devent == sclick) {
    if ($did == 1) {
      did -e $dname 3
    }
    if ($did == 2) {
      if ($did($dname,1)) {
        if (!$didwm(aww,1,$did($dname,1),0)) {
          write sys/aww.mrc $did($dname,1) 
          did -a $dname 1 $did($dname,1)
        }
      }
    }
    if ($did == 3) { 
      write -dw $did($dname,1).seltext sys/aww.mrc
      did -d $dname 1 $did($dname,1).sel
      did -b $dname 3
    }
  } 
}



raw 301:*:{
  if ($nick !isop #chat) {
    var %a = 1, %b = $numtok($3-,32)
    while %a <= %b {
      if $hget(aww,$gettok($3-,%b,32)) {
        ban -ku600 #chat $2 2 14Offensive Away Msg
        %a = %b
      }
      inc %a
    }
    return $regsubex($1-,/\b( $+ %aww $+ )\b/gi,$str(*,$len(\t)))
  }
  haltdef
}










 

Last edited by bcancer; 11/10/08 01:50 PM.