如何更改 mIRC 中链接的颜色?
在 mIRC 中,我希望所有链接看起来都像 html 链接(带有下划线的蓝色),以便它们在频道和消息中突出显示。我确信我必须编写一个远程脚本,但我不确定代码是什么。
In mIRC I want all links to look like html links (blue with an underline) so they stick out in channels and messages. I'm sure I have to write a remote script but I'm not sure what the code would be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新:这适用于文本中匹配的第一个 URL。我无法完全让它与多个链接一起工作。
我之前没有处理过 mIRC 的 RegEx 函数,因此可能有一种更简洁的方法:
注释:
set -u
在脚本运行后删除变量,< code>$chr(3) 是颜色的控制代码,12
是 URL 蓝色的颜色编号,$chr(31)
是控制下划线代码。Update: This works on the first URL matched in the text. I couldn't quite get it working with multiple links.
I haven't dealt with mIRC's RegEx functions before, so there may be a cleaner way of doing this:
Notes:
set -u
deletes the variable after the script runs,$chr(3)
is the Control Code for Color,12
is the Color Number for URL Blue, and$chr(31)
is the Control Code for Underline.mIRC“捕手”遵循以下规则:
来自帮助文件(/help catcher):
正如另一个答案中所述,修改默认行为将导致间距压缩效果,但对于此脚本来说应该不会有太大问题,因为它只会在显示 URL 时触发。 (此外,我使用了 & 前缀,这将使 mIRC 禁用该事件,以防另一个脚本执行了较早的默认文本更改并执行了 /haltdef)
将变成:
变为:
编辑:
我对 $target 的使用在我原来的答案中是无效的,这导致了 Commander_keen 所描述的问题。现在这个问题应该得到解决。
The mIRC 'catcher' follows the following rules:
From the help File (/help catcher):
As stated in the other answer, modifying the default behavior will cause a spacing compression effect, but it shouldn't be too much of an issue with this script as it will only trigger when a URL is displayed. (Additionally I used the & prefix which will make mIRC disable the event in case another script has performed an earlier default text altering and executed a /haltdef)
will turn:
into:
Edit:
My use of $target was invalid in my original answer which resulted in the issue commander_keen described. This should now be fixed.
我只是想补充一点,它需要使用 //echo 才能将文本输出到正确的通道,否则文本将被发送到状态窗口等。
此外,我会添加 -bf 和 -m 参数以将消息视为正常的用户消息并应用默认的闪烁/蜂鸣设置,否则该消息不会使通道表现得好像有新消息一样。
因此,jnpcl 脚本的总结为
//echo -bfmtrl
,即使尊重时间戳设置(即-t
),Wiz 的解决方案也可能会从其中的一些中受益也发生了变化。
亲切的问候
PS:jnpcl 的脚本滞后于没有 http:// 的 www 链接的 URL 突出显示,并且在查询窗口中突出显示。最后一个问题当然可以通过在 ^*:TEXT:*:?:{ 块上添加第二个
//echo -bfmtl $nick
轻松解决。 $+ $尼克 $+ > %tmp.text
,但我想知道是否可以在一个ON:TEXT
处理程序中完成。不幸的是,当检测到查询中的链接并且查询中的文本保持原样时,Wiz 的脚本总是最终发送到状态窗口。似乎
$target
不能按预期的查询工作,它使用自己的昵称,但我不知道解决方案。因此,在 jnpcl 的代码中使用 Wiz 的正则表达式并进行上述改进,最终会在通道中使用以下工作代码并查询 http 和 www 链接等。目前:
我很高兴看到 Wiz 的解决方案也可以使用查询。在我看来,这比两个事件块更干净。在那之前,上面的代码应该代表了两者的优点。
I just wanted to add that it requires to use //echo in order to get the text output to the correct channel for me, otherwise the text will be sent to the status-window or so.
Additionally I would add the -bf and -m parameters to treat the message as normal user-message and apply the default flashing/beep settings, otherweise the message won't make the channel act as if there is a new message.
So that would sum up as
//echo -bfmtrl
for jnpcl's script, even respecting the timestamp-settiings (that's the-t
)Wiz's solution might profit from a few of those changes, too.
kind regards
PS: jnpcl's script lags the URL-highlighting for www-links without http:// and highlight in query windows, yet. Last issue can of course easily be resolved by adding a second
on ^*:TEXT:*:?:{
block with//echo -bfmtl $nick < $+ $nick $+ > %tmp.text
, but I wonder if it can be done in oneON:TEXT
Handler.Wiz's script unfortunately always ends up in sending to the status window when a link in a query is detected and the text in the query stays as is. Seems like
$target
doesn't work as expected for queries, it uses the own nick, but I don't know a solution for that.So using Wiz's regex in jnpcl's code with the improvements mentioned above ends up in the following working code in channels AND queries for http AND www links etc. for now:
I'd be happy to see Wiz's solution work with queries, too. That would be cleaner than two event-blocks in my eyes. Until then the above code should represent a best of both.