mIRC Home    About    Download    Register    News    Help

Print Thread
#19644 16/04/03 01:15 AM
Joined: Feb 2003
Posts: 28
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 28
what i want to do is get the opposite of on *:ACTIVE:?:, so instead of a command triggering when i first enter a query window, it will trigger when i change windows. only one i can think of is 'on close', but that's pointless as i only want to change the window, and not actually close it

any ideas/codes? thanks in advance smile

note: i was given an answer on another forum to "use the $lactive with On Active", but cannot seem to get this correctly. dunno if this is correct, or if there's a better solution.


------------------
*** ArcticFire ***
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Example:
Code:
On *:active:?:{ echo -a Activated $active as $lactive was deactivated. }


$lactive represents the window you were just leaving.

Joined: Feb 2003
Posts: 28
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 28
yes, i know what $lactive is (and i've already tested out that code from the help file), but i just want some help with it. i cannot seem to get it working properly with my script. i need something like if ($lactive) so my script knows when to do the command.

you don't have to use $lactive if you don't think it's the best method. i juyst gave that note because i was told i could use $lactive to get what i'm looking for

edit:
here's a sample of the code i'm looking for (but i cannot get it to work properly):

on *:ACTIVE:*: {
if ($lactive == $query(0)) {
echo -a aaaaaaaaaaaaa
}
}

i just want something that will echo the next window after the query

Last edited by DrainBamaged; 16/04/03 01:50 AM.

------------------
*** ArcticFire ***
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I'm not sure I get this right. Do you want to display the next query in the list for every query window being activated?

For example, if you open two queries, /query a and /query b, do you want it to display 'b' everytime you activate 'a'?

I don't know what's the point of it, but here's some code:
Code:
On *:active:?:{
  var %i = 1
  while $query(%i) {
    if $ifmatch == $active { break }
    inc %i
  }
  if $query($calc(%i +1)) {
    echo -a The next query in turn is $ifmatch
  }
  else {
    echo -a This is the last query in list.
  }
}

Joined: Feb 2003
Posts: 28
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 28
errr, i think we're having some problems understanding one another.

all that i want is an opposite of the on *:ACTIVE:?: command. that's it! the only reason i asked for an echo is so i could understand your coding better. so if i wanted the echo to be "blah blah blah", i would like to see that echo when i click on any window AFTER i click on the query.
so i click on the query window, nothing will happen, but than the next window i click on (regardless of which window it is), i will see the echo message.

i really hope you understand now laugh


------------------
*** ArcticFire ***
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Ok, basically, you'd simply put an on ACTIVE event with an echo of 'deactivated $lactive'.

If you were to respond only to queries being deactivated, checking $query($lactive) will do the job:
Code:
On *:active:*:{
  if $query($lactive) {
    echo -a Deactivated query window: $lactive
  }
}

I hope this one is right smile

Joined: Feb 2003
Posts: 47
G
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
Code:
on *:ACTIVE:*:{
  signal DEACTIVE $lactive
}

on *:SIGNAL:DEACTIVE:{
  <$1 is the deactivated window>
  <code here>
}


/help /signal

Joined: Feb 2003
Posts: 28
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 28
ya that was perfect.

thanks for all the help smile


------------------
*** ArcticFire ***

Link Copied to Clipboard