/mwin

By zonirc on Mar 05, 2006

put it into your remote :)

/*
Name: /mwin
Author: zonirc
Email: zonirc@email.com
mIRC version: 6.15 and above

ENGLISH
--------------------
Updated:
- added <switches> and <parameters> to support the default /window switches and parameters.
- use $window().type to check the types of window(thanx to blue_elf)
- fixed window name bugs

Install:
type '/load -rs <this file address>' where <this file address> is the location where you save
this file. Type it in your mirc and when asked for authorization, click on any button to
continue, it does not have any effect on this file (no on load event)

/mwin <switches> <types> <parameters>
this one will allow you to manipulated the display of all the
specified window types. Some of the switches or/and parameter of /window will not changed the
display of some windows such as font parameter(since its only setting the font for the window when
its first created) and etc. Also, keep in mind that this alias only work with the current existed
window so that you are unable to open a new window with this snippet.

<switches>:
- same as /window switches, for more information please refer to mirc.hlp.

<types>:
- the types of the windows that will be manipulated can be specified more than 1 types
by using a comma(,) as a separator and make sure there's are no space between them. Below
is some of the available windows types(if you found other than the listed one, please
inform me - Im really appreciated it):

status - status window
channel - channel window
query - query window
custom - custom window
picture - picture window
notify - notify list window
urls - url list window
chanlist - channel lists window
links - links list window
send - dcc send window
chat - dcc chat window
finger - finger window
message - single message window

* - all windows

<parameters>:
- same as /window switches, for more information please refer to mirc.hlp.

Error Messages:
- because of the complicated switches and parameters, Ive decided to use a lot of default
error messages of /window. So if you see the error messages that contain the filename and
line number it mention as default error of /window.

Example:

/mwin -n channel,status
- this will minimize all channels and status window on the current connection
/mwin channel -1 -1 100 100
- this will resize all channel windows to 100 width and 100 height.

Example Script:
alias f2 /mwin -n *
This will minimize all windows on current connection when you hit f2

on *:active:*:{
  if ($lactivecid != $activecid) {
    scon -a mwin -h *
    scon -a mwin -w status
    mwin -wr *
  }
}
This example will show all window on your current connection of the active window and will hide
all windows except status window of the other connections. It is intended in order to manage your
switchbar so that it will not be crowded with too many windows button on it. To switch or show the
window of other connection/server simply click or activate its status window.
Keep in your mind that this example have been tested only in mirc 6.17.

Credits:
- bruas@biase
- da^hype
- h3lp@ArePie
- marlboro21
- blue_elf (because hinted me about $window().type)
- Mpdreamz (because found the window name bugs)
- comot_G84 (because edited some of my english)

BAHASA MALAYSIA
----------------------------------------------
Kemaskini:
- menambah <switches> dan <parameters> untuk menyokong /window switches dan parameters.
- menggunakan $window().type untuk memeriksa jenis tetingkap(terima kasih kepada blue_elf)
- perbaiki bugs nama tetingkap

Install:
Taip '/load -rs <fail nie punya lokasi>' dimana <fail nie punya lokasi>
merupakan lokasi fail nie di save oleh anda. Taip ia di mIRC anda dan
kemudian bila mirc memintak 'authorization', klik saja memana butang
yg terdapat pada message dialog tu.

/mwin <suis> <jenis tetingkap> <parameters>
satu perubahan/modifikasi arahan /window yg mana ianya membolehkan anda
memanipulasi kesemua jenis tetingkap yg dinyatakan. Beberapa suis atau/dan parameter /window
tidak akan mengubah paparan beberapa tetingkap seperti parameter font(ini disebabkan ianya hanya
akan menetapkan jenis font bagi tetingkap tersebut pada kali pertama ianya di buka) dan sebagainya.
Selain itu anda juga perlu mengetahui bahawasanya snippet ini hanya berfungsi pada tetingkap yang
telahpun di buka(wujud) pada mIRC anda, oleh itu anda tidak boleh menggunakan alias ini untuk
membuka tetingkap custom yang baru.

<suis>:
- sama seperti suis /window, untuk lebih informasi yang berkaitan sila rujuk pada mirc.hlp.

<jenis tetingkap>:
- jenis tetingkap yang ingin di manipulasikan keadaannya, dimana anda boleh menggunakan koma(,)
untuk mengasingkan setiap jenis tetingkap dan pastikan tiada ruang kosong diantaranya. Dibawah
disertakan senarai jenis tetingkap yang dapat aku ketahui(kalau korang dapat jenis tetingkap
yang tak dinyatakan di sini, silalah beritahu aku ye... bantuan korang amat dihargai):

status - tetingkap status
channel - tetingkap channel
query - tetingkap mesej peribadi
custom - tetingkap buatan(custom)
picture - tetingkap bergambar(picture)
notify - tetingkap senarai notify
urls - tetingkap senarai url
chanlist - tetingkap senarai channel
links - tetingkap senarai links
send - tetingkap dcc send
chat - tetingkap dcc chat
finger - tetingkap finger
message - tetingkap mesej tunggal

* - kesemua tetingkap

<parameters>:
- sama seperti parameters /window, untuk lebih informasi yang berkaitan sila rujuk pada mirc.hlp.

Mesej Ralat:
- disebabkan suis dan parameters yang ada terlalu rumit, aku menggunakan mesej ralat default /window.
Jadi sekiranya anda mendapat ralat mesej yang mempunyai namafail dan nombor baris maka itu merupakan
mesej ralat default /window.

Contoh:
/mwin -n channel,status
- ini akan mengecilkan tetingkap channel dan status pada connection yang teraktif.
/mwin channel -1 -1 100 100
- ini akan mengubah saiz tetingkap channel kepada 100(lebar) dan 100(tinggi).

Example Script:
alias f2 /mwin -n *
Ini akan mengecilkan kesemua tetingkap pada connection yang teraktif apabila anda menekan
butang F2

on *:active:*:{
  if ($lactivecid != $activecid) {
    scon -a mwin -h *
    scon -a mwin -w status
    mwin -wr *
  }
}
Ini pula akan memaparkan kesemua tetingkap yang berada pada connection yang sama dengan
tetingkap yang sedang aktif, dan menyembunyikan kesemua tetingkap kecuali tetingkap status
yang berada pada connection yang lain. Ianya di buat sebegini rupa untuk memastikan switchbar
anda tidak terlalu penuh dengan butang2 tetingkap. Untuk menukar atau memaparkan tetingkap
pada connection/server yang lain daripada yang sedang aktif, anda bolehlah mengklik atau
mengaktifkan tetingkap status bagi connection/server tersebut.

Penghargaan:
- bruas@biase
- da^hype
- h3lp@ArePie
- marlboro21
- blue_elf (sebab memberitahu berkaitan $window().type)
- Mpdreamz (sebab menemui bugs nama tetingkap)
- comot_G84 (sebab menyunting bahasa inggeris aku)
*/

alias mwin {
  var %e = echo -ftsac Info * /mwin:, %x = 1, %y = 1
  if ($isid) $replace(%e,/,$) Unknown Identifier
  else {
    while ($istok(+ -,$left($ [ $+ [ %x ] ],1),32)) inc %x
    var %t = $ [ $+ [ %x ] ]
    if (!%t) || (!$2) %e Missing $iif(%t,Parameters,Types)
    else {
      while ($window(*,%y)) {
        var %w = $v1
        if ($istok(%t,$window(%w).type,44)) || ($findtok(%t,*,1,44)) window $puttok($1-,$+(",%w,"),%x,32)
        inc %y
      }
    }
  }
  :error {
    if ($error) { %e $gettok($v1,2-,32) | reseterror }
  }
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.