mIRC Home    About    Download    Register    News    Help

Print Thread
#55392 16/10/03 11:43 PM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
Whenever I hide and show an id in a dialog, mIRC always sets focus on a particular ID. I don't know why... Take this for example:

dialog away {
title "Away System"
size -1 -1 150 108
option dbu
button "Away!", 6, 1 37 25 10
button "Back!", 7, 1 37 25 10
text "", 8, 27 39 121 7
check "Repeat away message every", 9, 3 66 81 10
edit %awayrepeat, 17, 84 66 15 10, autohs
text "minutes", 18, 101 68 25 7
check "CTCP Pager", 10, 3 56 40 10
check "Message Logging", 11, 49 56 65 10
radio "Silent", 12, 4 93 27 10, group
box "Message options", 14, 1 85 148 20
radio "Echo", 13, 40 93 28 10
radio "Active", 15, 75 93 30 10
radio "Global", 16, 112 93 30 10
text "(Only works in Active and Global mode)", 19, 11 76 100 7
box "Options", 20, 1 48 148 57
text "Away message:", 3, 2 1 50 7
edit "", 2, 1 9 148 10, autohs
text "Away nickname(optional):", 4, 2 19 114 7
edit "", 5, 1 26 148 10, autohs
}
on *:dialog:away:sclick:6:{
did -h away 6
did -v away 7
}
The word "Repeat away message every" is set focused on. Why is this so?


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#55393 17/10/03 05:21 PM
Joined: Mar 2003
Posts: 36
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Mar 2003
Posts: 36
I copy and test your code and wors fine

I don't see than change the focus when click
in button Away/Back

#55394 18/10/03 02:00 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
Stange. It happens on any other dialog where I hide/unhide buttons. What mIRC version are you using? I'm using 6.12.


trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc
#55395 18/10/03 02:02 AM
Joined: Dec 2002
Posts: 196
T
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 196
Hmm the bug doesn't happen on such a simple command.. Here's my full away system code:


alias awaysys {
dialog -m away away
}
alias aconfig {
dialog -md awayconfig awayconfig
}
alias alog {
/window -k[0] @LogViewer | /loadbuf -p @LogViewer logging.txt
}
menu @LogViewer {
Clear Log:/write -c logging.txt | /loadbuf -r @LogViewer logging.txt
}
menu @AwayLog {
Clear Log:/write -c logging.txt | /loadbuf -r @AwayLog logging.txt
}
dialog awayconfig {
title "Away System Configuration"
size -1 -1 136 69
option dbu
edit %idleawaytime2, 5, 56 2 17 10, autohs
text "minutes idle", 6, 78 3 40 7
check "Auto-away after", 4, 4 2 50 10
text "CTCP Pager sound:", 8, 4 23 50 8
edit %pagerchange, 9, 54 22 82 10, autohs
button "Change", 10, 109 32 25 10
radio "Silent", 12, 7 53 27 10, group
box "Message options", 14, 4 45 131 20
radio "Echo", 13, 37 53 30 10
radio "Active", 15, 69 53 30 10
radio "Global", 16, 101 53 30 10
text "Away Nickname (optional):", 17, 13 13 66 8
edit %afknick, 18, 79 12 57 10, autohs
}



on *:DIALOG:awayconfig:SCLICK:12:{
/set %awayoption 12
}
on *:DIALOG:awayconfig:SCLICK:13:{
/set %awayoption 13
}
on *:DIALOG:awayconfig:SCLICK:15:{
/set %awayoption 15
}
on *:DIALOG:awayconfig:SCLICK:16:{
/set %awayoption 16
}
on *:DIALOG:awayconfig:SCLICK:10:{
set %pagerchange $$file="Please select the sound file:" $mircdir\*.wav

set %pagerchange2 %pagerchange
/did -ra awayconfig 9 %pagerchange2
}
on *:DIALOG:awayconfig:SCLICK:4: {
if ($did(4).state == 0) { /did -m awayconfig 5,18 | set %autoidle -u }
if ($did(4).state == 1) { set %autoidle -c | /did -n awayconfig 5,18 }
}
on *:DIALOG:awayconfig:init:0:{
/did %autoidle awayconfig 4
if (%autoidle == -u) { /did -m awayconfig 5,18 }
if (%autoidle == -c) { /did -n awayconfig 5,18 }
/did -c awayconfig %awayoption
}
on *:DIALOG:awayconfig:close:0:{
set %idleawaytime $calc($did(5,seltext)) * 60
set %idleawaytime2 $did(5,seltext)
if ($did(4).state == 1) && ($status == connected) { .timeridleaway 0 1 whyidle | set %autoawaysystem 1 }
if ($did(4).state == 0) { .timeridleaway off | set %autoawaysystem 0 }
set %afknick $did(18,seltext)
set %anotheridle $did(5,seltext)
set %number $did(5,seltext)
set %pagerchange $did(9,seltext)
set %pagerchange2 %pagerchange
}
alias whyidle {
var %scon = $scon(0)
var %checkidle = 1
while (%checkidle <= %scon ) {
if ($scon(%checkidle).idle > %idleawaytime) && ($scon(%checkidle).away == $false) {
if (%afknick != $null) { /nick %afknick | set %anick [ $+ [ $cid ] ] %afknick }
set %atime [ $+ [ $cid ] ] $time
set %awaytime [ $+ [ $cid ] ] $ctime
set %bnick [ $+ [ $cid ] ] $me
.timeridleaway off
if (%awayoption == 16) && ($chan(1) != $null) { /scon %checkidle ame is away. \ Reason: Auto-away because idle for %anotheridle minutes \ Away from: $time | if (%aanick != $null) { scon %checkidle nick %aanick } | set %reason [ $+ [ $cid ] ] Auto-away because idle for %anotheridle minutes | scon %checkidle .away %reason [ $+ [ $cid ] ] | set %away on | halt }
if (%awayoption == 13) { scon %checkidle echo -a I am away. \ Reason: Auto-away because idle for %anotheridle minutes \ Away from: $time | if (%aanick != $null) { scon %checkidle nick %anick } | set %reason [ $+ [ $cid ] ] Auto-away because idle for %anotheridle minutes | scon %checkidle .away %reason [ $+ [ $cid ] ] | set %away on | halt }
if (%awayoption == 14) && ($active != Status Window) { describe $active is away. \ Reason: Auto-away because idle for %anotheridle minutes \ Away from: $time | if (%anick != $null) { nick %anick } | set %reason [ $+ [ $cid ] ] Auto-away because idle for %anotheridle minutes | scon %checkidle .away %reason [ $+ [ $cid ] ] | set %away on | halt }
if (%awayoption == 12) { if (%anick != $null) { nick %anick } | set %reason [ $+ [ $cid ] ] Auto-away because idle for %anotheridle minutes | .away %reason [ $+ [ $cid ] ] | /set %reason Auto-away because idle for %anotheridle minutes | halt }

unset %checkidle
}
inc %checkidle

}
}

on *:CONNECT:{
if (%autoidle == -c) { .timeridleaway 0 1 whyidle }
}
dialog away {
title "Away System"
size -1 -1 150 108
option dbu
button "",100,-100 -100 0 0
text "", 8, 27 39 121 7
button "Away!", 6, 1 37 25 10
button "Back!", 7, 1 37 25 10
check "Repeat away message every", 9, 3 66 81 10
edit %awayrepeat, 17, 84 66 15 10, autohs
text "minutes", 18, 101 68 25 7
check "CTCP Pager", 10, 3 56 40 10
check "Message Logging", 11, 49 56 65 10
radio "Silent", 12, 4 93 27 10, group
box "Message options", 14, 1 85 148 20
radio "Echo", 13, 40 93 28 10
radio "Active", 15, 75 93 30 10
radio "Global", 16, 112 93 30 10
text "(Only works in Active and Global mode)", 19, 11 76 100 7
box "Options", 20, 1 48 148 57
text "Away message:", 3, 2 1 50 7
edit "", 2, 1 9 148 10, autohs
text "Away nickname(optional):", 4, 2 19 114 7
edit "", 5, 1 26 148 10, autohs
}


on *:DIALOG:away:SCLICK:9:{
if ($did(9).state == 1) { set %awayrepeatopt -c | did -n away 17 }
if ($did(9).state == 0) { set %awayrepeatopt -u | did -m away 17 }
}
on *:DIALOG:away:SCLICK:12:{
/set %awayoption 12
}
on *:DIALOG:away:SCLICK:13:{
/set %awayoption 13
}
on *:DIALOG:away:SCLICK:15:{
/set %awayoption 15
}
on *:DIALOG:away:SCLICK:16:{
/set %awayoption 16
}
on *:DIALOG:away:SCLICK:1:{
.timerlogtest off
.timerconnecttest off
.timerawayreason off
.timeractivetest off
.timerglobal off
}
on *:DIALOG:away:SCLICK:11:{
if ($did(11).state == 1) { set %msgstate -c }
if ($did(11).state == 0) { set %msgstate -u }
}
on *:DIALOG:away:SCLICK:10:{
if ($did(10).state == 1) { set %ctcpstate -c }
if ($did(10).state == 0) { set %ctcpstate -u }
}
on *:DIALOG:away:init:0:{
did -ra away 2 $awaymsg
/did %ctcpstate away 10
/did %msgstate away 11
if ($away == $true) { did -ra away 8 Currently Away }
if ($away != $true) { did -ra away 8 Currently Back }
/did -c away %awayoption
/did %awayrepeatopt away 9
if (%awayrepeatopt == -u) { did -m away 17 }
if ($away == $true) { did -h away 6 }
if ($away != $true) { did -h away 7 }
did -ra away 5 %anick [ $+ [ $cid ] ]
}
on *:DIALOG:away:SCLICK:6:{
if ($chan(1) == $null) && (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if ($status == disconnected) {
if (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }
}
if ($active == Status Window) && (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }

set %reason [ $+ [ $cid ] ] $did(2,seltext)
if (%reason [ $+ [ $cid ] ] == $null) { did -ra away 8 You must enter an away reason to be away. | .timerawayreason 1 4 /did -ra away 8 Currently Back | halt }
/did -ra away 8 Currently Away
set %edit $did(2,seltext)


set %awaytime [ $+ [ $cid ] ] $ctime
set %now $nick
set %anick [ $+ [ $cid ] ] $did(5,seltext)
set %atime [ $+ [ $cid ] ] $time
set %bnick [ $+ [ $cid ] ] $me


set %repeattime $calc($did(17,seltext) * 60)
set %awayrepeat $did(17,seltext)
if ($did(10).state == 0) {
if ($did(9).state == 1) && (%awayoption == 16) { .timerrepeataway [ $+ [ $cid ] ] 0 %repeattime ame is still away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time }
if ($did(9).state == 1) && (%awayoption == 15) { .timerrepeataway [ $+ [ $cid ] ] 0 %repeattime describe $active is still away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time }
}
else {
if ($did(9).state == 1) && (%awayoption == 16) { .timerrepeataway [ $+ [ $cid ] ] 0 %repeattime ame is still away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time \ Page me by using /ctcp $me PAGE message }
if ($did(9).state == 1) && (%awayoption == 15) { .timerrepeataway [ $+ [ $cid ] ] 0 %repeattime describe $active is still away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time \ Page me by using /ctcp $me PAGE message }
}
if (%awayoption == 16) {
if ($did(10).state == 1) {
ame is away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time \ Page me by using /ctcp $me PAGE message | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ]
}
else {
ame is away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ]
}
}

if ($did(10).state == 0) {
if (%awayoption == 13) { echo -a I am away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
if (%awayoption == 15) { describe $active is away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
if (%awayoption == 12) { if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
set %repeattime $calc($did(17,seltext) * 60)
}
else {
if (%awayoption == 13) { echo -a I am away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
if (%awayoption == 15) { describe $active is away. \ Reason: %reason [ $+ [ $cid ] ] \ Away from: $time \ Page me by using /ctcp $me PAGE message | if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
if (%awayoption == 12) { if (%anick [ $+ [ $cid ] ] != $null) { nick %anick [ $+ [ $cid ] ] } | .away %reason [ $+ [ $cid ] ] }
set %repeattime $calc($did(17,seltext) * 60)
}
/titlebar TrenzTerra Tornado 2 (Aqua) (Away)
if ($did(10).state == 1) { set %ctcppage [ $+ [ $cid ] ] on | set %ctcppage on | window -nk[0] @AwayLog | /loadbuf -p @AwayLog logging.txt | if ($read(logging.txt,1) != $null) { aline @AwayLog 3---------- }
}
if ($did(11).state == 1) { set %messagelogger [ $+ [ $cid ] ] on | set %messagelogger on | window -nk[0] @AwayLog | /loadbuf -p @AwayLog logging.txt | if ($read(logging.txt,1) != $null) { aline @AwayLog 3---------- } }
did -h away 6
did -v away 7
}


on *:DIALOG:away:SCLICK:7:{
if ($chan(1) == $null) && (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if ($status == disconnected) {
if (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }
}
if ($active == Status Window) && (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }
scid $cid resetidle
if (%autoidle == -c) { .timeridleaway 0 1 whyidle }
if ($did(8,seltext) != $null) { /did -r away 8 }


if (%awayoption == 16) { ame is back. \ Away Reason: %reason [ $+ [ $cid ] ] \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 13) { echo -a I am back. \ Away Reason: $awaymsg \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 15) { describe $active is back. \ Away Reason: $awaymsg \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 12) { unset %anick | .away | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } }
if (%autoidle == -c) { .timeridleaway 0 1 whyidle }
unset %did10away
unset %edit
unset %now
unset %reason
unset %atime [ $+ [ $cid ] ]
unset %anick [ $+ [ $cid ] ]
unset %bnick [ $+ [ $cid ] ]
unset %repeattime
if ($did(10).state == 1) { set %ctcppage off }
if ($did(11).state == 1) { set %messagelogger [ $+ [ $cid ] ] off }
/did -ra away 8 Currently Back
.timerrepeataway [ $+ [ $cid ] ] off
/titlebar TrenzTerra Tornado 2 (Aqua)

did -h away 7
did -v away 6

}
alias iamback {
if ($dialog(away)) {
if ($chan(1) == $null) && (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if ($status == disconnected) {
if (%awayoption == 16) { did -c away 13 | did -u away 16 | set %awayoption 13 }
if (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }
}
if ($active == Status Window) && (%awayoption == 15) { did -c away 13 | did -u away 15 | set %awayoption 13 }
}
scid $cid resetidle
if (%autoidle == -c) { .timeridleaway 0 1 whyidle }
if ($dialog(away)) && ($did(away,8,seltext) != $null) { /did -r away 8 }


if (%awayoption == 16) { ame is back. \ Away Reason: %reason [ $+ [ $cid ] ] \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 13) { echo -a I am back. \ Away Reason: $awaymsg \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 15) { describe $active is back. \ Away Reason: $awaymsg \ Away from: %atime [ $+ [ $cid ] ] \ Time away: $duration($calc($ctime - %awaytime [ $+ [ $cid ] ] )) | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } | unset %anick | .away }
if (%awayoption == 12) { unset %anick | .away | if (%anick [ $+ [ $cid ] ] != $null) { nick %bnick [ $+ [ $cid ] ] } }
if (%autoidle == -c) { .timeridleaway 0 1 whyidle }
unset %did10away
unset %edit
unset %now
unset %reason
unset %atime [ $+ [ $cid ] ]
unset %anick [ $+ [ $cid ] ]
unset %bnick [ $+ [ $cid ] ]
unset %repeattime
if ($dialog(away)) {
if ($did(away,10).state == 1) { set %ctcppage off }
if ($did(away,11).state == 1) { set %messagelogger off }
/did -ra away 8 Currently Back
}
.timerrepeataway [ $+ [ $cid ] ] off
/titlebar TrenzTerra Tornado 2 (Aqua)
if ($dialog(away)) {
did -h away 7
did -v away 6
}
}
ctcp *:page:*: {
if (%ctcppage [ $+ [ $cid ] ] == on) {
.notice $nick Hi. I am currently away and you have paged me. Your message has been logged. I will try and reply to you as soon as possible.
if (%pagerchange2 == beep.wav) { /splay beep.wav }
if (%pagerchange2 != $null) { /splay %pagerchange }
if ($window(@awaylog)) { aline -p @AwayLog PAGE: $fulldate < $+ $nick $+ > $2- }
/write logging.txt PAGE: $fulldate < $+ $nick $+ > $2-
}
}
on *:OPEN:?:{
if (%messagelogger [ $+ [ $cid ] ] == on) {
.notice $nick Hi. I am currently away and you have messaged me. Your message has been logged. I will try and reply to you as soon as possible.
if ($window(@awaylog)) { aline -p @AwayLog PRIVATE MESSAGE: $fulldate < $+ $nick $+ > $1- }
/write logging.txt PRIVATE MESSAGE: $fulldate < $+ $nick $+ > $1-
/close -m $nick
}
}

on *:DISCONNECT:{
set %messagelogger [ $+ [ $cid ] ] off
}
Please take a look at the ids 6 and 7...

Last edited by trenzterra; 18/10/03 02:06 AM.

trenzterra
AustNet #trenzterra and #w
Head Scripter @ http://trenzterra.uni.cc

Link Copied to Clipboard