mIRC Home    About    Download    Register    News    Help

Active Threads | Unanswered Past 24 hours | Past 48 hours | Past Week | Past Month | Past Year
Bug Reports Jump to new posts
Re: "Ghost" mIRC boxes appear in Windows Taskbar rockcavera 14/09/21 11:51 PM
It's happened twice to me. I don't remember how it happened. I don't use dlls. Just my remotes.
5 174 Read More
Bug Reports Jump to new posts
Re: literal inc or dec in an $identifier() breaks vars Khaled 14/09/21 03:08 PM
Quote
Just to be sure: I might be reading it wrong, but it appears to me that the previous thread (and the potential fix) was addressing the behavior of strictly and only the /timer command

The issues are different but they are actually present in the same small, shared function. I am going to make a change to address the issue in this thread in the next beta.
11 368 Read More
Bug Reports Jump to new posts
Re: /window with icon and $window().icon Khaled 12/09/21 01:13 PM
Thanks for your bug report. There are several issues here due to how different features were added at different times. I will need to rewrite parts of the window titlebar/switchbar/treebar and /window code to load/set/handle small/large icons, so that the same icons are used in the same contexts in all of these features. This change will be in the next beta.
1 111 Read More
Scripts & Popups Jump to new posts
Re: mute addon maroon 12/09/21 05:21 AM
This is a case of "doctor my arm hurts when i move it like this"
If you don't want your arm to hurt, then stop moving it. If you don't want the /vol command to affect the master volume level, then don't use the -v switch. Per /help vol

"If you use the -v switch, this sets the master volume on your system."
1 65 Read More
Feature Suggestions Jump to new posts
Re: Add $ircdversion = ircd-ratbox-3.0.10(20160113_12- damian 06/09/21 12:16 PM
I made this for you, I hope it helps. Remember that this relies complete on the IRCd sending you the information and conforming to RFC.

Code
raw 2:*:{ set -e $+(%, ircdv., $cid) $8 }
alias ircdv {
  return $eval($+(%, ircdv., $cid), 2)
}


It's pretty simple. The RAW will get the version from the initial notice when you join the network and store it against the connection identifier. When you use $ircdv it will return the value on the server you're on like any other script.

Usage:

Code
on *:TEXT:!checkircdv:?:{
  if (ircd-ratbox-3.* iswm $ircdv) { .notice $nick Woah! This is RATBOX3!!! }
}


.. or as an alias

Code
alias checkircdv {
  if (UnrealIRCd-* iswm $ircdv) { echo -a .. We have UnrealIRCd! Uhoh. }
}


Good luck!
1 99 Read More
Scripts & Popups Jump to new posts
Ircops list count numbers danielboom 06/09/21 12:38 AM
menu nicklist {
.S-canners
..Bots: who 0 o
}

raw 352:*: {
if H& isin $7 { set %operado1 $addtok(%operado1,$6,44) }
if Hr isin $7 { set %operado $addtok(%operado,$6,44) }
if H* isin $7 { set %operadores $addtok(%operadores,$6,44) }
}

raw 315:*: {
echo -a 1,0Ircops- %operado
echo -a 1,0Bots- %operadores
}


how i can do to count the opers

Ircops : (2) - Daniel - AFK

THNX
0 61 Read More
mIRC Help Jump to new posts
cant scroll through the popups vigilant 05/09/21 05:03 PM
i cant scroll down through popups while in 150% display mode in windows 10
....

there should be an option
0 55 Read More
Scripts & Popups Jump to new posts
Re: userID ban help krisb34213 05/09/21 12:13 PM
Thank you very much and thanks also for the explanation! I save it, which for sure will come in handy smile
2 89 Read More
Scripts & Popups Jump to new posts
Re: samove Epic 03/09/21 08:33 PM
Probably the question is related to the command provided by the module for InspIRCd: https://github.com/inspircd/inspircd-contrib/blob/master/3.0/m_samove.cpp

The correct syntax would be: "/SAMOVE <nick> <channel1> <channel2> [reason]" ➔ [reason] - unknown if this optional parameter might work in your version of the module.

Originally Posted by thexplorer
What if I want to have a .samove #test:/ ..... which move a user directly to #test without any input-box?

In this case, the command for the nickname list menu should look like this: ".samove #test: /samove $* $chan #test".

This command will move all selected users in the list of nicknames of the open channel to another channel, which you yourself specify in your menu.
It is as if you were executing two commands at the same time: "/SAPART" and "/SAJOIN". Note: Such commands are only available to users with IRCop rights.

5 124 Read More
Scripts & Popups Jump to new posts
notify on off script help danielboom 03/09/21 06:25 PM
alias noti {
var %i = 1
while (%i <= 10) {
if $exists(@notif) = $false { window -le+td @notif 400 400 200 200 }
if $notify(%i).ison == $true { .aline @notif 0,4 C-ctado:  $Notify(%i) }
elseif $notify(%i).ison == $false { .aline @notif 0,3 D/ectado:  $Notify(%i) }
inc %i
}
}

ii made this but doesnt work fine , any help thnx
0 41 Read More
Bug Reports Jump to new posts
Re: Retrieving channel modes not working with AnonIRCd Khaled 03/09/21 01:13 PM
Looking at the /channel code, it should be possible to change it so that it opens the channel central dialog immediately, while the /mode +b is in progress in the background. This would make the channel central dialog accessible even on servers that don't reply to /mode +b. It also makes /channel more predictable, ie. it currently appears suddenly once the /mode +b has completed, which could take several seconds. This change should be in the next beta.
5 245 Read More
Bug Reports Jump to new posts
Re: /dns not connected to server Khaled 01/09/21 09:06 AM
Quote
The DNS command that sometimes:
* /dns: not connected to server

is:
/dns -4 1.0.0.127.rbl.ircbl.org

I have not been able to reproduce this so far. Are you sure that something else in your script is not using /dns with the wrong parameters?
4 238 Read More
Scripts & Popups Jump to new posts
Re: Script Issues ErikMouse 31/08/21 12:30 AM
Originally Posted by Epic
Well, then, based on your requirements, you can try using this script:
Code
on *:SNOTICE:*Client connecting*: client_connecting $1-
alias -l client_connecting {
  var %cc_snotice $strip($1-)
  var %cc_server $gettok(%cc_snotice,1,58)
  if (palace.morphforest.com isin %cc_server) {
    var %cc_chan #Zen-Activity
    var %cc_user $gettok(%cc_snotice,2,58)
    var %cc_nick $gettok(%cc_user,1,32)
    var %cc_mask $remove($wildtok(%cc_user,*@*,1,32),$chr(40),$chr(41))
    var %cc_zline $+(*@,$gettok(%cc_mask,2,64))
    if ($istok(ErikMouse EricMouse norenxaq MFServ,%cc_nick,32)) {
      msg %cc_chan 10Сonnected: $+(,%cc_nick,) %cc_mask -> $+($chr(40),03,Good user,,$chr(41)) | halt
    }
    if ($istok(Troll Jester Fool Boob Dummy,%cc_nick,32)) {
      msg %cc_chan 10Сonnected: $+(,%cc_nick,) %cc_mask -> $+($chr(40),07,Local clown,,$chr(41)) | halt
    }
    msg %cc_chan 10Сonnected: $+(,%cc_nick,) %cc_mask -> $+($chr(40),04,Potential intruder,,$chr(41))
    .gzline %cc_zline +30d You came at the wrong time and fell under the distribution, the next attempt to get into our network you will have in 30 days.
  }
}


Just to let you know, I had tested out this script in my mIRC bot client and it worked correctly. The only thing is I need to change
Code
.gzline %cc_zline +30d
to
Code
.gzline %cc_nick +30d
instead to where it is doing
Code
/gzline <nick> +30d
instead since the server translates the nick to the IP address of the connecting nick, and
Code
/gzline <hostmask> +30d
was resulting in the following.

Code
-anthropia.morphforest.com- ERROR: (g)zlines must be placed at *@ipmask, not user@ipmask. This is because (g)zlines are processed BEFORE dns and ident lookups are done. If you want to use usermasks, use a KLINE/GLINE instead.
8 149 Read More
Bug Reports Jump to new posts
Re: $notify(N/nick).addr Khaled 29/08/21 10:58 AM
Thanks for your bug report. I have not been able to reproduce an issue with .addr so far. The .addr property depends on the IRC server returning addresses in the notify reply. If the server is using an old notify method, that does not provide this information, then .addr will be empty. It is also possible for .addr to be filled/updated if the IAL entry for that nickname is filled.
1 86 Read More
mIRC Help Jump to new posts
Re: SSL Connections Grimlakin 28/08/21 07:18 AM
So I'm running into this as well when trying to configure the proxy settings in MIRC. Most often message I get is the Unable to connect to server (SSL wrong version number) message.

I tried going to the MIRC ini but in SSL there is no cyphers or ciphers section at all.
2 2,184 Read More
mIRC Help Jump to new posts
Re: Free server use Epic 27/08/21 01:06 PM
And what is the actual problem? By itself, IRC chat and all possible servers collected in a single network are free for access and communication on them.
In the mIRC client out of the box, after installation, there is already a large list of different networks with many servers.
It's weird that my network hasn't been added to this list yet: EpicNet.Ru (irc.epicnet.ru:6667) cool

Run mIRC. Press the key combination "ALT+O". Go to the drop-down submenu "ConnectServers" and choose the server that suits you, where it will be convenient for you to communicate.
After connecting to the server, you can go to the channel under any name convenient for you. Command: "/join #Channel" (if the chosen name for the channel does not contradict the internal rules of the network).
It is advisable to register your channel on the services to obtain management rights. After that, you can moderate and make your channel closed from outside visits.

If you meant that someone would turn on a under Linux operating system server machine for you, where an IRCd program would be installed to provide a working IRC chat so that only 4 people could connect to this server, then it would not be advisable. You should understand that any work of such a server working machine requires regular payment of money for the service of a virtual machine. Or if it is a home computer, then the payment will be payment for connecting to a stable Internet + additional installation of an uninterruptible power supply device and for protection against power surges + payment for electricity + regular maintenance to remove dust inside a constantly working computer and replace burnt-out parts.
1 74 Read More
Scripts & Popups Jump to new posts
Re: Color text ban script? Epic 23/08/21 11:27 AM
But what if it's will not a flooder, but an ordinary positive user who just loves to decorate and beautifully design their messages, or if he structures his messages in such a way as to highlight certain parts of the text in order to draw attention to them? It seems to me that it would be wrong to immediately ban someone who has added a little color to their message.

To avoid erroneous decisions and not ban everyone in a row (which can lead to resentment and termination of visiting your channel), I offer a more options for solving this issue.

You can use the built-in IRCd commands to set channel modes, which will help protect your channel from unnecessary rich text in user messages without having to set a "Ban":

  Command: "/mode #channel +c" - will set the "c" mode, which will block all user messages that contain codes "color, bold, underline" etc.
  Command: "/mode #channel +S" - will set the "S" mode, which will cut out all possible text formatting codes from user messages written on the channel.

Some IRCd may have different names of modes and how they are set, so just in case, check the documentation and help for your server: "/helpop". There are likely to be other ways of protecting channel.

⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻

As an alternative protection solution, I can suggest using the following script on your bot, which I specially created for this purpose.

Anti Code v1.0 – description:

  1.This script will help protect your channel from user messages that use text formatting codes: "Color/Bold/Underline/Italic".
  2.In the alias "anticode_set" you can remake all the settings for this script by changing the values of the variables:

      %ac_color – configures whether to enable or disable tracking of "Color" codes in text. The options are: <yes|no>.
      %ac_bold – configures whether to enable or disable tracking of "Bold" codes in text. The options are: <yes|no>.
      %ac_underline – configures whether to enable or disable tracking of "Underline" codes in text. The options are: <yes|no>.
      %ac_italic – configures whether to enable or disable tracking of "Italic" codes in text. The options are: <yes|no>.
      %ac_limit_color – configures the maximum number of "Color" codes allowed in one message. For a complete prohibition, specify a value: <0>.
      %ac_limit_bold – configures the maximum number of "Bold" codes allowed in one message. For a complete prohibition, specify a value: <0>.
      %ac_limit_underline – configures the maximum number of "Underline" codes allowed in one message. For a complete prohibition, specify a value: <0>.
      %ac_limit_italic – configures the maximum number of "Italic" codes allowed in one message. For a complete prohibition, specify a value: <0>.
      %ac_logo – configures the logo of the script name, which will be indicated in the kick message. (You can change this to your text).
      %ac_reason – configures the reason for the ban, which will be indicated in the kick message. (You can change this to your text).
      %ac_except_nicks – contains nicknames separated by commas for exclusion, to which the script will not react. (You can change this to your nicknames).
      %ac_except_status – contains symbol prefixes with channel statuses for exclusion, to which the script will not react. Default: <[!,~,&,@,%,+]>. (You can change this to your symbol prefixes).
      %ac_btype – configures the type (format) of the ban for the offender. More details about the types of bans are described here: $mask. Default: <2>.
      %ac_btime – contains the time (in seconds) for which a temporary ban will be set, and after which it will be automatically canceled on the channel. If you do not want to remove the ban, then set: <0>.
      %ac_kick – configures whether to enable or disable execution "Kick" for the offender. The options are: <yes|no>.

Demo screenshot of the script's operability:

      [Linked Image from i.ibb.co]

The script was tested on InspIRCD v3 + mIRC v7.66.

Click on the button to reveal the spoiler. This code must be inserted into the scripts editor. To do this, press the key combination "ALT+R" and save this code as new "File/New" script called "AntiCode.mrc":

Code
#####################################################################
#   Name: Anti Code v1.0
#   Author: Epic (epicnet@mail.ru, http://epicnet.ru)
#   Description: Protection of the channel from user messages that use text formatting codes: Color/Bold/Underline/Italic.
#####################################################################

alias -l anticode_set {
  %ac_color = yes
  %ac_bold = yes
  %ac_underline = yes
  %ac_italic = yes
  %ac_limit_color = 0
  %ac_limit_bold = 1
  %ac_limit_underline = 1
  %ac_limit_italic = 1
  %ac_logo = Anti-Code:
  %ac_reason = the use of such codes on the channel is prohibited!
  %ac_except_nicks = Epic,Kamakzie,Win
  %ac_except_status = [!,~,&,@,%,+]
  %ac_btype = 2
  %ac_btime = 300
  %ac_kick = yes
}
on *:TEXT:*:#:{
  anticode_set | var %ac_prefix $mid($nick($chan,test2).pnick,1,1) | var %ac_es $eval($remove(%ac_except_status,[,]),0)
  if ($istok(%ac_es,%ac_prefix,44)) || ($istok(%ac_except_nicks,$nick,44)) { halt }
  if (%ac_color == yes && $textcode($1-).color) { anticode_ban color $chan $nick }
  if (%ac_bold == yes && $textcode($1-).bold) { anticode_ban bold $chan $nick }
  if (%ac_underline == yes && $textcode($1-).underline) { anticode_ban underline $chan $nick }
  if (%ac_italic == yes && $textcode($1-).italic) { anticode_ban italic $chan $nick }
}
alias -l textcode {
  if (color == $prop) { if ($count($1-,$chr(3)) > %ac_limit_color) { return $v1 } }
  if (bold == $prop) { if ($count($1-,$chr(2)) > %ac_limit_bold) { return $v1 } }
  if (underline == $prop) { if ($count($1-,$chr(31)) > %ac_limit_underline) { return $v1 } }
  if (italic == $prop) { if ($count($1-,$chr(29)) > %ac_limit_italic) { return $v1 } }
}
alias -l anticode_ban {
  if ($me !isop $2) { .echo $chan 05I do not have operator status on this channel. | halt }
  if (%ac_kick == yes) %ac_key = %ac_key k
  if (%ac_btime > 0) %ac_key = $+(%ac_key,u,%ac_btime)
  if (%ac_key) %ac_key = $+(-,%ac_key)
  .ban %ac_key $2 $3 %ac_btype %ac_logo $+(",$1,") - %ac_reason
  unset %ac_key
}


Remember that if something went wrong, or you accidentally erased something, then you can always reinstall this script again.
If you find any errors in the code and in its work, or maybe you have new ideas or if you think that this script needs to be improved, then be sure to write to me here about it, and we are together think about what we can do.

3 211 Read More
Feature Suggestions Jump to new posts
Re: Add Week-of-Year to $asctime() ISO 8601 maroon 22/08/21 03:47 AM
I had once started writing up a feature request for improvement to the $asctime format codes, but I don't think I actually posted it because I ran into problems of figuring out how to design $asctime in a way that preserves backwards compatibility between newer and older behavior.

//echo -a $asctime($calc(978307200+3600+61+$daylight +$timezone),$regsubex(foo,$str(x,94),/x/g,$chr($calc(32+ \n ))))

This shows that the current behavior of $asctime formatting is to substitute codes in place of recognized letters, but to leave unrecognized letters alone. The exception is that the % character is deleted from the output. This means that adding new symbols like w or W could cause differences in behavior between scripts running under newer versions recognizing more codes compared to older versions which don't.

$asctime(123, wtf)

Under versions where 'w' has no interpreted meaning, it shows the literal 'w'. Under newer versions recognizing 'w' as an ISO week, it would be impossible to show a literal 'w', just like it's impossible to allow a "T" in the formatting to being shown as a literal "T" instead of being interpreted as A or P.

A happy medium would be to allow the double quote character to enclose text that's immune to being translated. so

//echo -a $asctime($ctime, HH:nn:ss $+(",$me local time") on mm/dd/yy )

would show everything inside the doublequotes without being interpreted and without showing the doublequotes themselves.

I don't know what an intentional purpose could be for having $asctime formatting swallow the percent character, so I'm guessing it's probably a bug in a routine that's not expecting an embedded % character to survive after interpreting variable names into their contents.

//echo -a $asctime(123,a%b%c%)

..simply swallows the percents and displays the abc alone.

If a 'week' symbol is added I wonder if that would have people wanting to use it for logging filenames. That would let them have 'weekly' logs which always start on the same day of the week, instead of having one of their logs ranging from day 21-28 in some months or being day 21-31 in other months.

I wonder if users would have less use for ISO week/days, or more use for week-numbers which always begin on a Sunday instead of on a Monday, or for day-of-the-year where day 1 is always Jan 1st, and Dec 31 is always day 365 or 366 depending on whether it was a leap year. Having ISO functions for the week would probably also need ISO year codes which indicate which ISO year a particular Dec 31 falls in.
1 157 Read More
Bug Reports Jump to new posts
Changing nick list setting not applying to all... KindOne 22/08/21 01:00 AM
Changing nick list settings not applying to all channels at once.

Join two or more channels.

Right click a channel name in the treeview
Click Nick list...
[check] Auto-hide nick list
[check] Set as default for all channels
Click OK

It only applies to the channel you right clicked and whenever you join/rejoin a channel.

Should this apply to all open channels instantly when changes?
0 79 Read More
Scripts & Popups Jump to new posts
Re: Help with code Epic 21/08/21 05:07 PM
If I understand your question correctly, then you want to make the script respond to certain words written by users on your channel.

You can try using such an interesting and small script construction:
Code
on *:TEXT:*:#channel:{
  var %words = hello,bye
  var %text $remove($strip($1-),$chr(96),$chr(39),$chr(94),$chr(42),$chr(34),$chr(63),$chr(33),$chr(64),$chr(35),$chr(36),$chr(37),$chr(38),$chr(58),$chr(59),$chr(126),$chr(45),$chr(61),$chr(43),$chr(95),$chr(40),$chr(41),$chr(91),$chr(93),$chr(123),$chr(125),$chr(124),$chr(92),$chr(47),$chr(44),$chr(46))
  var %i 1 | while (%i <= $numtok(%words,44)) { var %s $gettok(%words,%i,44) | if ($istok(%text,%s,32)) { %w = %w %s } | inc %i }
  if (%w) { .echo -a 00,14Words $+(,$nick,) used:04 %w | unset %w }
}

In the variable "%words = hello,bye" you must list, separated by commas, all the words that you want to catch in messages.

The script will collect all the search-flagged words that will be found in the message (separated by a space) and display them in the echo message.

Screenshot:
    [Linked Image from i.ibb.co]

2 130 Read More
Scripts & Popups Jump to new posts
dialog help landonsandor 21/08/21 02:54 PM
Hello everybody. It's been ages since I've been around and asking for help, but I can't find the solution here. I want to add a function to an existing dialog. I want to add a dropdown menu but in a very specific and I just can't seem to find it. Say I have dropdown option A selected, then I want multiselect checkbox options 1-4 to show up below it. If I have dropdown option B selected, I want multiselect checkbox options 5-8 to show. This is for a Dungeons and Dragons script I use (instead of actually rolling dice and calculating stuff myself since it's faster this way). basically, if I want to use a use to attack, I want to be able to choose what options from a secondary list get used on that attack. I hope the information I have provided is everything you need to know to help me out. Thanks for your help in advnace smile
0 39 Read More
Feature Suggestions Jump to new posts
Re: Missing Documentation maroon 19/08/21 05:16 PM
My reply wasn't completely accurate. $lock(sendmessage) is not one of the other obsolete features returning $false. Instead, the option to enable or disable it is on options/other, instead of being at options/other/lock along with the other active remaining items.
34 38,307 Read More
Bug Reports Jump to new posts
Re: multiple editbox -n Epic 19/08/21 10:38 AM
Originally Posted by Raccoon
As of right now, $crlf nor $lf nor $cr can be used to stimulate multiple lines in the editbox, and it makes me very sad and gosh dang frustrated. :'(

Yes, I also this noticed  :-[  and it would be very useful to improve (develop) this function.
In addition, it would be helpful if we got a command to resize of the "Editbox" field to modes: "/editbox -m [Single,Multiple,Automatic,Pixels [N]] [window]".
And also, so that this field has the ability to automatically resize (in "Automatic" mode) when used the identifier $crlf for line break (linefeed down), when there is only one line in the text.

All this would be useful when creating scripts associated with this field for editing text.
4 291 Read More
Feature Suggestions Jump to new posts
New $ScaleFont() identifier Talon 19/08/21 06:19 AM
I'd like to request $ScaleFont() as a native identifier in mIRC.

$ScaleFont(text,font,min-size,width,height,bipt)

Please see the comments in the code snippet below for the usage.

mIRC has the ability to render text within a clipped region. /drawtext -c, which is quite handy, but one problem with picture windows, especially when it comes to drawing text, is there's no garuntee one users default @window font is the same, or if you specify some font with /drawtext, there's also no garuntee they have the same fonts installed on the system, so relying on font metrics for positioning text properly isn't an accurate assumption that those coordinates will apply correctly between any users potential font choices. This makes it extremely tricky to have a picture window oriented script render text properly across all users.

The problem gets even worse, fonts themselves do NOT follow any form of linear scaling so there's no logical scale from one font-point to another, even within the same font so calculating the proper font-point isn't too simple. We can greatly reduce this by using a form of estimation, and decreasing from there if it exceeds our bounds instead of having to step through all possible font-points to find the closest point to match our bound region.

This is actually more taxing than expected as a scripted solution, especially if you do something on a timed basis where text may need to be re-drawn. There may even be a better way to tackle this problem outside if mSL itself natively in C++ and win32 api like GDI+ GetTextMetrics, etc... which I'm sure $width() and $height() most likely use.

Below is my proposed identifier:

Code
;=======================================================================
; $ScaleFont(text,font,min-size,width,height,bipt)
; width OR height (not both) can be -1 to omit testing in this direction.
; "bipt" are the same as those within $width() and $height().
;
; This identifier returns the largest possible fontsize point to fit in
; a given rectangle. this WILL return your original size which may or
; may not fit, if your minimum size restraint still exceeds the rectangle.
; If you do not need this option, it's recommended to just pass "1" for
; this parameter.
;=======================================================================
ScaleFont {
  var %hw = $iif($6,$width($1,$2,1638,$6),$width($1,$2,1638)) , %hh = $iif($6,$height($1,$2,1638,$6),$height($1,$2,1638))
  if ($4 == -1 && $5 == -1) { return }
  elseif ($5 == -1) { var %wr = $4 / %hw , %hr = %wr }
  elseif ($4 == -1) { var %hr = $5 / %hh , %wr = %hr } 
  else { var %wr = $4 / %hw , %hr = $5 / %hh }

  var %efs = $int($calc(1638 * $min(%wr,%hr))) , %ew = $iif($5,$width($1,$2,%efs,$5),$width($1,$2,%efs)) , %eh = $iif($5,$height($1,$2,%efs,$5),$height($1,$2,%efs))
  while (%efs >= $3) && (($4 > 0 && %ew > $4) || ($5 > 0 && %eh > $5)) { var %efs = %efs - 1 , %ew = $iif($6,$width($1,$2,%efs,$6),$width($1,$2,%efs)) , %eh = $iif($6,$height($1,$2,%efs,$6),$height($1,$2,%efs)) }
  return $iif(%efs > $3,%efs,$3)
}


Below is a test alias to utilize the above identifier. IMPORTANT NOTE! Some fonts only have one size, if you're still using mIRC's default "Fixedsys" for testing, you WILL NOT see this work. After @Test is open, use it's titlebar icon to select a new font to test with under "Font..." then execute the command again to see it re-drawn with the newly selected font.

Heres some examples of using:
/TestScaleFont <w> <h> <text>

Fixed rectangle bounding box (execute these one at a time to watch the size shrink-to-fit the bounding rectangle):
/testscalefont 200 30 Mooo! This is a test!
/testscalefont 200 30 Mooo! This is a test! and only a test..
/testscalefont 200 30 Mooo! This is a test! and only a test... Wow!

Fixed Height, not width:
/testscalefont -1 30 Mooo! This is a test! and only a test...

Fixed Width, not height:
/testscalefont 300 -1 Mooo! This is a test!

Code
TestScaleFont {
  window -dp @Test -1 -1 640 480
  drawrect -nf @Test $color(background) 1 0 0 640 480
  var %FontSize = $ScaleFont($3-,$window(@Test).font,1,$1,$2) , %w = $width($3-,$window(@Test).font,%FontSize) , %h = $height($3-,$window(@Test).font,%FontSize)
  var %cw = $iif($1 > 0,$calc(($1 - %w) // 2),0) , %ch = $iif($2 > 0,$calc(($2 - %h) // 2),0)
  drawrect -n @Test 4 1 1 1 $iif($1 > 0,$1,%w) $iif($2 > 0,$2,%h)
  drawtext -nc @Test $color(normal) $qt($window(@Test).font) %FontSize %cw %ch $iif($1 > 0,$1,%w) $iif($2 > 0,$2,%h) $3-
  drawdot @Test
  echo -s *** Debug-Fontsize: %FontSize , Max/Overall Width: $+($1,/,%w) , Max/Overall Height: $+($2,/,%h) Centering: %cw %ch
}
0 49 Read More