mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2010
Posts: 46
M
Mythos Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: May 2010
Posts: 46
I love mirc. It's my primary IRC program and I don't think I'll ever switch. However, I notice other clients have this thing where at the top of each channel window you can see the current topic. It kinda just stays up there and is persistent for each channel it's in.

I was curious if there was a script for that or a mode available for it. If not, I might make a suggestion for this to be added to mIRC itself as I think it'd be very handy.

I don't know the first thing about coding it myself.

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Hey!
mIRC by default shows the topic or a part of it on the top of the window!
Without colours though. If you haven't seen this you might have turned it off by accident. I think it is in the display menu but not sure.
If you have seen this and don't like it.. i dont think it's easy to make that without the use of a DLL. The A toolbar script could be used without any buttons and the topic would be /drawtext in a window, saved.
I think that's a good solution! But.. i'm not able to make itnow and i dont know if it's completely doable!

Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
mIRC does have the channel topic and other information in the titlebar, but if that's not enough: the first thing that comes to my mind is DCX.dll and docking/statusbar. Statusbar would be the easier and probably better/more reliable option.

You can activate it/hide it by typing /SB, it will also automatically active on mIRC startup.
Code:
on *:start:sb

alias sb {
  if ($dcxdll) {
    set -e %sb.dcx $qt($v1)
    if ($dll(%sb.dcx,_xstatusbar,mIRC visible)) {
      dll %sb.dcx xstatusbar -A 0
      .timersb.refresh off
      unset %sb.dcx
    }
    else {
      dll %sb.dcx xstatusbar -A 1
      .timersb.refresh -io 0 1 sb.refresh
      dll %sb.dcx xstatusbar -l 2000
      sb.refresh
    }
  }
  else echo -a * DCX.DLL required.
}

alias -l sb.refresh dll %sb.dcx xstatusbar -v 1 $iif($active ischan,$v1 $+ : $iif($chan($active).topic,$v1,No topic.),$v1)

alias -l dcxdll {
  if ($dll(dcx.dll)) || ($findfile($mircdir,dcx.dll,1)) || ($findfile($nofile($mircexe),dcx.dll,1)) return $v1
  else return $sfile($mircdirdcx.dll,Locate dcx.dll,Select)
}

It would be quite easy to add more cells/columns/whatever to it, and icons and whatnot.

You will also need DCX.DLL, put it in the mIRC folder or wherever you can find it from. Not sure what the policy is about linking to other sites or file, but whatever: https://dl.dropboxusercontent.com/u/36794604/p/dcx.dll (That's the dcx.dll file I personally use.)

The official site for it doesn't seem to exist anymore, but the GitHub page seems to be up: https://github.com/twig/dcxdll (Although you'll have to compile it, if you get it from there.)

And as always: scan the file and never trust anyone.





EDIT:

Got bored and decided to see what could be done with OrFeAsGr's idea, and here's the result.

The button picture size is limited to 256x256, so you won't be seeing much of the topic, but it works without DLLs.
Code:
on *:start:tbtopic

alias tbtopic {
  unset %tb.*
  if ($toolbar(tb.topic)) {
    window -c @tb.topic
    toolbar -d tb.topic
    .timertb.topic off
  }
  else {
    window -hfp @tb.topic -1 -1 256 16
    set -e %tb.pos 0
    set -eu2 %tb.pause 1
    toolbar -a tb.topic "Channel topic" @tb.topic 0 0 256 16 /channel
    .timertb.topic -iom 0 20 tupdate
  }
}

alias -l tupdate {
  if (%tb.active != $active) { set -e %tb.active $v2 | set -e %tb.pos 0 | set -eu2 %tb.pause 1 }
  var %t = $iif(%tb.active ischan,$iif($chan($active).topic,$v1,No topic.),$v1)
  drawrect -fn @tb.topic $color(background) 1 0 0 256 16
  if ($width(%t,Tahoma,-9,0,1) > 256) {
    if (%tb.pos >= $calc(48+$v1)) { set -e %tb.pos 0 | set -eu2 %tb.pause 1 }
    drawtext -np @tb.topic $color(topic) Tahoma -9 - $+ %tb.pos 0 %t $str($chr(160),10) %t
    if (!%tb.pause) inc -e %tb.pos
  }
  else drawtext -np @tb.topic $color(topic) Tahoma -9 - $+ %tb.pos 0 %t
  toolbar -p tb.topic @tb.topic 0 0 256 16
}

By default it updates the picture once every 25 ms, which technically is not that good, but is kind of required to make the scrolling smoothish. You can change it by changing the ".timertb.topic -iom 0 25 tupdate" command in the script.


EDIT #2:

You could of course make it take bigger steps with the scrolling, then it wouldn't have to update it as often and it would eat a lot less CPU time.

Last edited by Dazuz; 14/05/16 01:36 PM.
Joined: May 2010
Posts: 46
M
Mythos Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: May 2010
Posts: 46
I'm trying Dazuz's ideas, since that's more what I meant. smile

I know it's in the titlebar, but I meant something that's more or less at the top of each channel window (and just channel windows only)

The second script is closer to what I was wanting, but I'd rather it be it's own toolbar, showing all the colors and possibly being able to let me click URLS that show in it.

Last edited by Mythos; 14/05/16 05:15 PM.
Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Well, the second one is technically a button so you could make it look at the topic and open link(s) when you click it.

Code:
on *:start:tbtopic

alias tbtopic {
  unset %tb.*
  if ($toolbar(tb.topic)) {
    window -c @tb.topic
    toolbar -d tb.topic
    .timertb.topic off
  }
  else {
    window -hfp @tb.topic -1 -1 256 16
    set -e %tb.pos 0
    set -eu2 %tb.pause 1
    toolbar -a tb.topic "Channel topic" @tb.topic 0 0 256 16 /topiclinks
    .timertb.topic -iom 0 20 tupdate
  }
}

alias -l tupdate {
  if (%tb.active != $active) { set -e %tb.active $v2 | set -e %tb.pos 0 | set -eu2 %tb.pause 1 }
  var %t = $iif(%tb.active ischan,$iif($chan($active).topic,$v1,No topic.),$v1)
  drawrect -fn @tb.topic $color(background) 1 0 0 256 16
  if ($width(%t,Tahoma,-9,0,1) > 256) {
    if (%tb.pos >= $calc(48+$v1)) { set -e %tb.pos 0 | set -eu2 %tb.pause 1 }
    drawtext -np @tb.topic $color(topic) Tahoma -9 - $+ %tb.pos 0 %t $str($chr(160),10) %t
    if (!%tb.pause) inc -e %tb.pos
  }
  else drawtext -np @tb.topic $color(topic) Tahoma -9 - $+ %tb.pos 0 %t
  toolbar -p tb.topic @tb.topic 0 0 256 16
}

alias -l topiclinks {
  var %x = 1,%t $replacex($strip($chan($active).topic),$chr(28),$chr(32),$chr(29),$chr(32),[,$chr(32),],$chr(32),<,$chr(32),>,$chr(32),$chr(123),$chr(32),$chr(124),$chr(32),$chr(125),$chr(32),$chr(44),$chr(32))
  while ($wildtok(%t,*?.?*,%x,32)) {
    tokenize 1 $v1
    if ($wildtok($1,http://?*.??*,1,32)) || ($wildtok($1,https://?*.??*,1,32)) || ($wildtok($1,www.?*.??*,1,32)) url -a $v1
    inc %x
  }
}

It will open all of the links it detects in the topic.

Getting a whole new bar for it should be possible with possibly dcx.dll, but it would require more work.








And while I was typing this I got a new idea, and decided to play around:
Code:
alias topicbar {
  var %x = 1,%m $window(-3).dw $calc($window(-3).dh -25),%a $active
  while ($window(*,%x)) {
    window -r $qt($v1) 0 25 %m
    inc %x
  }
  window -a $qt(%a)
  window -pw0 +d @topicbar 0 0 $window(-3).dw 25
  set %topicbar.tx 4
  .timertopicbar -iom 0 500 topicbar.refresh
  topicbar.refresh
}

alias -l topicbar.refresh {
  var %a = $iif($active == @topicbar,$lactive,$active)
  if (%a != %topicbar.lw) set -e %topicbar.tx 4
  drawrect -fn @topicbar $color(background) 1 0 0 $window(@topicbar).dw $window(@topicbar).dh
  drawtext -np @topicbar $color(topic) Tahoma -11 %topicbar.tx 1 $iif(%a ischan,$iif($chan(%a).topic,$v1,No topic.),$v1)
  drawdot @topicbar
}

menu @topicbar {
  mouse: {
    if (%topicbar.mx) {
      tokenize 32 %topicbar.mx $mouse.x
      %topicbar.tx = $calc($2 -$1)
      %topicbar.lw = $iif($active == @topicbar,$lactive,$active)
      topicbar.refresh
    }
  }
  sclick:set %topicbar.mx $mouse.x
  uclick:unset %topicbar.mx | window -a $qt($lactive)
  $submenu($topicbar.links($1))
  -
  Reset topic position:set %topicbar.tx 4 | topicbar.refresh
  Reset window positions:topicbar
  -
  Close:window -c @topicbar | .timertopicbar off | unset %topicbar.*
}

alias topicbar.links {
  if ($1 == begin) { set -eu1 %topicbar.x 1 | set -eu1 %topicbar.topic $replacex($strip($chan($iif($active == @topicbar,$lactive,$active)).topic),$chr(28),$chr(32),$chr(29),$chr(32),[,$chr(32),],$chr(32),<,$chr(32),>,$chr(32),$chr(123),$chr(32),$chr(124),$chr(32),$chr(125),$chr(32),$chr(44),$chr(32)) }
  elseif ($wildtok(%topicbar.topic,*?.?*,%topicbar.x,32)) {
    tokenize 1 $v1
    inc %topicbar.x
    if ($wildtok($1,http://?*.??*,1,32)) || ($wildtok($1,https://?*.??*,1,32)) || ($wildtok($1,www.?*.??*,1,32)) return $replacex($v1,:,;) :url -a $v1
  }
  elseif ($1 == end) unset %topicbar.x %topicbar.topic
}

It probably needs quite a bit of tweaking, but it's kind of what you wanted.

You can start it by typing /TOPICBAR.

If you right click the window it'll open a menu that has the links listed in the topic (also a few other options). If you left click it, hold the button down and move your mouse, it'll move the topic around. That way you'll be able to see the whole topic.

Joined: May 2010
Posts: 46
M
Mythos Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: May 2010
Posts: 46
The last one is CLOSER to what I want, yes, but I'd want it to be multi-line and within the channel window instead of making the channel window smaller to showing that big ugly window border.

Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Multi line is doable, but that's about it. Some DLL might let you dock something into each channel window, but I can't help you with that.

Joined: May 2010
Posts: 46
M
Mythos Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: May 2010
Posts: 46
I would want it docked into the top of each channel window, yes. Maybe have it where it's on top of the chat and the nicklist, or just the chat, but not the tree/switchbar.


Link Copied to Clipboard