mIRC Home    About    Download    Register    News    Help

Print Thread
#252437 10/04/15 11:10 PM
Joined: Apr 2015
Posts: 18
X
Pikka bird
OP Offline
Pikka bird
X
Joined: Apr 2015
Posts: 18
This is the start to a away manager I am attempting to build. I am having an issue trying to update the awaytime in my dialog. Is there anyway to create a dynamic (or at least refreshing every 15 seconds) dialog that will update $awaytime?

Code:
dialog away {
  title "Away Manager"
  size -1 -1 130 128
  option dbu
  button "Go Away", 1, 7 5 53 12
  button "Come back", 2, 70 5 53 12
  combo 4, 7 21.5 85 50, size edit drop
  button "Add", 5, 94 20 14 12
  button "Del", 6, 109 20 14 12
  text %stat, 7, 7 35 60 8,
}

alias aways {
  var %stat = Status:
  if ($away) {
    %stat = %stat $+ $chr(32) $+ Away For $+ $chr(32) $+ $duration($awaytime)
  }
  else {
    %stat = %stat $+ $chr(32) $+ Active
  }
  dialog -m away away

  Away
  .Away:aways
}

on *:dialog:away:sclick:1:{
  if (!$away) {
    if ($did(4) != $null) {
      away $did(4)
    }
  }
}


Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Code:
alias updateawaytime {
did -r <dialogname> <id>
did -a <dialogname> <id> $awaytime
}

And Now You Can Use This on dialog init event with a timer 0 1
Code:
.timer 0 1 updateawaytime
;;This Will Clear Text And Add The Away Time Again So It Will Be Updated per second

I would give the timer a certain id and on dialog close event i would do .timer<name> off .


Link Copied to Clipboard