mIRC Homepage
Posted By: RusselB nicklist qusestion - 02/09/08 03:46 AM
I have the following
Code:
menu nicklist {
  Idle : echo -a $$1 has been idle on $chan for $duration($nick($chan,$$1).idle)
}
and it works, but, what I'd like, is to have the idle time just show in the menu when I select Idle, as the nick and the channel are already pre-determined, so I don't really need that in the display.

I tried
Code:
menu nicklist {
Idle : $duration($nick($chan,$$1).idle)
}

But that just gave me an Unknown command message, indicating the time being returned was trying to be used as a command (which makes sense)
Posted By: hixxy Re: nicklist qusestion - 02/09/08 04:24 AM
Something like this?

Code:
menu nicklist {
  Idle ( $duration($nick($chan,$$1).idle) ): noop
}
Posted By: RusselB Re: nicklist qusestion - 02/09/08 04:27 AM
Solution found
Code:
menu nicklist {
Idle
.$duration($nick($chan,$$1).idle) : noop
}


P.S.: Hixxy's suggestion also works, and actually looks better than what I had.
Posted By: argv0 Re: nicklist qusestion - 02/09/08 05:15 AM
If you really want the :
Code:
menu nicklist {
  $style(2) Idle $+ $chr(58) $duration($nick($chan,$$1).idle): noop
}


$style(2) disables the menu item so you can't click it.

Note that the one caveat is that you can't use $chr to escape : with $submenu, but you shouldn't run into that one for a while.
Posted By: vexed2 Re: nicklist qusestion - 02/09/08 02:08 PM
The nicklist popup could get rather long when the idle time is high

Code:
menu nicklist {
  Idle  $replace($remove($duration($nick($chan,$$1).idle),ecs,ins,rs,ays,ks,ec,in,r,ay,k),w,w,d,d,h,h,m,m,s,s)))):/
}


PS - I've always used : / in a popup to do the kind of thing the OP asks for, just wondered if it makes a difference?
thanks.
Posted By: argv0 Re: nicklist qusestion - 02/09/08 04:01 PM
It doesn't make a difference, but the whole point of this post was about using : in menu items, not the rest of his code.

In any case, a regsub would be far less code for the above replacement:

Code:
$+(Idle,$chr(58)) $regsubex($duration($nick(#,$$1).idle), /([a-z])[a-z]+/g, \1):noop
Posted By: vexed2 Re: nicklist qusestion - 02/09/08 06:12 PM
very nice, i like that.
Posted By: sparta Re: nicklist qusestion - 24/09/08 11:10 AM
tested your code, and it worked just fine
Code:
$+(Idle,$chr(58)) $regsubex($duration($nick(#,$$1).idle), /([a-z])[a-z]+/g, \1):noop

And then i tested to make something to see idle time in query window, but i don't know what to use instead of # sign, anyone that know and can share the info with me? smile
Posted By: Crinul Re: nicklist qusestion - 24/09/08 11:49 AM
Code:
$+(Idle,$chr(58)) $regsubex($duration($query($$1).idle), /([a-z])[a-z]+/g, \1):noop

Reference /help $query
Posted By: sparta Re: nicklist qusestion - 24/09/08 12:20 PM
ty, did forget about that one smile
© mIRC Discussion Forums