mIRC Home    About    Download    Register    News    Help

Print Thread
#196904 25/03/08 12:19 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
RusselB? your asking this question? Well here you go dude

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

or whatever wink


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Lpfix5 #196909 25/03/08 01:26 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Wims #196910 25/03/08 01:28 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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)


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Umm, $nick won't be set in a query window (at least not in my tests). $active.

Bekar #196935 25/03/08 11:44 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard