mIRC Homepage
Posted By: raZOR idle time - 20/02/06 12:42 PM
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?
Posted By: RusselB Re: idle time - 20/02/06 02:20 PM
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.
Posted By: raZOR Re: idle time - 20/02/06 02:54 PM
i shall look it, thanks
Posted By: genius_at_work Re: idle time - 20/02/06 02:55 PM
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
Posted By: raZOR Re: idle time - 20/02/06 03:06 PM
i have no ide what you said now smirk
Posted By: raZOR Re: idle time - 20/02/06 03:07 PM
@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 ?
Posted By: RusselB Re: idle time - 20/02/06 03:43 PM
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)
}
 
Posted By: raZOR Re: idle time - 20/02/06 04:00 PM
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 ?
Posted By: RusselB Re: idle time - 20/02/06 08:24 PM
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
Posted By: raZOR Re: idle time - 20/02/06 09:10 PM
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
Posted By: RusselB Re: idle time - 20/02/06 11:09 PM
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.
Posted By: raZOR Re: idle time - 20/02/06 11:23 PM
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
Posted By: RusselB Re: idle time - 20/02/06 11:52 PM
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.
Posted By: raZOR Re: idle time - 20/02/06 11:58 PM
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 =)
Posted By: RusselB Re: idle time - 21/02/06 02:30 AM
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
Posted By: raZOR Re: idle time - 21/02/06 02:43 AM
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 =)
Posted By: CtrlAltDel Re: idle time - 21/02/06 05:05 PM
post long ones @ http://www.nomorepasting.com/ or http://www.rafb.net/paste/ smile
Posted By: raZOR Re: idle time - 22/02/06 12:09 AM
its simplier this way :P
Posted By: DJ_Reactor Re: idle time - 23/02/06 09:09 AM
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
© mIRC Discussion Forums