mIRC Home    About    Download    Register    News    Help

Print Thread
$active and $read #992 10/12/02 10:44 PM
Joined: Dec 2002
Posts: 15
MadKairon Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 15
Properties for $active identifier. It'd be very useful if the identifier had a .type property which returns the window type for the active window (query,channel,etc) If this can be done in any other way please let me know.

Improve $replace identifier: example:
on *@!:mode:#: mode $chan $replace($1-,+,-,-,+)
that doesn't work because the identifier will first replace the "+" for "-" but then when replacing the "-" will re-replace what it replaced in the first part.

Re: $active and $read #993 11/12/02 12:17 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
[Edited] Added additional information for completeness. -Hammer
  • ;
    ; To use this identifier, pass in your unknown window type.
    ; $winType($active) can return
    ;
    ; #Hammer is of type channel
    ; Hammer is of type query
    ; =Hammer (dcc chat window) is of type chat
    ; =Hammer (fserve window) is of type chat
    ; @Hammer is of type custom
    ;
    ; Notify List is of type notify
    ; URL List is of type urls
    ; Send Hammer mirc.exe is of type send
    ; Get Hammer mirc.exe is of type get
    ; Links List is of type links
    ; Message Window is of type message
    ;
    alias winType return $window($$1).type
    ;
    ; To test, you can use the following alias and the timer that follows it; then just make different
    ; window types active and watch your status window for the results.
    ;
    alias echoWinType echo $color(info) -sti2 $active is of type $window($active).type
    ;
    ; /.timerWin 0 10 echoWinType
    ;
    ; Incidentally, you can close any of those windows with /window -c .... for those windows with
    ; multi-word names, enclose the names in double-quotes.
    ;
    ; /window -c "URL List"
    ; /window -c "Links List"
    ;
As for your $replace suggestion, there is only one way to accomplish what I believe you to be asking. You will have to use 2 $replaces, one nested inside the other. The inner $replace switches the + to something you could not possibly in the string, a temporary value, such as $chr(255). Then you are free to switch the -'s with +'s. Then in the outer $replace, you switch the first $replace from to $chr(255) to -.

$replace([color:blue]$replace($1-,+,$chr(255),-,+),$chr(255),-)[/color]

Last edited by Hammer; 18/12/02 08:27 AM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: $active and $read #994 11/12/02 12:52 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
or $window($active).type

Re: $active and $read #995 11/12/02 02:35 AM
Joined: Dec 2002
Posts: 15
MadKairon Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 15
wow man, thanks. I had already scripted something to solve the $replace problem but your way is like 1000 times better. About the $active thing, yup, I've scripted something similar. I was worried because I thought there was a switch to remove the @ from custom windows but it doesn't remove it, it just hides it. With a little modification to add also a "status" window reply it'll work fine =)

Re: $active and $read #996 18/12/02 12:19 AM
Joined: Dec 2002
Posts: 18
W
watcher Offline
Pikka bird
Offline
Pikka bird
W
Joined: Dec 2002
Posts: 18
Hammer, you forgot =* ..DCC Chat smile


-watcher