mIRC Homepage
Posted By: RusselB pm menu question - 25/03/08 12:19 AM
I have the following menu
Code:
menu * {
  Who2.1 : {
    set %chan $iif($chan,$v1,$null)
    .who2 $iif($snick(%chan,0),$snicks,$iif($nick,$nick))
  }
}
which works fine for the most part, however, if possible, I'd like it to automatically grab the nick of a person that sends me a pm. At the moment, if I select Who2.1 in a pm window, I still have to enter the name manually.
Posted By: Lpfix5 Re: pm menu question - 25/03/08 12:58 AM
RusselB? your asking this question? Well here you go dude

on *:OPEN:?:{ %n = $nick }

or whatever wink
Posted By: Wims Re: pm menu question - 25/03/08 01:03 AM
Code:
menu * {
  Who2.1 : {
    var %d $iif($chan || $query($active),$v1)
    .who2 $iif($snick(%d,0),$snicks,%d)
  }
}
You can do something like that but if the active window is a status window for exemple, the $iif will return $null
Posted By: RusselB Re: pm menu question - 25/03/08 01:26 AM
Thanks for the suggestion, but I need the information to be set when the menu is called, so using a different event is, to the best of my knowledge, not an option.
Posted By: RusselB Re: pm menu question - 25/03/08 01:28 AM
hmm.. thanks.. I'll give it a try, and it doesn't matter if the $iif returns $null for the status window, as there is a prompt to fill in nick(s) if none are supplied.
Posted By: Riamus2 Re: pm menu question - 25/03/08 02:45 AM
Two alternatives (the second one is if you want it to work in older mIRCs that don't have $v1):

$iif($chan,$v1,$nick)
$iif($chan,$chan,$nick)
Posted By: Bekar Re: pm menu question - 25/03/08 12:25 PM
Umm, $nick won't be set in a query window (at least not in my tests). $active.
Posted By: Riamus2 Re: pm menu question - 25/03/08 11:44 PM
Yeah, you're right. Use it as $active. I usually use that method when text is received, which *would* have $nick for a query window.
© mIRC Discussion Forums