mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 18
X
Pikka bird
OP Offline
Pikka bird
X
Joined: Apr 2015
Posts: 18
I've come back after a few months without playing with mIRC and for some reason my check boxes refuse to appear. Its causing issues with the entire remote.

Code:
dialog away {
  title "Away Manager"
  size -1 -1 130 81
  option dbu
  icon $scriptdirgraphics/Cobra.ico, 0
  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
  check "Auto Time Away", 8, 7 35 46 12
  check "Auto Idle Away", 9, 7 45 43 12
  check "Open on Away?", 10, 7 55 43 12
  text %stat, 7, 7 70 116 8
}

alias aways dialog -m away away 
menu channel,status,menubar {
  Away
  .Away:aways
}
alias updateawaytime {
  if ($away) {
    %stat = Status: $+ $chr(32) $+ Away For $+ $chr(32) $+ $duration($awaytime)
  }
  else {
    %stat = Status: $+ $chr(32) $+ Active
  }
  did -r away 7
  did -a away 7 %stat
}
alias autotimeaway {
  if ($day == monday) || ($day == tuesday) || ($day == wednesday) || ($day == thursday) || ($day == friday) {
    if ($time >= 07:30:00) && ($time <= 14:30:00) {
      if (!$away) || ($awaymsg != School) {
        /away School
        /aways
      }
    }
    elseif ($time >= 00:00:00) && ($time <= 05:00:00) {
      if (!$away) || ($awaymsg != Sleeping) {
        /away Sleeping
        /aways
      }
    }
  }
  elseif ($day == saturday) || ($day == sunday) {
    if ($time >= 01:00:00) && ($time <= 07:00:00) {
      if (!$away) || ($awaymsg != Sleeping) {
        /away Sleeping
        /aways
      }
    }
  }
}
alias autoidleaway {
  if ($idle >= 1800) && (!$away) {
    /away Idle For 30+ Minutes
  }
}
alias openonaway {
  if ($away) {
    if ($dialog(away) == $null) {
      /aways
    }
  }
}
alias close_away {
  if ($did(away, 8).state == 1) { 
    %login.check.autotimeaway = 1 
  }
  if ($did(away, 8).state == 0) { 
    %login.check.autotimeaway = 0
  }
  if ($did(away, 9).state == 1) {
    %login.check.autoidleaway = 1
  }
  if ($did(away, 9).state == 0) {
    %login.check.autoidleaway = 0
  }
  if ($did(away, 10).state == 1) {
    %login.check.openonaway = 1
  }
  if ($did(away, 10).state == 0) {
    %login.check.openonaway = 0
  }
  timerUAT off
}

on *:start:{
  if (%login.check.autotimeaway == 1) {
    timerATA 0 900 autotimeaway
  }
  if (%login.check.autoidleaway == 1) {
    timerAIA 0 60 autoidleaway
  }
  if (%login.check.openonaway == 1) {
    timerOOA 0 1 openonaway
  }
}
on *:dialog:away:init:0:{
  loadbuf -oe away 4 awayreasons.txt
  timerUAT 0 1 updateawaytime
  var %stat = Loading
  if (%login.check.autotimeaway == 1) { 
    did -c away 8 
  }
  if (%login.check.autoidleaway == 1) {
    did -c away 9
  }
  if (%login.check.openonaway == 1) { 
    did -c away 10
  }
  /did -i away 4 0 $awaymsg
}
on *:dialog:away:sclick:1:{
  if (!$away) || ($awaymsg != $did(away, 4)) {
    if ($did(away, 4) != $null) {
      away $did(away, 4)
    }
  }
}
on *:dialog:away:sclick:2:{
  if ($away) {
    away
  }
  close_away
  dialog -x away
}
on *:dialog:away:sclick:5:{
  if ($read(awayreasons.txt, w, $did(away, 4)) == $null}) {
    write awayreasons.txt $did(away, 4)
    did -r away 4
    loadbuf -oe away 4 awayreasons.txt
  }
}
on *:dialog:away:sclick:6:{
  write -dl $+ $did(away, 4).sel awayreasons.txt
  did -r away 4
  loadbuf -oe away 4 awayreasons.txt
}
on *:dialog:away:sclick:8:{
  if ($did(away, 8).state == 1) {
    timerATA 0 900 autotimeaway
  }
  elseif ($did(away, 8).state == 0) {
    timerATA off
  }
}
on *:dialog:away:sclick:9:{
  if ($did(away, 9).state == 1) {
    timerAIA 0 60 autoidleaway
  }
  elseif ($did(away, 9).state == 0) {
    timerAIA off
    /resetidle
  }
}
on *:dialog:away:sclick:10:{
  if ($did(away, 10).state == 1) {
    timerOOA 0 1 openonaway
  }
  elseif ($did(away, 10).state == 0) {
    timerOOA off
  }
}
on *:DIALOG:away:close:*:{
  close_away
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Actually the checkbox menus appear correcty.



Btw i fixed some issues in your code:

Code:
dialog away {
  title "Away Manager"
  size -1 -1 130 81
  option dbu
  icon $scriptdirgraphics/Cobra.ico, 0
  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
  check "Auto Time Away", 8, 7 35 48 12
  check "Auto Idle Away", 9, 7 45 48 12
  check "Open on Away?", 10, 7 55 48 12
  text %stat, 7, 7 70 116 8
}

alias aways dialog -m away away 
menu channel,status,menubar {
  Away
  .Away:aways
}
alias updateawaytime {
  if ($away) { %stat = Status: $+ $chr(32) $+ Away For $+ $chr(32) $+ $duration($awaytime) }
  else { %stat = Status: $+ $chr(32) $+ Active }
  did -ra away 7 %stat
}
alias autotimeaway {
  if ($day == monday) || ($day == tuesday) || ($day == wednesday) || ($day == thursday) || ($day == friday) {
    if ($time >= 07:30:00) && ($time <= 14:30:00) {
      if (!$away) || ($awaymsg != School) {
        away School
        aways
      }
    }
    elseif ($time >= 00:00:00) && ($time <= 05:00:00) {
      if (!$away) || ($awaymsg != Sleeping) {
        away Sleeping
        aways
      }
    }
  }
  elseif ($day == saturday) || ($day == sunday) {
    if ($time >= 01:00:00) && ($time <= 07:00:00) {
      if (!$away) || ($awaymsg != Sleeping) {
        away Sleeping
        aways
      }
    }
  }
}
alias autoidleaway {
  if ($idle >= 1800) && (!$away) { away Idle For 30+ Minutes }
}
alias openonaway {
  if ($away) && (!$dialog(away)) { aways }
}
alias close_away {
  if ($did(away, 8).state == 1) { %login.check.autotimeaway = 1 }
  if ($did(away, 8).state == 0) { %login.check.autotimeaway = 0 }
  if ($did(away, 9).state == 1) { %login.check.autoidleaway = 1 }
  if ($did(away, 9).state == 0) { %login.check.autoidleaway = 0 }
  if ($did(away, 10).state == 1) { %login.check.openonaway = 1 }
  if ($did(away, 10).state == 0) { %login.check.openonaway = 0 }
  .timerUAT off
}

on *:start:{
  if (%login.check.autotimeaway == 1) { .timerATA 0 900 autotimeaway }
  if (%login.check.autoidleaway == 1) { .timerAIA 0 60 autoidleaway }
  if (%login.check.openonaway == 1) { .timerOOA 0 1 openonaway }
}
on *:dialog:away:init:0: {
  var %f = awayreasons.txt
  if ($isfile(%f)) && ($lines(%f)) { loadbuf -oe away 4 $qt(%f) }
  did -ra away 7 Status: Loading...
  .timerUAT 0 1 updateawaytime
  if (%login.check.autotimeaway == 1) { did -c away 8 }
  if (%login.check.autoidleaway == 1) { did -c away 9 }
  if (%login.check.openonaway == 1) { did -c away 10 }
  did -i away 4 0 $awaymsg
}
on *:dialog:away:sclick:1:{
  if (!$away) || ($awaymsg !== $did(away, 4)) {
    if ($did(away, 4)) { away $did(away, 4) }
  }
}
on *:dialog:away:sclick:2:{
  if ($away) { away }
  close_away
  dialog -x away
}
on *:dialog:away:sclick:5:{
  if (!$read(awayreasons.txt, w, $did(away, 4))) {
    var %f = awayreasons.txt
    write $qt(%f) $did(away, 4)
    did -r away 4
    if ($isfile(%f)) && ($lines(%f)) { loadbuf -oe away 4 $qt(%f) }
  }
}
on *:dialog:away:sclick:6:{
  var %f = awayreasons.txt
  write -dl $+ $did(away, 4).sel $qt(%f)
  did -r away 4
  if ($isfile(%f)) && ($lines(%f)) { loadbuf -oe away 4 $qt(%f) }
}
on *:dialog:away:sclick:8:{
  if ($did(away, 8).state == 1) { .timerATA 0 900 autotimeaway }
  elseif ($did(away, 8).state == 0) { timerATA off }
}
on *:dialog:away:sclick:9:{
  if ($did(away, 9).state == 1) { .timerAIA 0 60 autoidleaway }
  elseif ($did(away, 9).state == 0) { .timerAIA off | resetidle }
}
on *:dialog:away:sclick:10:{
  if ($did(away, 10).state == 1) { .timerOOA 0 1 openonaway }
  elseif ($did(away, 10).state == 0) { .timerOOA off }
}
on *:DIALOG:away:close:*: { close_away }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Apr 2015
Posts: 18
X
Pikka bird
OP Offline
Pikka bird
X
Joined: Apr 2015
Posts: 18
Thanks for fixing up the script. However I still am not seeing the checks:


Additionally, in the edits you made to the script, it seems as through the delete button actually deletes two lines instead of one in the file.

Last edited by xboxer16; 12/01/16 05:24 PM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
I didn't delete any button i just fixed some bugs, by the way, the most important problem here is that you cannot see the checkboxes, please execute this command and give the output here:

Code:
//echo -a $os $version $iif($beta,$beta,0) $md5($mircexe,2) $file($mircexe).sig $alias(0) $script(0) $dll(0) $com(0)


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Apr 2015
Posts: 18
X
Pikka bird
OP Offline
Pikka bird
X
Joined: Apr 2015
Posts: 18
8.1 7.43 0 ac3f79c0e1804529ca28be78d9c5436

Also its the "del" button with id 6

Last edited by xboxer16; 13/01/16 12:23 AM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Actually you are not using the original mIRC version. Please re-install it from this link and try again using the code.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard