mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2004
Posts: 14
H
hatten Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Feb 2004
Posts: 14
Is this possible? I miss this feature so much when I use mIrc. ALT + a in irssi switches to the channel where activity last occured. It stores last activity in a queue. With this feature the usage of the mouse would decrase 95%.

#Chan7 last activity 12.39
#Chan2 last activity 12.37
#Chan4 last activity 12.35
#Chan9 last activity 12.30

Lets say im in #Chan5.

Alt+a will then first take me to #Chan7 I read whats been said press Alt+a again and mIrc will take me to #Chan2 --> Alt+a ---> #Chan4 ---> Alt+a ---> #Chan9.

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I think CTRL+TAB does this smile

Regards,


Mentality/Chris
Joined: Feb 2004
Posts: 14
H
hatten Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Feb 2004
Posts: 14
No ctrl+tab jumps around like a mad man. Dunno what it does in default. I have CTRL+TAB uses Switchbar Order to get some kind of structure using it. What I want with ALT+a is jump to the channel window where activity last occured (latest first in a queue). When queue is empty ALT+a should do nothing.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
The easiest way to do this is to keep a tokenized list of the channels you're on. When there is "activity" (however you choose to describe that) in any non-active channel, put that channel at the front of the list and delete it from wherever it was previously. Then, use one of the function keys, such as F5, that you're not currently using for something else instead of Alt-A (one key press instead of one combination of two keys presses).

; Uncomment (remove the colon from the beginning of the line for) the events you wish to consist of "activity"
; in the channel, and add any other events, following this pattern, that might apply.
;

; on *:OP:#: Update.List
; on *:DEOP:#: Update.List
; on *:VOICE:#: Update.List
; on *:DEVOICE:#: Update.List
; on *:BAN:#: Update.List
; on *:UNBAN:#: Update.List
; on *:JOIN:#: Update.List
; on *:PART:#: Update.List
; ctcp *:*:#: Update.List
on *:TEXT:*:#: Update.List
on *:ACTION:*:#: Update.List
on *:NOTICE:*:#: Update.List

; Set the [color:#B00000]%chans variable with a list of CID#chan pairs: %chans = 3,#mIRC 1,#HelpDesk 1,#mIRC 2,#mIRC
;[/color]
alias -l Update.List {
  • ; If the active window is the channel triggering the event, simply return, since we're in it and can see it.
    ;

    if $active == $chan { return }

    ; Unset the current list pointer, since it's now invalid after more channel activity.
    ;

    unset %Current.List.Item

    ; Reset the %chans variable to reflect the new order. Prepend the current CID#chan
    ; pair to the front of the list, removing the pair from anywhere in the list it's currently found.
    ;

    set %chans $+($CID,$chr(44),$chan) $remtok(%chans,$+($CID,$chr(44),$chan),1,32)
}

; Cycle through the most recent activity channel windows in 'most recent activity' order.
;

alias F5 {
  • ; Increment the list pointer. If there isn't one, it gets created and set to 1; if there is, it is simply incremented.
    ;

    inc %Current.List.Item

    ; Decide whether to use the first token (most recent activity) or the next one down the list.
    ;

    if (%Current.List.Item <= $numtok(%chans, 32)) var %CID#chan = $gettok(%chans, %Current.List.Item, 32)
    else var %CID#chan = $gettok(%chans, 1, 32)

    ; The first part of this value is the Connection ID (CID) of the channel that had activity.
    ;

    var %CID = $gettok(%CID#chan, 1, 44)

    ; The second part of this value is the channel name.
    ;

    var %chan = $gettok(%CID#chan, 2, 44)

    ; This optional portion can be uncommented to minimize the current window before switching to the new window.
    ;
    ;
    window -n $active

    ; Now switch to the channel with the last activity.
    ;

    scid %CID window -a %chan
}

I have tried to make it easy for you to follow the aliases used and (hopefully) made it easier to follow the variables used as well.

Update.List is called by any events that are uncommented and therefore "count" as activity in a channel.
F5 allows you to cycle backwards through the "most recent activity" channel list.

%chans hold the list of CID/channel pairs.
%Current.List.Item holds the pointer to the current one you've switched to.
%cid#chan holds the pair pointed to by %Current.List.Item variable.
%cid is the CID portion of %cid#chan variable.
%chan is the channel portion of the %cid#chan variable.

I think this is what you had in mind, at any rate.

EDIT: fixed the #.wefoi#wefoij problem.
EDIT: fixed the !channel problem.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Feb 2004
Posts: 14
H
hatten Offline OP
Pikka bird
OP Offline
Pikka bird
H
Joined: Feb 2004
Posts: 14
* /window: invalid parameters

looks like it almost works smile i get this when i press F5 sometimes.

*update* I can this this error a couple of times in row then all of a sudden it starts switch channels again.

*update2* I connect to IRC via a BNC so some of my channels looks like #a~#blabla. Seems it is these causing the problem.

Last edited by hatten; 08/04/04 07:45 PM.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
View the revised version and change the var %chan line.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Feb 2004
Posts: 21
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Feb 2004
Posts: 21
Hammer: Your script, although otherwise very nice, is not working with "!" channels, only with "#" channels. What about having active channels %variable in <connection id>,<channel name> format (separated by comma)?

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Several changes made to fix that.

Line 3 of Update.List
Lines 4 and 5 of F5

View the revised version above.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard