|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I have the following 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 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)
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
Something like this? menu nicklist {
Idle ( $duration($nick($chan,$$1).idle) ): noop
}
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Solution found menu nicklist {
Idle
.$duration($nick($chan,$$1).idle) : noop
} P.S.: Hixxy's suggestion also works, and actually looks better than what I had.
Last edited by RusselB; 02/09/08 04:29 AM.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
If you really want the :
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.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Mar 2007
Posts: 218
Fjord artisan
|
Fjord artisan
Joined: Mar 2007
Posts: 218 |
The nicklist popup could get rather long when the idle time is high 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.
Last edited by vexed2; 02/09/08 02:08 PM.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
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:
$+(Idle,$chr(58)) $regsubex($duration($nick(#,$$1).idle), /([a-z])[a-z]+/g, \1):noop
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Mar 2007
Posts: 218
Fjord artisan
|
Fjord artisan
Joined: Mar 2007
Posts: 218 |
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
tested your code, and it worked just fine
$+(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?
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Feb 2006
Posts: 181
Vogon poet
|
Vogon poet
Joined: Feb 2006
Posts: 181 |
$+(Idle,$chr(58)) $regsubex($duration($query($$1).idle), /([a-z])[a-z]+/g, \1):noop
Reference /help $query
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
ty, did forget about that one
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
|