mIRC Home    About    Download    Register    News    Help

Print Thread
#42669 18/08/03 03:35 AM
Joined: Aug 2003
Posts: 21
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Aug 2003
Posts: 21
I have tried this script out and I can't get it to work

Code:
 
dialog uptime {
  title Channel and Nick
  size -1 -1 300 235

  button "Ok" ,1, 0 210 70 25,ok
  button "Reset" ,3, 70 210 70 25
  edit "" ,2, 5 5 200 20,read
}

on *:dialog:uptime:init:0:{
  $did(uptime,2) $uptime(system,2)
}
on *:dialog:uptime:sclick:3:{
  $did(uptime,2) $uptime(system,2)
}

 



Any help would be great on this

What I am trying to do is when this dialog opens up it shows the uptime in the window

#42670 18/08/03 03:37 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
use .did, not the identifier $did

/did -a $dname 2 $uptime(system,2)


-KingTomato
#42671 18/08/03 03:41 AM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
dialog uptime {
title Channel and Nick
size -1 -1 300 235
button "Ok" ,1, 0 210 70 25,ok
button "Reset" ,3, 70 210 70 25
edit "" ,2, 5 5 200 20,read
}
on *:dialog:uptime:init:0:{
did -a $dname 2 $uptime(system,2)
}
if that's what u meant


#42672 18/08/03 09:09 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Why not use something along the lines of..
Code:
dialog uptime { 
  title Channel and Nick 
  size -1 -1 300 235 
  button "Ok" ,1, 0 210 70 25,ok 
  button "Reset" ,3, 70 210 70 25 
  edit "" ,2, 5 5 200 20,read
}

on *:dialog:uptime:init:0:{
  set %uptime $duration($calc($ticks / 1000))
  did -a $dname 2 %uptime
}

#42673 18/08/03 09:26 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Why set a variable to use with $calc when mIRC already gives you the answer in $duration format with $uptime( )?


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#42674 18/08/03 06:15 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I used it and it only returns the minutes for me, so I used an alternative, it like, supresses the seconds..

#42675 18/08/03 06:18 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Tried $uptime(system,1)?

#42676 18/08/03 10:27 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ahh, that does work. grin


Link Copied to Clipboard