mIRC Homepage
Posted By: Skeletor My Anti-Idle not working - 13/03/05 10:00 AM
The check box works nicely, but nothing happens...Any Ideas?

Code:
  

dialog Prot {
  title "Anti Idle"
  size -1 -1 102 212
  option dbu
  box "General Protection", 1, 2 2 80 75
  check "Anti-Idle", 2, 5 12 50 10
  button "Done", 18, 17 198 52 12, ok
}

on *:dialog:Prot:sclick:2:{
  if ($did(2).state == 0) { disable #antiidle  }
  elseif ($did(2).state == 1) { enable #antiidle }
}

#antiidle on
alias anti.idle.on {
  if (%idle != on) {
    set %idle on
  }

}
alias anti.idle.off {
  if (%idle != off) {
    set %idle off
  }

}
on *:Connect: { .timeridle 0 5 anti.idle }
alias anti.idle {
  if (($idle >= 1) && (%idle = on)) {
    msg $me ...
  }
}
#antiidle end

on *:Dialog:Prot:init:0: {
  if ($group(#antiidle) == on) { did -c $dname 2 }
}



Cheerz
Matt
Posted By: MikeChat Re: My Anti-Idle not working - 13/03/05 03:34 PM
you have the group going on and off, but haven't called the alias to change the set %idle state and have not started or stopped the timer
Code:
dialog Prot {
  title "Anti Idle"
  size -1 -1 102 212
  option dbu
  box "General Protection", 1, 2 2 80 75
  check "Anti-Idle", 2, 5 12 50 10
  button "Done", 18, 17 198 52 12, ok
}

on *:dialog:Prot:sclick:2:{
  if ($did(2).state == 0) { anti.idle.off | .timeridle off  | disable #antiidle  }
  elseif ($did(2).state == 1) {  enable #antiidle | anti.idle.on }
}

#antiidle on
alias anti.idle.on {
  if (%idle != on) {
    set %idle on
  }
 .timeridle 0 5 anti.idle
}
alias anti.idle.off {
  if (%idle != off) {
    set %idle off
  }

}
on *:Connect: { .timeridle 0 5 anti.idle }
alias anti.idle {
  if (($idle >= 1) && (%idle = on)) {
    msg $me ...
  }
}
#antiidle end

on *:Dialog:Prot:init:0: {
  if ($group(#antiidle) == on) { did -c $dname 2 }
}


see if that helps...
Posted By: Skeletor Re: My Anti-Idle not working - 13/03/05 11:17 PM
Thank- you very much, it works perectly now.

wink
© mIRC Discussion Forums