mIRC Home    About    Download    Register    News    Help

Print Thread
#153024 10/07/06 12:26 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I currently have ID 103 with a default entry of dd-mmm-yyyy
ID 105 has an entry of h:nn:ss tt

Using
Code:
   set %title Channel Control Dialog $iif(!%connected,Not Connected to Any Networks,Connected to %connected out of $scon(0) Networks)
  .timertime -m 0 500 dialog -t Channel_Control %title $str($chr(160),100) $!date($did(103)) @ $!time($did(105))
 
I get an Invalid Parameters: $did error

Yet, if I use
Code:
   set %title Channel Control Dialog $iif(!%connected,Not Connected to Any Networks,Connected to %connected out of $scon(0) Networks)
  .timertime -m 0 500 dialog -t Channel_Control %title $str($chr(160),100) $!date(dd-mmm-yyyy) @ $!time(h:nn:ss tt)  
It works fine, and when I test the original echoing $did(103), $did(105), $date($did(103)), $time($did(105))
They all show correct information.

Any ideas as to why the code I want to use won't work, yet everything that I can think of for testing shows that it should.

#153025 10/07/06 12:59 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
only thing i can think of is that the dialog name is needed
tested with this
Code:
alias channel_test dialog -m channel_control channel_control
dialog channel_control {
  title ""
  size -1 -1 250 50
  option dbu
  text dddd mmmm , 103, 10 10 150 10
  text h:nn:ss , 105, 10 30 150 10
  button "", 999, 0 0 0 0, cancel
}
on *:dialog:channel_control:init:0:{
  .timertime -m 0 500 dialog -t Channel_Control Connected to $!scon(0) Networks $str($chr(160),5) $!date($did(channel_control,103)) @ $!time($did(channel_control,105))
}
on *:dialog:channel_control:sclick:999:{ .timertime off }



Im guessing you use an edit box but that wouldnt matter

I did test this and it worked (I clipped your title setting just to make it smaller for my test, which then makes the server connections number dynamic)

#153026 10/07/06 01:06 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
That did the trick, although it is contrary to the help file which says
Quote:
If used in the on dialog event, name is optional.

#153027 10/07/06 01:08 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I know, but sometimes it wont, i dont know why

#153028 10/07/06 06:50 AM
Joined: Nov 2005
Posts: 24
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Nov 2005
Posts: 24
Probably the timer creates a separate thread, so it is not in a dialog event any more.

#153029 13/07/06 12:56 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Sort of right. Those $did()'s are evaluated when the timer fires, not inside the on dialog event. mirc doesn't (and has no reason to) know that the timer was initiated inside an event.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard