mIRC Home    About    Download    Register    News    Help

Print Thread
#143164 21/02/06 11:28 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello

can you tell me please how can I assosiacte F1 and F2 with 'activate the next right tab' and 'activate next left tab' ?

what other keys can I use as hotkeys in mirc?

thanks!

#143165 22/02/06 12:16 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
2nd question first:
Any the F keys can be associated either alone or in combinations with the Shift &/or Ctrl keys

From the mIRC help file
Quote:
Function Key support
You can redefine function keys to perform certain commands, just like aliases. For example:

/F1 /say Hello!
/sF2 /query $1
/cF3 /ctcp $1 version

The s and c prefixes for Shift key and Control key respectively.

Note: A function key will behave differently depending on the window in which it is used. For example, when using it in a query window the $1 parameter refers to the selected users nickname. If you're on a channel and the nickname listbox is active then the function key will work on the selected nicknames. If the listbox is not active, the function key will just work on the channel.



In regards to your first question, I'm going to presume that your tabs are actually part of a dialog that you have.
I don't have any codes to test this on, so this is untested
Code:
 F1 {
did -f <dialog name> $calc($dialog(tab) - 1)
}
F2 {
did -f <dialog name> $calc($dialog(tab) + 1)
}
 

F1 is back one, F2 is forward one. NOTE: There is no error checking to prevent the occurance of invalid ID's

Your Tab ID's MUST be in sequential order for this to work.

#143166 26/02/06 02:23 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Code:
* /did: invalid parameters  


frown

#143167 26/02/06 03:04 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
That would be $dialog(<dialog name>).tab

#143168 26/02/06 07:52 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks Hixxy. I haven't used tabs in my own dialogs yet, so I was going the best I could from the help file and my own knowledge. You correction has been noted, and hopefully, with that, the original poster now has a working code.

#143169 27/02/06 04:28 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
can you tell me the right code please

thank you

#143170 27/02/06 04:34 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 F1 {
did -f &lt;dialog name&gt; $calc($dialog(&lt;dialog name&gt;).tab - 1)
}
F2 {
did -f &lt;dialog name&gt; $calc($dialog(&lt;dialog name&gt;).tab + 1)
}
 


Replace <dialog name> with the actual name of the dialog.

#143171 28/02/06 09:30 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
what is the actual name of the dialog????

#143172 28/02/06 11:17 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I have no way of knowing that, but you must've specified a name for the dialog when you created it.

Look in your script for a line that looks like
Code:
dialog &lt;name&gt;  

It will be the first line of the section where you create the dialog.

#143173 28/02/06 04:15 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
am I supposed to specify a dialog each time I want to change tab?

maybe you didnt understand me, I want change tabs by pressing F1/F2 for the next right/left tab of the active one

#143174 01/03/06 01:35 AM
Joined: Jan 2006
Posts: 61
C
Babel fish
Offline
Babel fish
C
Joined: Jan 2006
Posts: 61
To you get the name of current dialog use the identifier $dname who returns the current dialog name, like this:

on *:dialog:test:sclick:25:{
.echo -a Im clicking on button id $did on $dname dialog
}

Explanation:

assuming you have a button with the id 25 on a dialog called teste, when you click on these button then will return Im clicking on button id 25 on teste dialog.

Thats all

*


The practice do the Master...
#143175 01/03/06 02:17 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The only place where I've encountered tabs, is in dialogs.

If you aren't using a dialog, then you aren't using the correct term for your reference.

Incorrect information from you will not assist me is helping you resolve problems that you're having.

If you aren't using a dialog, and you don't know the correct term for what it is you're wanting to do, give as detailed a description of your situation, or if possible, provide a screen shot, so that we can see what you mean, and get you the correct terminology and solutions.

#143176 01/03/06 10:05 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
sorry

I consider tab as every box/item that appears in 'switchbar'

maybe I should refrain: I want to change view of windows by F1,F2 (left, right)

a window can be 'the status window', 'a private message query window', 'a channel window'

I borrowed the term 'tab' from web-browser Opera and Firefox...

#143177 02/03/06 02:25 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Due to limitations in mIRC, this is the best I can come up with:

Code:
alias F2 shift -1
alias F3 shift 1
alias shift {
  ; 1: &lt;1=left 0=same &gt;1=right
  ;
  var %wname, %wlist, %wtype, %ccid = $cid, %cwin = $active
  var %a = 0, %aa = $scon(0), %c = 0, %cc = 0, %n = 0, %nwin = 0
  while (%a &lt; %aa) {
    inc %a
    scon %a
    %c = 0
    %cc = $window(*,0)
    while (%c &lt; %cc) {
      inc %c
      %wtype = $window(*,%c).type
      if ($istok(chat custom fserv get send,%wtype,32)) continue
      %wname = $window(*,%c)
      inc %n
      if ((%ccid == $cid) &amp;&amp; (%cwin == %wname)) %nwin = %n
      %wlist = $addtok(%wlist,$+($cid,.,%wname),44)
    }
    scon -r
  }
  ;
  if (%nwin == 0) {
    %nwin = $findtok(%wlist,$wildtok(%wlist,$+($cid,.*),1,44),1,44)
    %nwin = $calc(%nwin + $wildtok(%wlist,$+($cid,.*),0,44))
    if ($1 &gt; 0) dec %nwin
  }
  if ($1 &lt; 0) {
    dec %nwin
    if (%nwin == 0) dec %nwin
  }
  elseif ($1 &gt; 0) {
    inc %nwin
    if (%nwin == 0) inc %nwin
  }
  %nwin = $calc(((%nwin - 1) % $numtok(%wlist,44)) + 1)
  ;
  %nwin = $gettok(%wlist,%nwin,44)
  if (%nwin != $null) scid $gettok(%nwin,1,46) window -a $+(",$gettok(%nwin,2,46),")
}


(Make sure you remove existing F2/F3 aliases)

Usage:
F2 = scroll left
F3 = scroll right
/shift -1 = scroll left
/shift 1 = scroll right


This code should scroll left (F2) and right (F3) through each of the following (compatible) windows:
  • status windows
  • channel windows
  • query windows


It will NOT scroll through the following windows:
  • dcc send windows
  • dcc get windows
  • dcc chat windows
  • fserv windows
  • custom windows


However, it WILL scroll off of an incompatible windows to the nearest compatible window (left or right).

Let me know if there are any bugs.

-genius_at_work

Last edited by genius_at_work; 02/03/06 02:33 AM.
#143178 14/03/06 01:42 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
it works flawlessly so far

THANK YOU VERY MUCH!!

by the way is there any possibility to associate it instead of F2,F3 with the right/left arrow in keyboard?

thanks again!

#143179 19/05/06 01:27 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Quote:
This code should scroll left (F2) and right (F3) through each of the following (compatible) windows:
  • status windows
  • channel windows
  • query windows


It will NOT scroll through the following windows:
  • dcc send windows
  • dcc get windows
  • dcc chat windows
  • fserv windows
  • custom windows


However, it WILL scroll off of an incompatible windows to the nearest compatible window (left or right).


is it possible to make this code work for query windows only?

thank you!

#143180 19/05/06 01:47 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Change this line:

Code:
if ($istok(chat custom fserv get send,%wtype,32)) continue


To this:

Code:
if ($istok(channel status chat custom fserv get send,%wtype,32)) continue



-genius_at_work

#143181 01/06/06 05:39 PM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
is it possible to make those aliases work only for windows (either channel or query) in which there was recent activity in them? (those that have become red, indicating that a new event has occured eg msg)

thanks!

#143182 08/06/06 04:41 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
Quote:
is it possible to make those aliases work only for windows (either channel or query) in which there was recent activity in them? (those that have become red, indicating that a new event has occured eg msg)

thanks!


it cannot be done?


Link Copied to Clipboard