mIRC Home    About    Download    Register    News    Help

Print Thread
idle time #142920 20/02/06 12:42 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have on dialog EMPTY text box in which is displayed my "idle time"

this is code invoked on dialog init:

alias idler {
timeridle 0 1 if ($dialog(setup)) did -o setup 33 1 $!duration($idle)
}

textbox ID is 33
dialog name is "setup"

problem is that idle time resets when i call dialog smirk
so i never actually see my true idle time....

anyone can modify this ?
or it cannot be done at all?

Last edited by raZOR; 20/02/06 12:43 PM.

IceCapped
Re: idle time #142921 20/02/06 02:20 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
While this isn't what you asked for, I have an idle time display incorporated in my snippet located here The snippet has a lot more than the idle time, but it is included.

Re: idle time #142922 20/02/06 02:54 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i shall look it, thanks


IceCapped
Re: idle time #142923 20/02/06 02:55 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Have you looked at what is actually being done by the timer? Try doing /timer to view what commands the timer is executing when it goes off. You have prefixed the $!duration identifier, but you haven't prefixed the $dialog(setup) identifier. The timer may actually be executing: if ($false) did..etc

-genius_at_work

Re: idle time #142924 20/02/06 03:06 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
i have no ide what you said now smirk


IceCapped
Re: idle time #142925 20/02/06 03:07 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
@russel
your dialog show idle time on whois =)
but i just want to find MY idle time without using whois
on me...

so is it possible ?


IceCapped
Re: idle time #142926 20/02/06 03:43 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This works in 6.03 and above. Note this is your idle time as of the initialization of the dialog. It does not update automatically.
Code:
 dialog idle_time {
  title "My Idle Time"
  size -1 -1 60 20
  option dbu
  edit "", 1, 5 5 50 10, read
  button "Button", 3, 5 3 37 12, hide default ok cancel
}
menu * {
  &My Idle Time : dialog -m idle_time idle_time
}
on *:dialog:idle_time:init:*:{
  did -ra $dname 1 $duration($idle)
}
 

Re: idle time #142927 20/02/06 04:00 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now i will bug you even more =)
ofcourse you dont have to do it if you dont want to...

1. can that update be done for just 1 control (like i posted for text box) and not whole dialog

2. can you make it update per second ?


IceCapped
Re: idle time #142928 20/02/06 08:24 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It's only using one control, the only reason it's using the entire dialog is because the dialog only has two controls, the display and a hidden OK/Cancel button.

As to the second request, I can get it to update, but I can't guarantee it'll match second to second. Can't code it right now, but I'll do it when I get home from work.

If you want me to incorporate the changes to code you already have, post the code, and don't forget to use the Code Tags

Re: idle time #142929 20/02/06 09:10 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
well since you also use txt control
then i dont think posting mine code (which is mega huge)
is needed, altho if you are willing then i shall ask you kind
if you could make an updater


IceCapped
Re: idle time #142930 20/02/06 11:09 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
ok...here's a combination of my code that works and the code that you started with..I've changed my code to use the ID and dialog name from your original post
Code:
  dialog setup {
  title "My Idle Time"
  size -1 -1 60 20
  option dbu
  edit "", 33, 5 5 50 10, read
  button "Button", 999, 5 3 37 12, hide default ok cancel
}
menu * {
  &My Idle Time : dialog -m setup setup
}
on *:dialog:setup:init:*:{
.timeridle 0 1 did -ra $dname 33 $duration($idle)
}
 

You'll have to make appropriate changes to your actual code so that the item shows up in the correct location. If you already have an OK and/or Cancel buttons, then you can delete the button that's in the above code.

If you've written a mega huge script already, you should have no problems incorporating what I have above into your code.

Last edited by RusselB; 20/02/06 11:47 PM.
Re: idle time #142931 20/02/06 11:23 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
doesnt show anything and
got errors

* /did: 'idler' invalid id '1'
-
* /did: invalid parameters

i renamed dialog name to "idler" because "setup" was interfering with original dialog

so i thought my script causes errors
so i tried in clean 6.16 and it still is buggy


IceCapped
Re: idle time #142932 20/02/06 11:52 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Simple mistake, I forgot to change the ID in the /did command (which is part of the /timer command). That error has been corrected. You may still want to use the Idler name, rather than Setup, as you say it's causing problems in your Setup dialog. I don't know how long the dialog setup is, (ie: the section in the script that starts with /dialog <dialog name>), but if it's not too long, and you want to post that part, I can probably incorporate my script to your Setup dialog.

That's what I was actually referring to earlier, not the whole entire script.

Re: idle time #142933 20/02/06 11:58 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
now it updates only when i run dialog
and on close i get

* /did: invalid parameters

~edit~

that script (i have) has 350 rows =)
you really dont wanna me to post it =)

Last edited by raZOR; 21/02/06 12:00 AM.

IceCapped
Re: idle time #142934 21/02/06 02:30 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
add to the dialog
Code:
 on *:dialog:&lt;dialog_name&gt;:close:*:{
.timeridle off
}
 

Replace <dialog_name> with the actual name of the dialog.
That'll take care of that error message.

Regarding it not updating while displaying...:( Sorry, I thought it would work
I'll test the code when I get a chance and see what I can do.

350 rows just for the layout? yikes...you're right, but I can only work with what I've got, so if you want it to work in conjunction with you other script, you're going to have to do the merging yourself, as I can't tell what would work where

Re: idle time #142935 21/02/06 02:43 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
it works now (updates and no errors)
but still update is only when dialog is re-opened

well i think your way is simplier, then i'll just merge it to dialog

as for 350 rows, well it contains full code for "control panel"
because i have 1 dialog with 5 tabs and each tab has bunch of controls =)

anyways dont be sorry, you helping me remember?
and i apreciate ANY help i can get so any try is gift =)

Last edited by raZOR; 21/02/06 02:49 AM.

IceCapped
Re: idle time #142936 21/02/06 05:05 PM
Joined: Jun 2003
Posts: 994
C
CtrlAltDel Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994


I refuse to engage in a battle of wits with an unarmed person. wink
Re: idle time #142937 22/02/06 12:09 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
its simplier this way :P


IceCapped
Re: idle time #142938 23/02/06 09:09 AM
Joined: Feb 2006
Posts: 6
D
DJ_Reactor Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
D
Joined: Feb 2006
Posts: 6
Quote:
i have on dialog EMPTY text box in which is displayed my "idle time"

this is code invoked on dialog init:

alias idler {
timeridle 0 1 if ($dialog(setup)) did -o setup 33 1 $!duration($idle)
}

textbox ID is 33
dialog name is "setup"

problem is that idle time resets when i call dialog smirk
so i never actually see my true idle time....

anyone can modify this ?
or it cannot be done at all?


you do know that your idle time, for mIRC resets once you do a command as well wink

that seems to be the main problem

if you set the dialog to an FKEY, it won't reset your idle time wink
hope that helps smile