mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#158546 05/09/06 10:40 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Hi guys, what about something like:
Code:
On *:IDLE:120s:#chan: {
 echo -a $nick has been idle for more than 120 seconds.
}

I don't know, something that refers when someone idles, also, it should have something like, 120s, 2m, 1h, something that tells you right when someone hits idle time. or, is there something similar to this that I don't know about?


-Kurdish_Assass1n
#158547 05/09/06 10:49 PM
Joined: Apr 2005
Posts: 1,009
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
you have $idle but not event


IceCapped
#158548 06/09/06 12:07 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
lol, i know, but, in a LOT of channels, when I'm idle, I have to deop, and, when I idle, usually, I don't have time or I forget to deop.


-Kurdish_Assass1n
#158549 06/09/06 12:40 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is easily scriptable, as I'm quite sure you realize.
Example:
Code:
 on me:*:join:#:{
$+(.timer,idle,.,$cid,.,$chan) 0 310 idle_check $cid $chan
}
on me:*:part:#:{
$+(.timer,idle,.,$cid,.,$chan) off
}
on me:*:kick:#:{
$+(.timer,idle,.,$cid,.,$chan) off
}
on me:*:quit:{
var %a = 1, %b = $chan(0)
while %a <= %b {
$+(.timer,idle,.,$cid,.,$chan(%a)) off
inc %a
}
}
alias idle_check {
.scon $1
if $nick($2,$me,o).idle > 600 {
.mode $2 -o $me
}
}

Starts a timer when you join the channel, which is connection and channel specific. Timer is set for 310 seconds (5 minutes 10 seconds). At 310 second, your idle time is checked, and if your idle time is 600 seconds (or more) and you are opped in that channel, then you automatically deop.

On a sidenote, I can see where an ON IDLE event could be handy for channel control, where you don't want people idling for long periods of time (example a help channel for people that aren't helpers).

I can also see where the ON IDLE event, as you suggest, would make a script like the one I just wrote a lot shorter.

#158550 06/09/06 01:08 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I dont see a lot of use for it concidering the ease of scriptability. But i cant see it being too hard to implement either, mirc already (internally) tracks idle times of all users in common channels (for use with the nick colors options). One problem i can see though is that idle times for other users could be incorrect unless mirc checks with the server for each person's idle time when you join a channel and adjusts accordingly? shrug.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#158551 06/09/06 02:29 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I think mIRC must already get this information, since that's what is returned when using something like
/echo -a $nick(<channel>,<nick>).idle

#158552 06/09/06 08:05 AM
Joined: May 2006
Posts: 122
J
Vogon poet
Offline
Vogon poet
J
Joined: May 2006
Posts: 122
mIRC has its own internal idle records it has nothing to do with the server for instance, when someone joins a channel there idle time is 0s on that channel, however it could be 1377448983s on a another common channel.


If only women came with popup menus and online help.
#158553 06/09/06 08:13 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
mIRC has its own internal idle records it has nothing to do with the server for instance, when someone joins a channel there idle time is 0s on that channel, however it could be 1377448983s on a another common channel.


I doubt it, they would have had to be idle for 43/44 years! LOL

#158554 06/09/06 08:56 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If that's the case, then why am I able to do something like the following:
I join a channel (let's call it #timbuktu)
Upon joining I see that Fred, George, and Mary are in the nicklist
Fred & George greet me, and I respond, also saying Hi to Mary
Mary doesn't respond, so I wait for 5 minutes then issue //echo -a $nick(#timbuktu,Mary).idle
This returns a value of 16000

That's an idle time of 16,000 seconds (4 hrs 26 mins 40 secs)

mIRC has to be getting that information from somewhere, and it can't be based on the time since I joined, since it's only been a little over 5 minutes since I joined, and yet Mary's idle time in the channel is returning nearly 4 1/2 hours.

#158555 06/09/06 09:38 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Your doing something wrong, or somethings wrong on ya system, //!echo -a $nick(#timbuktu,Mary).idle maybe ?

Do a /HOP and then test what it says, it should have started counting from the moment you entered the channel. (actually when the nicklist for the channel finsihed, but you know)

My results always match the channel join time displacement at the max.

#158556 06/09/06 12:40 PM
Joined: May 2006
Posts: 122
J
Vogon poet
Offline
Vogon poet
J
Joined: May 2006
Posts: 122
The $nick(#blah,mary).idle is channel specific right?
Ive never seen a server spit anything out regarding a channel specific idle time, Mary's idle time could be 2 mintes on #wwfwrestling and 20 minutes on #toolsnewcd, do a whois on Mary and her idle time could say 2 seconds. Its totally unrelated.


If only women came with popup menus and online help.
#158557 07/09/06 07:40 AM
Joined: May 2006
Posts: 122
J
Vogon poet
Offline
Vogon poet
J
Joined: May 2006
Posts: 122
Anyway I think is a nice idea and I see no reason why it shouldn't be implemented.
Perhaps just on *:idle:time in seconds:#chan:blah
eg.
Code:
 on *:idle:600:#ircaddicts:kick $chan $nick idle for 10mins, idle elsewhere


If only women came with popup menus and online help.
#158558 07/09/06 09:48 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
I don't really see a half decent way to implement this beyond what we already have to be honest. In theory it does not sound like a bad idea.

But the code involved means it's got to loop through each of your channels EVERY second (or maybe a longer period of time, but people would bitch about that wouldn't they?), this means that there'd be considerable lag depending on the amount of channels you're in, and how many users are in each channel.

The other option would be for mIRC to set internal timers that reset every time someone talks, but how is it to know when to trigger an "on idle" event? I'm sure the time is stored when the person last triggered an event (quit/join/action/text/chan-notice(s)/etc), and when you perform $nick().idle, it just compares the current time against the time that is stored for that nick, for the specific channel.

So if this was ever included, it'd probably have to be disabled by default.

In theory, a decent idea. But in reality, I think it's a bit too much.

#158559 07/09/06 10:04 AM
Joined: May 2006
Posts: 122
J
Vogon poet
Offline
Vogon poet
J
Joined: May 2006
Posts: 122
Good point, im not sure how mirc implements this, weather it sets a timestamp eg. $ctime for every user when you or they join or say something in the channel which is the most like situation. I had the thought in the back of my mind that it would increase everyones idle time by running the loop you just explained, so I thought it be not such an issue for a event to be triggered, but since you raise this point im thinking thats not the case.


If only women came with popup menus and online help.
#158560 07/09/06 02:00 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
assumingsomething like ....
on *:idle:600:#ircaddicts:kick $chan $nick idle for 10mins, idle elsewhere

IMO This wouldnt chew anything particully great in time up to check, and i reason this for the following...

Lets assume also that mirc keeps for each nick in each channel a value of last acivity, this being used to draw the results of $nick(CHAN,NICK).idle, i think this would be much more likely than any counter being added to each second some how. lets assume that vaklue is the same as $ctime

OK so once per second the ON IDLE system is tripped, and any ON IDLE events are searched for etc and said one above is found, current $ctime is grabbed and reduced by 600, then the channel is swept for any one with <= idle time, a loop of this nature in compiled code, even allowing for 1000 channels and 1000 users per channel is still going to be but a flash in time. Of course to do this in a mirc script would take a bit of time, even then with the right aproach you could likely get it down to workable.

#158561 11/09/06 06:23 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Hmm, im not apposed to some type of idle checking system. My thoughts now have moved more to consistancy. What i mean is, everything in mirc scripting has to be triggered in some way (either by incoming server event, timer, or input etc). An on idle event in that manner would not be triggered in the same way, not at all consistant with the rest of the scripting language.

Maybe an addition within the address book itself. Possibly a new list type in control, or an addition to the colors settings (ability to specify an alias or command to call along side the idletime setting), maybe instead of specifying that alias or command an option could be set to call a predefined one (idletime *:*, similar to raw *:* etc), even its own tab in the address book (although doesn't seem quite a fitting type of list for an 'address book').

I dont know, i guess it just doesn't seem appropriate to have it as an event when its not triggered by interaction as other events are.

Maybe an 'idletime' similar to how raw and ctcp are setup.

Hmm, i guess any way that you think about it doesn't seem particularly fitting or consistant if its part of the scripting language. Where as something in the address book seems a little more appropriate, in the sense that other things in there (like idletime color) are done without being triggered.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#158562 11/09/06 08:15 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I understand where your coming from, but that would also limit it to one alias/call per nick etc, where an event(s) can deal with none/some/all nicks as based on each events code, and while i agree everything(i think everthing) that is an event is tripped of by some change be it server message or mouse/keyboard activity or dcc/socket I still think it would make more sence to keep it in this area as its the one most people can readerly understand how to attach code to. of course as always, just my opion, i would be happy either way, (not that i actually can think of many times i have ever cared if someones idle)

#158563 12/09/06 05:47 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I dont think it would be limited in that way, since the design of other address book features allow you to specify a mask/chan/network sequence/wildcards, my thinking on the alias was that the relevent identifiers be configured to work when called from within the alias specified.

I do agree though, address book is often overlooked by people.

Maybe it could be done in such a way that isn't an automatically searched and called event. Some kind of trigger command used to call the script (whatever way it be coded.. event, raw style, etc).. maybe a special type of signal, requiring a timer to trigger it every second. This would avoid mirc parsing all scripts every second to search for the event when mirc would otherwise be idle and doing nothing (quite unnecersary searching would occur if no script existed for it).

Anyways, im sure if its concidered and put in khaled would find a good way to do it.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#158564 13/09/06 06:09 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I do not actually know, but i was of the opion that mirc didnt continuely pharse the scripts apon any event anyway, rather it used a pharsing when a script is loaded/modififed that builds some type of event points check list, that can then quickly be checked againes t on any assocaiated event. I dont see the point of pharsing all scripts for events relation to the event in progress every signle time an event occurs, I would bet its done once, then uses jump lists to go to said code.

#158565 13/09/06 01:42 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Never really thought about it i guess, i just figured mirc kept it in memory and scanned through it that way. Still, mirc would need an internal recuring timer of its own to do something to handle idle events, couldn't hurt to require the user to create this timer so that more control can be had over the event without needing to edit the script itself.

Does make more sense that mirc would create and release binds in that way rather than parsing the data all the time.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Page 1 of 2 1 2

Link Copied to Clipboard